Gui: convert TreeView prefs in General/Selection to PrefCheckBox

This commit is contained in:
0penBrain
2023-06-24 19:43:11 +02:00
committed by Chris Hennes
parent 6fdabd9651
commit 5be3ad33aa
2 changed files with 45 additions and 17 deletions

View File

@@ -50,12 +50,11 @@ void DlgSettingsSelection::saveSettings()
ui->HighlightColor->onSave();
ui->SelectionColor->onSave();
ui->spinPickRadius->onSave();
auto handle = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
handle->SetBool("SyncView", ui->checkBoxAutoSwitch->isChecked());
handle->SetBool("SyncSelection", ui->checkBoxAutoExpand->isChecked());
handle->SetBool("PreSelection", ui->checkBoxPreselect->isChecked());
handle->SetBool("RecordSelection", ui->checkBoxRecord->isChecked());
handle->SetBool("CheckBoxesSelection", ui->checkBoxSelectionCheckBoxes->isChecked());
ui->checkBoxAutoSwitch->onSave();
ui->checkBoxAutoExpand->onSave();
ui->checkBoxPreselect->onSave();
ui->checkBoxRecord->onSave();
ui->checkBoxSelectionCheckBoxes->onSave();
}
void DlgSettingsSelection::loadSettings()
@@ -65,12 +64,11 @@ void DlgSettingsSelection::loadSettings()
ui->HighlightColor->onRestore();
ui->SelectionColor->onRestore();
ui->spinPickRadius->onRestore();
auto handle = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
ui->checkBoxAutoSwitch->setChecked(handle->GetBool("SyncView", true));
ui->checkBoxAutoExpand->setChecked(handle->GetBool("SyncSelection", true));
ui->checkBoxPreselect->setChecked(handle->GetBool("PreSelection", true));
ui->checkBoxRecord->setChecked(handle->GetBool("RecordSelection", true));
ui->checkBoxSelectionCheckBoxes->setChecked(handle->GetBool("CheckBoxesSelection"));
ui->checkBoxAutoSwitch->onRestore();
ui->checkBoxAutoExpand->onRestore();
ui->checkBoxPreselect->onRestore();
ui->checkBoxRecord->onRestore();
ui->checkBoxSelectionCheckBoxes->onRestore();
}
void DlgSettingsSelection::changeEvent(QEvent *e)

View File

@@ -174,38 +174,68 @@ Larger value eases to pick things, but can make small features impossible to sel
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAutoSwitch">
<widget class="Gui::PrefCheckBox" name="checkBoxAutoSwitch">
<property name="text">
<string>Auto switch to the 3D view containing the selected item</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SyncView</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAutoExpand">
<widget class="Gui::PrefCheckBox" name="checkBoxAutoExpand">
<property name="text">
<string>Auto expand tree item when the corresponding object is selected in 3D view</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SyncSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxPreselect">
<widget class="Gui::PrefCheckBox" name="checkBoxPreselect">
<property name="text">
<string>Preselect the object in 3D view when mouse over the tree item</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>PreSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxRecord">
<widget class="Gui::PrefCheckBox" name="checkBoxRecord">
<property name="text">
<string>Record selection in tree view in order to go back/forward using navigation button</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>RecordSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSelectionCheckBoxes">
<widget class="Gui::PrefCheckBox" name="checkBoxSelectionCheckBoxes">
<property name="text">
<string>Add checkboxes for selection in document tree</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>CheckBoxesSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>TreeView</cstring>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">