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 d2146e0..caa762e 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