Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/geom.git] / src / BuildGUI / BuildGUI.cxx
index b6537c9ced1084e9d53d3f54f55c22b326d4ad93..a9d44381764f1b9bf3b9e5658bdd94c81f4ae129 100644 (file)
@@ -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
 //
 //
 //
@@ -31,6 +31,8 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
 
+#include "SalomeApp_Application.h"
+
 #include "BuildGUI_EdgeDlg.h"       // Method EDGE
 #include "BuildGUI_WireDlg.h"       // Method WIRE
 #include "BuildGUI_FaceDlg.h"       // Method FACE
 
 #include "GeometryGUI.h"
 
-BuildGUI* BuildGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetBuildGUI()
-// purpose  : Get the only BuildGUI object [ static ]
-//=======================================================================
-BuildGUI* BuildGUI::GetBuildGUI( GeometryGUI* parent )
-{
-  if ( myGUIObject == 0 ) 
-    myGUIObject = new BuildGUI( parent );
-
-  return myGUIObject;
-}
-
 //=======================================================================
 // function : BuildGUI()
 // purpose  : Constructor
@@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent )
 {
 }
 
-
 //=======================================================================
 // function : ~BuildGUI()
 // purpose  : Destructor
@@ -80,7 +67,7 @@ BuildGUI::~BuildGUI()
 bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
 {
   getGeometryGUI()->EmitSignalDeactivateDialog();
-  
+
   QDialog* aDlg = NULL;
 
   switch ( theCommandID )
@@ -91,15 +78,15 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
     case 4084: aDlg = new BuildGUI_ShellDlg   ( getGeometryGUI(), parent, "" ); break;
     case 4085: aDlg = new BuildGUI_SolidDlg   ( getGeometryGUI(), parent, "" ); break;
     case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
-    
+
     default: 
-      SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
+      getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
       break;
   }
-  
+
   if ( aDlg != NULL )
     aDlg->show();
-  
+
   return true;
 }
 
@@ -108,11 +95,9 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
 //=====================================================================================
 extern "C"
 {
-#ifdef WNT
-       __declspec( dllexport )
-#endif
+ GEOM_BUILDGUI_EXPORT
   GEOMGUI* GetLibGUI( GeometryGUI* parent )
   {
-    return BuildGUI::GetBuildGUI( parent );
+    return new BuildGUI( parent );
   }
 }