Skip to content

Commit

Permalink
Merge pull request #29542 from alja/palette-11-1
Browse files Browse the repository at this point in the history
Fireworks 11_1_X: Fix crash on use of non-default palette (forward port)
  • Loading branch information
cmsbuild committed Apr 24, 2020
2 parents aa6aa01 + aafb03c commit 329fdef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Fireworks/Core/src/CmsShowCommonPopup.cc
Expand Up @@ -200,6 +200,7 @@ CmsShowCommonPopup::CmsShowCommonPopup(CmsShowCommon* model, const TGWindow* p,
hf->AddFrame(transpWidget3D);
top->AddFrame(hf, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 10));
}

std::string names[kFWGeomColorSize];
names[kFWPixelBarrelColorIndex] = "Pixel Barrel";
names[kFWPixelEndcapColorIndex] = "Pixel Endcap";
Expand All @@ -211,8 +212,7 @@ CmsShowCommonPopup::CmsShowCommonPopup(CmsShowCommon* model, const TGWindow* p,
for (int k = 0; k < 3; ++k) {
TGHorizontalFrame* hf = new TGHorizontalFrame(top);
top->AddFrame(hf);

for (int j = 0; j < 2; ++j) {
for (int j = 0; j < 3; ++j) {
m_colorSelectWidget[i] = new FWColorSelect(hf, names[i].c_str(), 0, m_common->colorManager(), i);
hf->AddFrame(m_colorSelectWidget[i]);
m_colorSelectWidget[i]->SetColorByIndex(m_common->colorManager()->geomColor(FWGeomColorIndex(i)), kFALSE);
Expand Down
28 changes: 3 additions & 25 deletions Fireworks/Core/src/CmsShowSearchFiles.cc
Expand Up @@ -48,22 +48,6 @@ static const std::string s_httpPrefix("http:");
static const std::string s_filePrefix("file:");
static const std::string s_rootPostfix(".root");

namespace {
float getURLResponseTime(const char* url) {
TString com = "ping -q -c 1 -n " + TString(url) + "| tail -n 1";
FILE* p = gSystem->OpenPipe(com, "r");
TString l;
l.Gets(p);
gSystem->ClosePipe(p);

TPMERegexp re("([\\d\\.]+)");
if (re.Match(l))
return re[1].Atof();
else
return -1;
}
} // namespace

CmsShowSearchFiles::CmsShowSearchFiles(
const char* filename, const char* windowname, const TGWindow* p, UInt_t w, UInt_t h)
: TGTransientFrame(gClient->GetDefaultRoot(), p, w, h) {
Expand Down Expand Up @@ -99,15 +83,9 @@ CmsShowSearchFiles::CmsShowSearchFiles(
cancel->Connect("Clicked()", "CmsShowSearchFiles", this, "UnmapWindow()");

SetWindowName(windowname);
float x1 = getURLResponseTime("lxplus.cern.ch");
float x2 = getURLResponseTime("uaf.t2.ucsd.edu");
// printf("timtes %f %f \n", x1, x2); fflush(stdout);

std::string path;
if (x1 > 0 && x1 < x2)
path = Form("http://fireworks.web.cern.ch/fireworks/%d/", fireworks::supportedDataFormatsVersion()[0]);
else if (x2 > 0)
path = Form("http://uaf.t2.ucsd.edu/fireworks/%d/", fireworks::supportedDataFormatsVersion()[0]);

std::string path =
Form("http://cmsshow-rels.web.cern.ch/cmsShow-rels/samples/%d/", fireworks::supportedDataFormatsVersion()[0]);

if (!path.empty())
fwLog(fwlog::kInfo) << "Search files at " << path << "." << std::endl;
Expand Down

0 comments on commit 329fdef

Please sign in to comment.