]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
fix bug 10073. Check isVisible() in enterEvent() which unexpectedly comes after accept()
authoreap <eap@opencascade.com>
Mon, 19 Dec 2005 13:14:02 +0000 (13:14 +0000)
committereap <eap@opencascade.com>
Mon, 19 Dec 2005 13:14:02 +0000 (13:14 +0000)
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx

index d2146e01e5c39b2baa6997dc32d551afe780a0d2..caa762e9e44c3ec923b28e4b262ee7a13f56e03a 100755 (executable)
@@ -389,8 +389,7 @@ void SMESHGUI_CreatePatternDlg::onSave()
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
        aViewWindow->SetSelectionMode(ActorSelection);\r
-      //disconnect(mySelectionMgr, 0, this, 0);\r
-      disconnect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone()));\r
+      disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
       accept();\r
@@ -582,10 +581,13 @@ void SMESHGUI_CreatePatternDlg::onDeactivate()
 //=======================================================================\r
 void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*)\r
 {\r
-  mySMESHGUI->EmitSignalDeactivateDialog();\r
-  setEnabled(true);\r
-  activateSelection();\r
-  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));\r
+  // there is a stange problem that enterEvent() comes after onSave()\r
+  if ( isVisible () ) {\r
+    mySMESHGUI->EmitSignalDeactivateDialog();\r
+    setEnabled(true);\r
+    activateSelection();\r
+    connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));\r
+  }\r
 }\r
 \r
 //=================================================================================\r