]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Move navigation preferences to Salome page
authornkv <nkv@opencascade.com>
Mon, 9 Jun 2008 09:36:18 +0000 (09:36 +0000)
committernkv <nkv@opencascade.com>
Mon, 9 Jun 2008 09:36:18 +0000 (09:36 +0000)
src/LightApp/LightApp_Application.cxx
src/SVTK/SVTK_MainWindow.cxx
src/SVTK/SVTK_ViewModel.cxx

index 3bdc1cb195c5dca2f5c93b0e0a6bef5bb78015a5..1e0f9eb8b0ce166e5391d62fa77f78e444da66e0 100644 (file)
@@ -1303,7 +1303,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
                               resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
       vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
                                resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
-                               resMgr->integerValue( "VTKViewer", "spacemouse_func3_btn", vm->spacemouseBtn(3) ) );
+                               resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
       new LightApp_VTKSelector( vm, mySelMgr );
       vm->connectToApplication(this);
     }
@@ -1851,7 +1851,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
                                             "spacemouse_func2_btn" ); //increase_speed_increment
   int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM,
                                             LightApp_Preferences::Selector, "VTKViewer",
-                                            "spacemouse_func3_btn" ); //dominant_combined_switch
+                                            "spacemouse_func5_btn" ); //dominant_combined_switch
 
   QStringList values;
   values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) );
@@ -2161,11 +2161,11 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
 #ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) || 
                                         param == QString( "spacemouse_func2_btn" ) ||
-                                        param == QString( "spacemouse_func3_btn" ) ) )
+                                        param == QString( "spacemouse_func5_btn" ) ) )
   {
     int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 );
     int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 );
-    int btn3 = resMgr->integerValue( "VTKViewer", "spacemouse_func3_btn", 9 );
+    int btn3 = resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", 9 );
     QList<SUIT_ViewManager*> lst;
 #ifndef DISABLE_SALOMEOBJECT
     viewManagers( SVTK_Viewer::Type(), lst );
index da9e4b5ae0b192025b3d864cb0f1ebfa5a7981dd..b9ca147a71335694f59820bfed93d504cfd75283 100644 (file)
@@ -781,21 +781,26 @@ void SVTK_MainWindow::activateWindowFit()
 void SVTK_MainWindow::onSwitchInteractionStyle(bool theOn)
 {
   if (theOn) {
-    // keep the same style extensions
-    SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)GetInteractorStyle();
-    if ( aStyle ) {
-      myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
-      myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
+    // check if style is already set
+    if ( GetInteractorStyle() != myKeyFreeInteractorStyle.GetPointer() )
+    {
+      // keep the same style extensions
+      SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)GetInteractorStyle();
+      if ( aStyle ) {
+       myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
+       myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
+      }
+
+      PushInteractorStyle(myKeyFreeInteractorStyle.GetPointer());
     }
-
-    PushInteractorStyle(myKeyFreeInteractorStyle.GetPointer());
   }
   else {
     PopInteractorStyle();
   }
 
   // update action state if method is called outside
-  action(SwitchInteractionStyleId)->setChecked( theOn );
+  QtxAction* a = action( SwitchInteractionStyleId );
+  if ( a->isChecked() != theOn ) a->setChecked( theOn );
 }
 
 /*!
index 7ccffe62362f4357626d1cb8d034a40281584955..7a4a04940e4439db1ccfe2656627450ae5682ff3 100644 (file)
@@ -130,6 +130,10 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
 
   aViewWindow->setBackgroundColor( backgroundColor() );
   aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
+  aViewWindow->SetProjectionMode( projectionMode() );
+  aViewWindow->SetInteractionStyle( interactionStyle() );
+  aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
+  aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
 
   connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ), 
          this,  SLOT(onActorAdded(VTKViewer_Actor*)));