only save setting if grid view is shown or not

This commit is contained in:
wmayer
2018-12-02 12:15:28 +01:00
parent e654e476f6
commit 4d4f016277
2 changed files with 10 additions and 1 deletions

View File

@@ -138,6 +138,14 @@ bool SketcherGeneralWidget::isGridViewChecked() const
return ui->checkBoxShowGrid->isChecked();
}
void SketcherGeneralWidget::saveGridViewChecked()
{
// only save this setting
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Sketcher/General");
hGrp->SetBool("ShowGrid", ui->checkBoxShowGrid->isChecked());
}
void SketcherGeneralWidget::onToggleGridView(bool on)
{
checkGridView(on);
@@ -270,7 +278,7 @@ void TaskSketcherGeneral::onToggleGridView(bool on)
{
Base::ConnectionBlocker block(changedSketchView);
sketchView->ShowGrid.setValue(on);
widget->saveSettings();
widget->saveGridViewChecked();
}
void TaskSketcherGeneral::onSetGridSize(double val)

View File

@@ -58,6 +58,7 @@ public:
void checkAutoconstraints(bool);
bool isGridViewChecked() const;
void saveGridViewChecked();
Q_SIGNALS:
void emitToggleGridView(bool);