]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Implement engineIOR() and getEngine() methods for Python modules GUI.
authorvsr <vsr@opencascade.com>
Mon, 6 Jun 2005 07:48:11 +0000 (07:48 +0000)
committervsr <vsr@opencascade.com>
Mon, 6 Jun 2005 07:48:11 +0000 (07:48 +0000)
src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h

index b020687afee331ce5206a4c25222760955ae84b3..7b510275529941bedc3a77417284833ee993ddc4 100644 (file)
@@ -49,7 +49,10 @@ LIB_SRC = SALOME_PYQT_PyInterp.cxx \
 # moc pre-processing
 LIB_MOC = SALOME_PYQT_Module.h
 
-LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_GenericObj.idl
+LIB_CLIENT_IDL = SALOME_Exception.idl \
+                 SALOME_GenericObj.idl \
+                 SALOME_ContainerManager.idl \
+                 SALOME_Component.idl 
 
 CPPFLAGS += $(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H -I${KERNEL_ROOT_DIR}/include/salome
 
index da5d6ef58d0e21c5bc5d932662962b897953eac2..4dc328eb685c256ec0e230c067d2785931478b20 100644 (file)
@@ -16,6 +16,8 @@
 #include "SalomeApp_Study.h"
 #include "SalomeApp_DataModel.h"
 
+#include <SALOME_LifeCycleCORBA.hxx>
+
 #include <qfile.h>
 #include <qdom.h>
 #include <qworkspace.h>
@@ -625,9 +627,23 @@ void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
   }
 }
 
+/*!
+ * Get module engine, returns nil var if engine is not found in LifeCycleCORBA
+ */
+Engines::Component_var SALOME_PYQT_Module::getEngine() const
+{
+  Engines::Component_var comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name( "" ) );
+  return comp;
+}
+
+/*!
+ * Get module engine IOR, returns empty string if engine is not found in LifeCycleCORBA
+ */
 QString SALOME_PYQT_Module::engineIOR() const
 {
-  return QString::null;
+  if ( !CORBA::is_nil( getEngine() ) )
+    return QString( getApp()->orb()->object_to_string( getEngine() ) );
+  return QString( "" );
 }
 
 /*!
index df8c84c464a9f6a0d31fbceb397c738029aab5a8..755895df0d7dad7fa206161ec90f72f9230d0d74 100644 (file)
@@ -20,6 +20,9 @@
 #include <qstringlist.h>
 #include <qmap.h>
 
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+
 class SALOME_PYQT_XmlHandler;
 
 class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
@@ -68,6 +71,9 @@ public:
   /* destructor */
   ~SALOME_PYQT_Module();
 
+  /* get module engine */
+  Engines::Component_var getEngine() const;
+
   /******************************
    * Inherited from CAM_Module 
    ******************************/
@@ -84,6 +90,7 @@ public:
   /* context popup menu request */
   void            contextMenuPopup( const QString&, QPopupMenu*, QString& );
 
+  /* get module engine IOR */
   virtual QString engineIOR() const;
 
 protected: