Salome HOME
PAL10125 - by double click on reference original object becomes selected
[modules/gui.git] / src / SUIT / SUIT_Application.cxx
index 4acf370ac4431bbcccd00fc84c2169acf328d83e..38082005581f8c940770b37fbf0aa0c73e2d7d2e 100755 (executable)
@@ -4,6 +4,8 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
 
+#include <qlabel.h>
+#include <qtimer.h>
 #include <qstatusbar.h>
 
 #include <QtxAction.h>
@@ -13,7 +15,8 @@
 SUIT_Application::SUIT_Application()
 : QObject( 0 ),
 myStudy( 0 ),
-myDesktop( 0 )
+myDesktop( 0 ),
+myStatusLabel( 0 )
 { 
 }
 
@@ -59,6 +62,12 @@ bool SUIT_Application::useFile( const QString& theFileName )
   createEmptyStudy();
   if ( activeStudy() )
     return activeStudy()->openDocument( theFileName );
+  return false;
+}
+
+bool SUIT_Application::useStudy( const QString& theName )
+{
+  return false;
 }
 
 void SUIT_Application::createEmptyStudy()
@@ -83,8 +92,16 @@ SUIT_ResourceMgr* SUIT_Application::resourceMgr() const
 #define DEFAULT_MESSAGE_DELAY 3000
 void SUIT_Application::putInfo ( const QString& msg, const int msec )
 {
-  if ( desktop() )
-    desktop()->statusBar()->message( msg, msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec );
+  if ( desktop() ) {
+    //desktop()->statusBar()->message( msg, msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec );
+    if ( !myStatusLabel ) {
+      myStatusLabel = new QLabel (desktop()->statusBar());
+      desktop()->statusBar()->addWidget(myStatusLabel, /*int stretch = */1);
+    }
+    myStatusLabel->setText(msg);
+    if( msec != -1 )
+      QTimer::singleShot(msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec, myStatusLabel, SLOT(clear()));
+  }
 }
 
 SUIT_Application* SUIT_Application::startApplication( int argc, char** argv ) const