Salome HOME
Fix for the bug #45: check and warning when the same image is used in 2 arguments.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_GeoreferencementOp.cxx
index 531283864e94314f5640f8b3515e496e1d12df5a..fe1743ed72f25a85c423f2d6d11da792c55cee91 100644 (file)
@@ -67,10 +67,8 @@ void HYDROGUI_GeoreferencementOp::startOperation()
   aPanel->reset();
 
   if ( myInitialMode == All ) {
-    //@MZN aPanel->setMode( anAllMode );
     onModeActivated( HYDROGUI_GeoreferencementDlg::AllProfiles );
   } else if ( myInitialMode == Selected ) {
-    //@MZN aPanel->setMode( aSelectionMode );
     onModeActivated( HYDROGUI_GeoreferencementDlg::SelectedProfiles );
   }
 
@@ -79,20 +77,31 @@ void HYDROGUI_GeoreferencementOp::startOperation()
     dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), false ) );
   if ( aViewManager ) {
     connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
-             aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+             aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ), 
+             Qt::UniqueConnection );
   }
 
   connect( anApp->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
 }
 
 void HYDROGUI_GeoreferencementOp::abortOperation()
 {
+  LightApp_Application* anApp = module()->getApp();
+  if ( anApp && anApp->desktop() ) {
+    anApp->desktop()->disconnect( this );
+  }
+
   HYDROGUI_Operation::abortOperation();
 }
 
 void HYDROGUI_GeoreferencementOp::commitOperation()
 {
+  LightApp_Application* anApp = module()->getApp();
+  if ( anApp && anApp->desktop() ) {
+    anApp->desktop()->disconnect( this );
+  }
+
   HYDROGUI_Operation::commitOperation();
 }
 
@@ -184,7 +193,8 @@ void HYDROGUI_GeoreferencementOp::onWindowActivated( SUIT_ViewWindow* theViewWin
       ::qobject_cast<HYDROGUI_GeoreferencementDlg*>( inputPanel() );
     if ( aPanel ) {
       connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
-               aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+               aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+               Qt::UniqueConnection);
     }
   }
 }