From: asl Date: Mon, 20 Nov 2017 08:09:07 +0000 (+0300) Subject: refs #1324: patch on modes activation/deactivation after modules switch X-Git-Tag: v2.1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c24088fb13235f6ae02db56ec0ddeedb5c4e76c;p=modules%2Fhydro.git refs #1324: patch on modes activation/deactivation after modules switch --- diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 5ad9a3ef..6dd2a91e 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -223,7 +223,9 @@ bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy ) OCCViewer_ViewManager* occ_mgr = dynamic_cast( 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( 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( 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(); }