X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Operation.cxx;h=f22d4d674dfd377a36518e7ae8b2fbc869b96823;hb=4d706076ffe53bf258ba28122770117bd72a48c0;hp=d51ed14395b9dca61162636703e4fed180b620e1;hpb=85f3ec887bf01db7479b07e5b859856aa6a94fd7;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx index d51ed1439..f22d4d674 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.cxx +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx @@ -1,25 +1,24 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH SMESHGUI : implementaion of Salome mesh GUI // File : SMESHGUI_Operation.cxx // Author : Sergey LITONIN, Open CASCADE S.A.S. @@ -50,7 +49,8 @@ // Purpose : Constructor //======================================================================= SMESHGUI_Operation::SMESHGUI_Operation() -: LightApp_Operation() +: LightApp_Operation(), + myIsApplyAndClose( false ) { myHelpFileName = ""; } @@ -158,8 +158,10 @@ _PTR(Study) SMESHGUI_Operation::studyDS() const //======================================================================= void SMESHGUI_Operation::onOk() { + setIsApplyAndClose( true ); if( onApply() ) commit(); + setIsApplyAndClose( false ); //else // abort(); } @@ -214,6 +216,26 @@ void SMESHGUI_Operation::initDialog() { } +//================================================================ +// name : setIsApplyAndClose +// Purpose : Set value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +void SMESHGUI_Operation::setIsApplyAndClose( const bool theFlag ) +{ + myIsApplyAndClose = theFlag; +} + +//================================================================ +// name : isApplyAndClose +// Purpose : Get value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +bool SMESHGUI_Operation::isApplyAndClose() const +{ + return myIsApplyAndClose; +} + /*! * \brief Verifies whether study of operation is locked * \param theMess - specifies whether message box must be shown if study is locked @@ -258,10 +280,8 @@ bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const } return ( theOtherOp && - ( theOtherOp->inherits("SMESHGUI_Operation") && - ( !anOps.contains(theOtherOp->metaObject()->className() ) || - anOps.contains(metaObject()->className()) ) ) || - ( theOtherOp->inherits("LightApp_ShowHideOp") ) ); + ( ( theOtherOp->inherits("SMESHGUI_Operation") && ( !anOps.contains(theOtherOp->metaObject()->className() ) || anOps.contains(metaObject()->className()) ) ) || + ( theOtherOp->inherits("LightApp_ShowHideOp") ) ) ); return true; }