Salome HOME
refs #1324: patch on modes activation/deactivation after modules switch
authorasl <asl@opencascade.com>
Mon, 20 Nov 2017 08:09:07 +0000 (11:09 +0300)
committerasl <asl@opencascade.com>
Mon, 20 Nov 2017 08:09:07 +0000 (11:09 +0300)
src/HYDROGUI/HYDROGUI_Module.cxx

index 5ad9a3eff30dedf3aba8b90f6e1f828bd41f78d5..6dd2a91ef1cd4b0d1800042fbddc3817e71a5c0e 100644 (file)
@@ -223,7 +223,9 @@ bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy )
 
     OCCViewer_ViewManager* occ_mgr = dynamic_cast<OCCViewer_ViewManager*>( aViewManager );
     if( occ_mgr )
+    {
       occ_mgr->setChainedOperations( true );//TODO: via preferences
+    }
 
     foreach( SUIT_ViewWindow* aViewWindow, aViewManager->getViews() )
     {
@@ -235,6 +237,8 @@ bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy )
     }
   }
 
+  preferencesChanged( "HYDRO", "zoom_shutoff" );
+
   // Load GEOM data
   SalomeApp_Study* aStudy = 
     dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
@@ -270,9 +274,17 @@ bool HYDROGUI_Module::deactivateModule( SUIT_Study* theStudy )
 
   ViewManagerList anOCCViewManagers;
   getApp()->viewManagers( OCCViewer_Viewer::Type(), anOCCViewManagers );
-  foreach ( const SUIT_ViewManager* aViewManager, anOCCViewManagers ) {
+  foreach ( SUIT_ViewManager* aViewManager, anOCCViewManagers )
+  {
     disconnect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
                 this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+
+    OCCViewer_ViewManager* occ_mgr = dynamic_cast<OCCViewer_ViewManager*>( aViewManager );
+    if( occ_mgr )
+    {
+      occ_mgr->setChainedOperations( false );
+      setAutoZoom( occ_mgr, true );
+    }
   }
 
   /* Issues ## 68, 88.
@@ -1037,7 +1049,7 @@ void HYDROGUI_Module::update( const int flags )
 
   setUpdateEnabled( true );
 
-  setAutoZoomToAllViewManagers(false);
+  preferencesChanged( "HYDRO", "zoom_shutoff" );
 
   QApplication::restoreOverrideCursor();
 }