X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_RemoveElementsDlg.cxx;h=9654bc166922a4f5fe618ecf2b5018eb76c12b7a;hp=f16f568fe60a84b276ca3c4f1fde146ae8823ab7;hb=0fdf27b77bce6d48fa08a35ded5a5af3d13834e8;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6 diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index f16f568fe..9654bc166 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -196,7 +196,7 @@ void SMESHGUI_RemoveElementsDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -257,14 +257,14 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() void SMESHGUI_RemoveElementsDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RemoveElementsDlg::ClickOnCancel() +void SMESHGUI_RemoveElementsDlg::reject() { if (SMESH::GetCurrentVtkView()) SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters @@ -274,7 +274,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel() disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -372,16 +372,16 @@ void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument() myActor = SMESH::FindActorByEntry(anIO->getEntry()); if (myActor) { - // get selected nodes + // get selected elements QString aString = ""; int nbElems = SMESH::GetNameOfSelectedElements(mySelector,anIO,aString); if (nbElems > 0) { myBusy = true; myEditCurrentArgument->setText(aString); myBusy = false; - + // OK - + myNbOkElements = nbElems; } // if (nbElems > 0) } // if (myActor) @@ -457,26 +457,6 @@ void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RemoveElementsDlg::closeEvent(QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_RemoveElementsDlg::hideEvent( QHideEvent* ) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose :