return ProcessEvent( new TGetActiveComponentEvent() );
}
+/*!
+ \fn PyObject* SalomePyQt::getActivePythonModule()
+ \brief Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container.
+ \return Python module object currently loaded into SALOME_PYQT_ModuleLight container
+*/
+
+class TGetActivePyModuleEvent: public SALOME_Event
+{
+public:
+ typedef PyObject* TResult;
+ TResult myResult;
+ TGetActivePyModuleEvent() : myResult( 0 ) {}
+ virtual void Execute()
+ {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (PyObject*)module->getPythonModule();
+ }
+};
+PyObject* SalomePyQt::getActivePythonModule()
+{
+ return ProcessEvent( new TGetActivePyModuleEvent() );
+}
+
+/*!
+ \fn bool SalomePyQt::activateModule( const QString& modName )
+ \brief Activates SALOME module with the given name
+ \return True if the module has been activated and False otherwise.
+*/
+
+class TActivateModuleEvent: public SALOME_Event
+{
+public:
+ typedef bool TResult;
+ TResult myResult;
+ QString myModuleName;
+ TActivateModuleEvent( const QString& modName )
+ : myResult( false ), myModuleName( modName ) {}
+ virtual void Execute()
+ {
+ if ( LightApp_Application* anApp = getApplication() ) {
+ myResult = anApp->activateModule( myModuleName );
+ }
+ }
+};
+bool SalomePyQt::activateModule( const QString& modName )
+{
+ return ProcessEvent( new TActivateModuleEvent( modName ) );
+}
+
/*!
\brief Update an Object Browser of the specified (by identifier) study.
#ifndef SALOME_PYQT_H
#define SALOME_PYQT_H
+#include <Python.h>
+
#include <QObject>
#include <QString>
#include <QColor>
static int getStudyId();
static void putInfo( const QString&, const int = 0 );
static const QString getActiveComponent();
+ static PyObject* getActivePythonModule();
+ static bool activateModule( const QString& );
static void updateObjBrowser( const int = 0, bool = true );
static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool );
static int getStudyId() /ReleaseGIL/ ;
static void putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
static const QString getActiveComponent() /ReleaseGIL/ ;
+ static SIP_PYOBJECT getActivePythonModule() /ReleaseGIL/ ;
+ static bool activateModule( const QString& ) /ReleaseGIL/ ;
static void updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;