]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Improvement PAL14013: send a message to the GUI from the container to emit signal
authorvsr <vsr@opencascade.com>
Tue, 28 Nov 2006 15:05:07 +0000 (15:05 +0000)
committervsr <vsr@opencascade.com>
Tue, 28 Nov 2006 15:05:07 +0000 (15:05 +0000)
src/SUIT/SUIT_Desktop.cxx
src/SUIT/SUIT_Desktop.h
src/Session/Session_Session_i.cxx
src/Session/Session_Session_i.hxx

index 8d75c71740806e3794afa08c176d8866b4fede62..8b2c63202b75a2613329ee91f1939a8a535bd05a 100755 (executable)
@@ -178,3 +178,11 @@ void SUIT_Desktop::emitActivated()
 {
   emit activated();
 }
+
+/*!
+  Emits message signal
+*/
+void SUIT_Desktop::emitMessage( const QString& theMessage )
+{
+  emit message( theMessage );
+}
index a346d0ca499f0531d5db55c2a33006ee8660d1c4..e3acceb62f3621646107c89d2d8ff995614ba576 100755 (executable)
@@ -60,12 +60,14 @@ public:
   void                     logoInsert( const QString&, const QPixmap&, const int = -1 );
 
   void                     emitActivated();
+  void                     emitMessage( const QString& );
 
 signals:
   void                     activated();
   void                     deactivated();
   void                     windowActivated( SUIT_ViewWindow* );
   void                     closing( SUIT_Desktop*, QCloseEvent* );
+  void                     message( const QString& );
 
 protected:
   virtual bool             event( QEvent* );
index ee239674ed01c6bf13f43f4d83b4e7ab6a3885fd..81787737ebef0229b9b3f129bc86a245891c16b1 100755 (executable)
@@ -35,6 +35,7 @@
 
 #include "SUIT_Session.h"
 #include "SUIT_Application.h"
+#include "SUIT_Desktop.h"
 
 #include <qapplication.h>
 
@@ -221,3 +222,30 @@ bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
  
   return false;
 }
+
+void SALOME_Session_i::emitMessage(const char* theMessage)
+{
+  class TEvent: public SALOME_Event {
+  public:
+    TEvent(const char * msg) {
+      _msg = msg;
+    }
+    virtual void Execute() {
+      SUIT_Session::session()->activeApplication()->desktop()->emitMessage(_msg);
+    }
+  private:
+    const char* _msg;
+  };
+  if ( SUIT_Session::session() ) {
+    if ( SUIT_Session::session()->activeApplication() ) {
+      if ( SUIT_Session::session()->activeApplication()->desktop() ) {
+       ProcessVoidEvent( new TEvent(theMessage) );
+      }
+    }
+  }
+}
+
+void SALOME_Session_i::emitMessageOneWay(const char* theMessage)
+{
+  emitMessage(theMessage);
+}
index 18d2caf8424e3cd602507e64595110e149d69b8f..17663b93340cb7f1d0e7ab6515c04cd6f46ef6bd 100755 (executable)
@@ -70,6 +70,10 @@ public:
   //! Restors a visual state of the study at theSavePoint
   bool restoreVisualState(CORBA::Long theSavePoint);
 
+  //! Emit a qt signal from the session GUI desktop window.
+  void emitMessage(const char* theMessage);
+  void emitMessageOneWay(const char* theMessage);
+
 protected:
 
   //! Naming service interface