]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix problem with executing of GUI-related command from the embeded Python interpreter...
authorvsr <vsr@opencascade.com>
Mon, 30 Jun 2008 11:30:21 +0000 (11:30 +0000)
committervsr <vsr@opencascade.com>
Mon, 30 Jun 2008 11:30:21 +0000 (11:30 +0000)
src/Makefile.am
src/PyInterp/Makefile.am
src/PyInterp/PyInterp_Dispatcher.cxx
src/PyInterp/PyInterp_Dispatcher.h

index 91f5dce0a53193b1a6d31a872aef057c4abd7a22..82c27dbce77d312851c9267a8441d078cfd68f32 100755 (executable)
@@ -24,7 +24,7 @@
 #  Module : SALOME
 # $Header$
 
-SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs
+SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event
 
 if ENABLE_SALOMEOBJECT
   SUBDIRS += OBJECT
@@ -61,7 +61,7 @@ endif
 if ENABLE_QXGRAPHVIEWER
   SUBDIRS += QxGraph
 endif
-SUBDIRS += Event LightApp ResExporter
+SUBDIRS += LightApp ResExporter
 
 if GUI_ENABLE_CORBA
   SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
index 7a451b4adfc1024b4a82a3019b8bb3516e30c1f9..c601b310d155b2739081540414c070f4ed5c8742 100755 (executable)
@@ -39,5 +39,6 @@ dist_libPyInterp_la_SOURCES=  \
 MOC_FILES= PyInterp_Watcher_moc.cxx
 nodist_libPyInterp_la_SOURCES= $(MOC_FILES)
 
-libPyInterp_la_CPPFLAGS= $(PYTHON_INCLUDES) $(QT_INCLUDES)
-libPyInterp_la_LDFLAGS= $(PYTHON_LIBS) $(QT_MT_LIBS)
+libPyInterp_la_CPPFLAGS= $(PYTHON_INCLUDES) $(QT_INCLUDES) \
+       -I$(srcdir)/../Event
+libPyInterp_la_LDFLAGS= $(PYTHON_LIBS) $(QT_MT_LIBS) ../Event/libEvent.la
index 052ccbf19b844639631472b8410f8f7d31d646bb..2fbda19ee6213c484595aaebfd640ce08a2cc008 100755 (executable)
 #include "PyInterp_Dispatcher.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
 #include "PyInterp_Interp.h"
 #include "PyInterp_Watcher.h"
+#include <SALOME_Event.h>
 
 #include <QObject>
 #include <QCoreApplication>
 
+class PyInterp_ExecuteEvent: public SALOME_Event
+{
+public:
+  PyInterp_Request* myRequest;
+  PyInterp_ExecuteEvent( PyInterp_Request* r )
+    : myRequest( r ) {}
+  virtual void Execute()
+  {
+    myRequest->execute();
+  }
+};
+
 using namespace std;
 
 PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0;
@@ -49,7 +62,7 @@ void PyInterp_Request::process()
 
 void PyInterp_Request::safeExecute()
 {
-  execute();
+  ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
 }
 
 void PyInterp_Request::Destroy( PyInterp_Request* request )
@@ -94,7 +107,7 @@ void PyInterp_LockRequest::safeExecute()
 {
   if ( getInterp() ){
     PyLockWrapper aLock = getInterp()->GetLockWrapper();
-    execute();
+    ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
   }
 }
 
index 903fea356ea0f527f355ce894ee7a9b5bcda2779..5040b1032d176502826ab71e0fafd33345162058 100755 (executable)
@@ -35,10 +35,12 @@ class QObject;
 class PyInterp_Interp;
 class PyInterp_Watcher;
 class PyInterp_Dispatcher;
+class PyInterp_ExecuteEvent;
 
 class PYINTERP_EXPORT PyInterp_Request
 {
   friend class PyInterp_Dispatcher;
+  friend class PyInterp_ExecuteEvent;
 
   PyInterp_Request();
   PyInterp_Request( const PyInterp_Request& );