diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp index 5c30e5fced..4e6ca319a3 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp +++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp @@ -168,6 +168,8 @@ void SketcherSettings::saveSettings() index = ui->ovpVisibility->currentIndex(); hGrp->SetInt("OnViewParameterVisibility", index); + + checkForRestart(); } void SketcherSettings::loadSettings() @@ -179,7 +181,9 @@ void SketcherSettings::loadSettings() ui->checkBoxNotifyConstraintSubstitutions->onRestore(); ui->checkBoxAutoRemoveRedundants->onRestore(); ui->checkBoxUnifiedCoincident->onRestore(); + setProperty("checkBoxUnifiedCoincident", ui->checkBoxUnifiedCoincident->isChecked()); ui->checkBoxHorVerAuto->onRestore(); + setProperty("checkBoxHorVerAuto", ui->checkBoxHorVerAuto->isChecked()); // Dimensioning constraints mode ui->dimensioningMode->clear(); @@ -193,6 +197,7 @@ void SketcherSettings::loadSettings() bool SeparatedTools = hGrp->GetBool("SeparatedDimensioningTools", false); int index = SeparatedTools ? (singleTool ? 2 : 1) : 0; ui->dimensioningMode->setCurrentIndex(index); + setProperty("dimensioningMode", index); connect(ui->dimensioningMode, QOverload::of(&QComboBox::currentIndexChanged), this, @@ -225,7 +230,20 @@ void SketcherSettings::loadSettings() void SketcherSettings::dimensioningModeChanged(int index) { ui->radiusDiameterMode->setEnabled(index != 1); - SketcherSettings::requireRestart(); +} + +void SketcherSettings::checkForRestart() +{ + if (property("dimensioningMode").toInt() != ui->dimensioningMode->currentIndex()) { + SketcherSettings::requireRestart(); + } + if (property("checkBoxUnifiedCoincident").toBool() + != ui->checkBoxUnifiedCoincident->isChecked()) { + SketcherSettings::requireRestart(); + } + if (property("checkBoxHorVerAuto").toBool() != ui->checkBoxHorVerAuto->isChecked()) { + SketcherSettings::requireRestart(); + } } /** diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.h b/src/Mod/Sketcher/Gui/SketcherSettings.h index ddc8261635..49b569c040 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.h +++ b/src/Mod/Sketcher/Gui/SketcherSettings.h @@ -52,6 +52,7 @@ public: protected: void changeEvent(QEvent* e) override; void dimensioningModeChanged(int index); + void checkForRestart(); private: std::unique_ptr ui;