From: eap Date: Mon, 19 Dec 2005 13:14:02 +0000 (+0000) Subject: fix bug 10073. Check isVisible() in enterEvent() which unexpectedly comes after accept() X-Git-Tag: T_Before_Join_BR_3_1_0deb~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dcc030258b21213fef3c930edebd2eca79a3cb7b;p=modules%2Fsmesh.git fix bug 10073. Check isVisible() in enterEvent() which unexpectedly comes after accept() --- diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index d2146e01e..caa762e9e 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -389,8 +389,7 @@ void SMESHGUI_CreatePatternDlg::onSave() //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); - //disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone())); + disconnect(mySelectionMgr, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); accept(); @@ -582,10 +581,13 @@ void SMESHGUI_CreatePatternDlg::onDeactivate() //======================================================================= void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*) { - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - activateSelection(); - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + // there is a stange problem that enterEvent() comes after onSave() + if ( isVisible () ) { + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + activateSelection(); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + } } //=================================================================================