From dcc030258b21213fef3c930edebd2eca79a3cb7b Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 19 Dec 2005 13:14:02 +0000 Subject: [PATCH] fix bug 10073. Check isVisible() in enterEvent() which unexpectedly comes after accept() --- src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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())); + } } //=================================================================================