From a4f50e6dd9a77e7775539d6a492268aeb796d35c Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 6 Jun 2005 07:48:11 +0000 Subject: [PATCH] Implement engineIOR() and getEngine() methods for Python modules GUI. --- src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in | 5 ++++- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 18 +++++++++++++++++- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.h | 7 +++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in b/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in index b020687af..7b5102755 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in @@ -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 diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index da5d6ef58..4dc328eb6 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -16,6 +16,8 @@ #include "SalomeApp_Study.h" #include "SalomeApp_DataModel.h" +#include + #include #include #include @@ -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( "" ); } /*! diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h index df8c84c46..755895df0 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h @@ -20,6 +20,9 @@ #include #include +#include +#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: -- 2.39.2