Commit 71d0afea authored by Bob Obara's avatar Bob Obara Committed by Kitware Robot

Merge topic 'moreFixesForColorAssignColors' into release

7566b705 BUG: More Fixings to Assign Colors GUI
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: John Tourtellott's avatarJohn Tourtellott <john.tourtellott@kitware.com>
Merge-request: !1578
parents 1e4a5dcd 7566b705
Pipeline #138651 running with stage
......@@ -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