[Gui] move a NaviCube parameter to the NaviCube parameter group

- at the moment some NaviCube parameters are in the general View group, some in the dedicated NaviCube group
This commit is contained in:
Uwe
2022-06-17 01:52:01 +02:00
parent d35400aae3
commit 1b5285bebd
5 changed files with 25 additions and 13 deletions

View File

@@ -77,10 +77,6 @@ void DlgSettingsNavigation::saveSettings()
int index = ui->comboOrbitStyle->currentIndex();
hGrp->SetInt("OrbitStyle", index);
index = ui->naviCubeCorner->currentIndex();
hGrp->SetInt("CornerNaviCube", index);
index = ui->comboRotationMode->currentIndex();
hGrp->SetInt("RotationMode", index);
@@ -91,6 +87,7 @@ void DlgSettingsNavigation::saveSettings()
ui->checkBoxUseAutoRotation->onSave();
ui->qspinNewDocScale->onSave();
ui->prefStepByTurn->onSave();
ui->naviCubeCorner->onSave();
ui->naviCubeToNearest->onSave();
ui->prefCubeSize->onSave();
@@ -117,6 +114,7 @@ void DlgSettingsNavigation::loadSettings()
ui->checkBoxUseAutoRotation->onRestore();
ui->qspinNewDocScale->onRestore();
ui->prefStepByTurn->onRestore();
ui->naviCubeCorner->onRestore();
ui->naviCubeToNearest->onRestore();
ui->prefCubeSize->onRestore();
@@ -130,9 +128,6 @@ void DlgSettingsNavigation::loadSettings()
index = Base::clamp(index, 0, ui->comboOrbitStyle->count()-1);
ui->comboOrbitStyle->setCurrentIndex(index);
index = hGrp->GetInt("CornerNaviCube", 1);
ui->naviCubeCorner->setCurrentIndex(index);
index = hGrp->GetInt("RotationMode", 1);
ui->comboRotationMode->setCurrentIndex(index);

View File

@@ -51,7 +51,7 @@
<cstring>NaviStepByTurn</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
<cstring>NaviCube</cstring>
</property>
</widget>
</item>
@@ -82,13 +82,19 @@
</widget>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="naviCubeCorner">
<widget class="Gui::PrefComboBox" name="naviCubeCorner">
<property name="toolTip">
<string>Corner where navigation cube is shown</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>CornerNaviCube</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NaviCube</cstring>
</property>
<item>
<property name="text">
<string>Top left</string>
@@ -577,6 +583,11 @@ Mouse tilting is not disabled by this setting.</string>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefComboBox</class>
<extends>QComboBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>

View File

@@ -7,6 +7,7 @@
<FCBool Name="UseSoftwareOpenGL" Value="0"/>
</FCParamGroup>
<FCParamGroup Name="NaviCube">
<FCInt Name="CornerNaviCube" Value="1"/>
<FCInt Name="CubeSize" Value="132"/>
<FCBool Name="NaviRotateToNearest" Value="1"/>
</FCParamGroup>
@@ -15,7 +16,6 @@
<FCFloat Name="BoundingBoxFontSize" Value="10.0"/>
<FCBool Name="CornerCoordSystem" Value="1"/>
<FCInt Name="CornerCoordSystemSize" Value="10"/>
<FCInt Name="CornerNaviCube" Value="1"/>
<FCBool Name="CheckBoxSelectionCheckBoxes" Value="1"/>
<FCBool Name="InvertZoom" Value="1"/>
<FCInt Name="NaviStepByTurn" Value="8"/>

View File

@@ -98,6 +98,10 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
hGrp->Attach(this);
hGrpNavi =
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/NaviCube");
hGrpNavi->Attach(this);
//anti-aliasing settings
bool smoothing = false;
bool glformat = false;
@@ -145,7 +149,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
OnChange(*hGrp,"UseBackgroundColorMid");
OnChange(*hGrp,"ShowFPS");
OnChange(*hGrp,"ShowNaviCube");
OnChange(*hGrp,"CornerNaviCube");
OnChange(*hGrpNavi, "CornerNaviCube");
OnChange(*hGrp,"UseVBO");
OnChange(*hGrp,"RenderCache");
OnChange(*hGrp,"Orthographic");
@@ -178,6 +182,7 @@ View3DInventor::~View3DInventor()
_pcDocument->saveCameraSettings(SoFCDB::writeNodesToString(Cam).c_str());
}
hGrp->Detach(this);
hGrpNavi->Detach(this);
//If we destroy this viewer by calling 'delete' directly the focus proxy widget which is defined
//by a widget in SoQtViewer isn't reset. This widget becomes a dangling pointer and makes
@@ -369,8 +374,8 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
else if (strcmp(Reason,"ShowNaviCube") == 0) {
_viewer->setEnabledNaviCube(rGrp.GetBool("ShowNaviCube",true));
}
else if (strcmp(Reason,"CornerNaviCube") == 0) {
_viewer->setNaviCubeCorner(rGrp.GetInt("CornerNaviCube",1));
else if (strcmp(Reason, "CornerNaviCube") == 0) {
_viewer->setNaviCubeCorner(rGrp.GetInt("CornerNaviCube", 1));
}
else if (strcmp(Reason,"UseVBO") == 0) {
_viewer->setEnabledVBO(rGrp.GetBool("UseVBO",false));

View File

@@ -133,6 +133,7 @@ protected:
/// handle to the viewer parameter group
ParameterGrp::handle hGrp;
ParameterGrp::handle hGrpNavi;
private:
View3DInventorViewer * _viewer;