Skip to content

Commit

Permalink
refs #5693. Prevented changing of custom color map.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Jul 8, 2013
1 parent 2dd1aae commit e3979f0
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions Code/Mantid/MantidPlot/src/PlotDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,22 @@ void PlotDialog::initPercentilePage()
connect(boxFillSymbols, SIGNAL(clicked()), this, SLOT(fillBoxSymbols()));
}

/*
* Hides the "Custom color map" button when the user has not selected that specific button.
*/
void PlotDialog::showColorMapEditor(bool)
{
if (grayScaleBox->isChecked() || defaultScaleBox->isChecked())
{
mSelectColormap->hide();
}
else
{
mSelectColormap->show();
connect(mSelectColormap,SIGNAL(clicked()),this,SLOT(changeColormap()));
}
}

void PlotDialog::initSpectrogramPage()
{
spectrogramPage = new QWidget();
Expand All @@ -1170,14 +1186,14 @@ void PlotDialog::initSpectrogramPage()

QVBoxLayout *vl = new QVBoxLayout();
grayScaleBox = new QRadioButton(tr("&Gray Scale"));
//connect(grayScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
connect(grayScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
vl->addWidget(grayScaleBox);
defaultScaleBox = new QRadioButton(tr("&Default Color Map"));
//connect(defaultScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
connect(defaultScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
vl->addWidget(defaultScaleBox);
customScaleBox = new QRadioButton(tr("&Custom Color Map"));
//connect(customScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
connect(customScaleBox, SIGNAL(toggled(bool)), this, SLOT(showSelectColorMapButton(bool)));
connect(customScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
// connect(customScaleBox, SIGNAL(toggled(bool)), this, SLOT(showSelectColorMapButton(bool)));
vl->addWidget(customScaleBox);

QHBoxLayout *hl = new QHBoxLayout(imageGroupBox);
Expand Down Expand Up @@ -2888,26 +2904,6 @@ void PlotDialog::customVectorsPage(bool angleMag)
}
}

void PlotDialog::showColorMapEditor(bool)
{
// if (grayScaleBox->isChecked() || defaultScaleBox->isChecked())
// {
// colorMapEditor->hide();
// mSelectColormap->hide();
// }
// else
// {
// colorMapEditor->show();
// colorMapEditor->setFocus();
// }
}

void PlotDialog::showSelectColorMapButton(bool )
{
mSelectColormap->show();
connect(mSelectColormap,SIGNAL(clicked()),this,SLOT(changeColormap()));
}

/**
This slot gets called on clicking slect colormap button
*/
Expand Down

0 comments on commit e3979f0

Please sign in to comment.