Pref: Wb : move 'Wb by tab' to wb pref page.

This commit is contained in:
Paddle
2023-03-28 15:16:59 +02:00
parent 4686420326
commit 963fc2b17e
5 changed files with 41 additions and 22 deletions

View File

@@ -129,25 +129,6 @@ will be shown at the lower left corner in opened files</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="CheckBox_WbByTab">
<property name="toolTip">
<string>If checked, application will remember which workbench is active for each tab of the viewport</string>
</property>
<property name="text">
<string>Remember active workbench by tab</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SaveWBbyTab</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -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();

View File

@@ -111,6 +111,25 @@ after FreeCAD launches</string>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="Gui::PrefCheckBox" name="CheckBox_WbByTab">
<property name="toolTip">
<string>If checked, application will remember which workbench is active for each tab of the viewport</string>
</property>
<property name="text">
<string>Remember active workbench by tab</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SaveWBbyTab</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
@@ -120,6 +139,11 @@ after FreeCAD launches</string>
<extends>QListWidget</extends>
<header>ListWidgetDragBugFix.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@@ -240,6 +240,7 @@ DlgSettingsWorkbenchesImp::DlgSettingsWorkbenchesImp( QWidget* parent )
connect(ui->wbList->model(), &QAbstractItemModel::rowsMoved, this, &DlgSettingsWorkbenchesImp::wbItemMoved);
connect(ui->AutoloadModuleCombo, QOverload<int>::of(&QComboBox::activated), this, &DlgSettingsWorkbenchesImp::onStartWbChanged);
connect(ui->WorkbenchSelectorPosition, QOverload<int>::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();
}

View File

@@ -56,6 +56,7 @@ protected Q_SLOTS:
void wbItemMoved();
void onWbSelectorChanged(int index);
void onStartWbChanged(int index);
void onWbByTabToggled(bool val);
protected:
void buildWorkbenchList();