From: abd Date: Tue, 29 Aug 2006 10:33:57 +0000 (+0000) Subject: fix SWP12975 X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e43daf7b199e3b479b3721c3b541fab36539fdc2;p=modules%2Fgeom.git fix SWP12975 Merging with current version --- diff --git a/src/OperationGUI/OperationGUI.cxx b/src/OperationGUI/OperationGUI.cxx index e13817f64..1372e926d 100644 --- a/src/OperationGUI/OperationGUI.cxx +++ b/src/OperationGUI/OperationGUI.cxx @@ -17,7 +17,7 @@ // 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 // // // @@ -45,21 +45,6 @@ using namespace std; -OperationGUI* OperationGUI::myGUIObject = 0; - -//======================================================================= -// function : GetOperationGUI() -// purpose : Get the only OperationGUI object [ static ] -//======================================================================= -OperationGUI* OperationGUI::GetOperationGUI( GeometryGUI* parent ) -{ - if ( myGUIObject == 0 ) { - // init OperationGUI only once - myGUIObject = new OperationGUI( parent ); - } - return myGUIObject; -} - //======================================================================= // function : OperationGUI() // purpose : Constructor @@ -68,7 +53,6 @@ OperationGUI::OperationGUI(GeometryGUI* parent) : GEOMGUI(parent) { } - //======================================================================= // function : ~OperationGUI() // purpose : Destructor @@ -84,6 +68,9 @@ OperationGUI::~OperationGUI() //======================================================================= bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + getGeometryGUI()->EmitSignalDeactivateDialog(); switch (theCommandID) @@ -94,7 +81,7 @@ bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case 506: (new OperationGUI_ChamferDlg (getGeometryGUI(), parent))->show(); break; case 507: (new OperationGUI_ClippingDlg (getGeometryGUI(), parent))->show(); break; default: - getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); } return true; @@ -110,6 +97,6 @@ extern "C" #endif GEOMGUI* GetLibGUI(GeometryGUI* parent) { - return OperationGUI::GetOperationGUI(parent); + return new OperationGUI(parent); } } diff --git a/src/OperationGUI/OperationGUI.h b/src/OperationGUI/OperationGUI.h index 2fc7059ef..d2bd5662b 100644 --- a/src/OperationGUI/OperationGUI.h +++ b/src/OperationGUI/OperationGUI.h @@ -17,14 +17,13 @@ // 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 // // // // File : OperationGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef OPERATIONGUI_H #define OPERATIONGUI_H @@ -38,19 +37,11 @@ //================================================================================= class OperationGUI : public GEOMGUI { -protected: - OperationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation - public : + OperationGUI( GeometryGUI* parent ); ~OperationGUI(); - // Get the only OperationGUI object - static OperationGUI* GetOperationGUI( GeometryGUI* parent ); - bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - -private: - static OperationGUI* myGUIObject; // the only OperationGUI object }; #endif