Commit 7566b705 authored by Bob Obara's avatar Bob Obara

BUG: More Fixings to Assign Colors GUI

There were two problems:
* If you closed the Preset Dialog via escape the GUI interface would hang.  Note that this behavior was also found in ParaView and was fixed in its master branch.
* If you double clicked on a Palette it would crash the application - this was a side effect of a previous fix.  Instead of deleting the dialog when applying the palette, the fix should have been to queue up the deletion so it could occur after the dialog had finished processing its events.
parent b446e613
......@@ -253,6 +253,8 @@ void smtkAssignColorsView::prepPaletteChooser()
QObject::connect( // When the user has chosen a preference, remember and apply it.
this->Internals->PaletteChooser, SIGNAL(applyPreset(const Json::Value&)), this,
SLOT(setDefaultPaletteAndApply()));
QObject::connect( // When the user has cancel the dialog.
this->Internals->PaletteChooser, SIGNAL(rejected()), this, SLOT(resetPaletteChooser()));
}
void smtkAssignColorsView::createWidget()
......@@ -439,6 +441,12 @@ void smtkAssignColorsView::applyDefaultColor()
this->requestOperation(this->Internals->CurrentOp);
}
void smtkAssignColorsView::resetPaletteChooser()
{
delete this->Internals->PaletteChooser;
this->prepPaletteChooser();
}
void smtkAssignColorsView::setDefaultPaletteAndApply()
{
const Json::Value& preset = this->Internals->PaletteChooser->currentPreset();
......@@ -451,7 +459,7 @@ void smtkAssignColorsView::setDefaultPaletteAndApply()
// dialog - the UI does not seem to respond after you set the default palette.
// One solution that seems to work is to destroy and recreate the dialog
this->Internals->PaletteChooser->hide();
delete this->Internals->PaletteChooser;
this->Internals->PaletteChooser->deleteLater();
this->prepPaletteChooser();
this->Internals->ApplyDefaultPaletteBtn->setText(QString::fromUtf8(name.c_str()));
......
......@@ -57,7 +57,7 @@ protected slots:
virtual void processOpacityValue(double);
virtual void removeColors();
virtual void setDefaultPaletteAndApply();
virtual void resetPaletteChooser();
// This slot is used to indicate that the underlying attribute
// for the operation should be checked for validity
virtual void attributeModified();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment