diff --git a/src/Gui/DlgSettings3DView.ui b/src/Gui/DlgSettings3DView.ui index c947251286..138c0bea19 100644 --- a/src/Gui/DlgSettings3DView.ui +++ b/src/Gui/DlgSettings3DView.ui @@ -129,25 +129,6 @@ will be shown at the lower left corner in opened files - - - - If checked, application will remember which workbench is active for each tab of the viewport - - - Remember active workbench by tab - - - false - - - SaveWBbyTab - - - View - - - diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index 4bcb3ad5ab..1d5a80320e 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -82,7 +82,6 @@ void DlgSettings3DViewImp::saveSettings() ui->CheckBox_CornerCoordSystem->onSave(); ui->SpinBox_CornerCoordSystemSize->onSave(); ui->CheckBox_ShowAxisCross->onSave(); - ui->CheckBox_WbByTab->onSave(); ui->CheckBox_ShowFPS->onSave(); ui->spinPickRadius->onSave(); ui->CheckBox_use_SW_OpenGL->onSave(); @@ -100,7 +99,6 @@ void DlgSettings3DViewImp::loadSettings() ui->CheckBox_CornerCoordSystem->onRestore(); ui->SpinBox_CornerCoordSystemSize->onRestore(); ui->CheckBox_ShowAxisCross->onRestore(); - ui->CheckBox_WbByTab->onRestore(); ui->CheckBox_ShowFPS->onRestore(); ui->spinPickRadius->onRestore(); ui->CheckBox_use_SW_OpenGL->onRestore(); diff --git a/src/Gui/DlgSettingsWorkbenches.ui b/src/Gui/DlgSettingsWorkbenches.ui index f21e38e188..e6eb241d4d 100644 --- a/src/Gui/DlgSettingsWorkbenches.ui +++ b/src/Gui/DlgSettingsWorkbenches.ui @@ -111,6 +111,25 @@ after FreeCAD launches + + + + If checked, application will remember which workbench is active for each tab of the viewport + + + Remember active workbench by tab + + + false + + + SaveWBbyTab + + + View + + + @@ -120,6 +139,11 @@ after FreeCAD launches QListWidget
ListWidgetDragBugFix.h
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
diff --git a/src/Gui/DlgSettingsWorkbenchesImp.cpp b/src/Gui/DlgSettingsWorkbenchesImp.cpp index 2b91a9b69b..d0581c3a04 100644 --- a/src/Gui/DlgSettingsWorkbenchesImp.cpp +++ b/src/Gui/DlgSettingsWorkbenchesImp.cpp @@ -240,6 +240,7 @@ DlgSettingsWorkbenchesImp::DlgSettingsWorkbenchesImp( QWidget* parent ) connect(ui->wbList->model(), &QAbstractItemModel::rowsMoved, this, &DlgSettingsWorkbenchesImp::wbItemMoved); connect(ui->AutoloadModuleCombo, QOverload::of(&QComboBox::activated), this, &DlgSettingsWorkbenchesImp::onStartWbChanged); connect(ui->WorkbenchSelectorPosition, QOverload::of(&QComboBox::activated), this, &DlgSettingsWorkbenchesImp::onWbSelectorChanged); + connect(ui->CheckBox_WbByTab, &QCheckBox::toggled, this, &DlgSettingsWorkbenchesImp::onWbByTabToggled); } /** @@ -298,6 +299,8 @@ void DlgSettingsWorkbenchesImp::saveSettings() QString startWbName = data.toString(); App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")-> SetASCII("AutoloadModule", startWbName.toLatin1()); + + ui->CheckBox_WbByTab->onSave(); } void DlgSettingsWorkbenchesImp::loadSettings() @@ -325,6 +328,11 @@ void DlgSettingsWorkbenchesImp::loadSettings() //We set the startup setting after building the list so that we can put only the enabled wb. setStartWorkbenchComboItems(); + + { + QSignalBlocker sigblk(ui->CheckBox_WbByTab); + ui->CheckBox_WbByTab->onRestore(); + } } /** @@ -552,8 +560,15 @@ void DlgSettingsWorkbenchesImp::onStartWbChanged(int index) } } -void Gui::Dialog::DlgSettingsWorkbenchesImp::onWbSelectorChanged(int index) +void DlgSettingsWorkbenchesImp::onWbSelectorChanged(int index) { + Q_UNUSED(index); + requireReboot(); +} + +void DlgSettingsWorkbenchesImp::onWbByTabToggled(bool val) +{ + Q_UNUSED(val); requireReboot(); } diff --git a/src/Gui/DlgSettingsWorkbenchesImp.h b/src/Gui/DlgSettingsWorkbenchesImp.h index 8cc95381f1..ce91a31034 100644 --- a/src/Gui/DlgSettingsWorkbenchesImp.h +++ b/src/Gui/DlgSettingsWorkbenchesImp.h @@ -56,6 +56,7 @@ protected Q_SLOTS: void wbItemMoved(); void onWbSelectorChanged(int index); void onStartWbChanged(int index); + void onWbByTabToggled(bool val); protected: void buildWorkbenchList();