diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 087a02ef71..40fa148ab3 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -559,8 +559,15 @@ Application::Application(bool GUIenabled) _pcWorkbenchDictionary = PyDict_New(); #ifdef USE_3DCONNEXION_NAVLIB - // Instantiate the 3Dconnexion controller - pNavlibInterface = new NavlibInterface(); + ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/View"); + if (!hViewGrp->GetBool("LegacySpaceMouseDevices", false)) { + // Instantiate the 3Dconnexion controller + pNavlibInterface = new NavlibInterface(); + } + else { + pNavlibInterface = nullptr; + } #endif if (GUIenabled) { @@ -2293,7 +2300,9 @@ void Application::runApplication() Gui::getMainWindow()->setProperty("eventLoop", true); #ifdef USE_3DCONNEXION_NAVLIB - Instance->pNavlibInterface->enableNavigation(); + if (Instance->pNavlibInterface) { + Instance->pNavlibInterface->enableNavigation(); + } #endif runEventLoop(mainApp); diff --git a/src/Gui/PreferencePages/DlgSettingsNavigation.cpp b/src/Gui/PreferencePages/DlgSettingsNavigation.cpp index e51b5b5594..1d71982431 100644 --- a/src/Gui/PreferencePages/DlgSettingsNavigation.cpp +++ b/src/Gui/PreferencePages/DlgSettingsNavigation.cpp @@ -60,6 +60,9 @@ DlgSettingsNavigation::DlgSettingsNavigation(QWidget* parent) ui->naviCubeBaseColor->setAllowTransparency(true); ui->rotationCenterColor->setAllowTransparency(true); retranslate(); +#if !defined(_USE_3DCONNEXION_SDK) && !defined(SPNAV_FOUND) + ui->legacySpaceMouseDevices->setDisabled(true); +#endif } /** @@ -97,6 +100,10 @@ void DlgSettingsNavigation::saveSettings() ui->prefCubeSize->onSave(); ui->naviCubeBaseColor->onSave(); ui->naviCubeInactiveOpacity->onSave(); + ui->legacySpaceMouseDevices->onSave(); + if (property("LegacySpaceMouse").toBool() != ui->legacySpaceMouseDevices->isChecked()) { + requireRestart(); + } bool showNaviCube = ui->groupBoxNaviCube->isChecked(); hGrp->SetBool("ShowNaviCube", showNaviCube); @@ -143,6 +150,8 @@ void DlgSettingsNavigation::loadSettings() ui->prefCubeSize->onRestore(); ui->naviCubeBaseColor->onRestore(); ui->naviCubeInactiveOpacity->onRestore(); + ui->legacySpaceMouseDevices->onRestore(); + setProperty("LegacySpaceMouse", ui->legacySpaceMouseDevices->isChecked()); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/View"); diff --git a/src/Gui/PreferencePages/DlgSettingsNavigation.ui b/src/Gui/PreferencePages/DlgSettingsNavigation.ui index afcd9db072..513bcfdce8 100644 --- a/src/Gui/PreferencePages/DlgSettingsNavigation.ui +++ b/src/Gui/PreferencePages/DlgSettingsNavigation.ui @@ -7,7 +7,7 @@ 0 0 548 - 762 + 795 @@ -255,7 +255,7 @@ Base color for all elements - + 226 232 @@ -335,7 +335,7 @@ The color of the rotation center indicator - + 255 0 @@ -572,7 +572,7 @@ Free Turntable: the part will be rotated around the z-axis. - + Sets camera zoom for new documents. The value is the diameter of the sphere to fit on the screen. @@ -580,21 +580,21 @@ The value is the diameter of the sphere to fit on the screen. mm - + 0.000010000000000 - + 10000000.000000000000000 + + 100.000000000000000 + NewDocumentCameraScale View - - 100.000000000000000 - @@ -721,6 +721,28 @@ Mouse tilting is not disabled by this setting. + + + + Space mouse + + + + + + Enable support of legacy space mouse devices + + + LegacySpaceMouseDevices + + + View + + + + + +