]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
MPV: fix for bug IPAL9235
authormpv <mpv@opencascade.com>
Fri, 24 Jun 2005 10:14:24 +0000 (10:14 +0000)
committermpv <mpv@opencascade.com>
Fri, 24 Jun 2005 10:14:24 +0000 (10:14 +0000)
Redefine updateDesktopTitle to add "LOCKED" information to the title of desktop window.

src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/resources/SalomeApp_msg_en.po

index 8638fdc51777b071f773dc2f3da17605e15c1f36..842ac2ba143305e4b889a80a55f86ca218160852 100644 (file)
@@ -1338,6 +1338,31 @@ void SalomeApp_Application::preferencesChanged( const QString& sec, const QStrin
   
 }
 
+void SalomeApp_Application::updateDesktopTitle() {
+  QString aTitle = applicationName();
+  QString aVer = applicationVersion();
+  if ( !aVer.isEmpty() )
+    aTitle += QString( " " ) + aVer;
+
+  if ( activeStudy() )
+  {
+    QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
+    if ( !sName.isEmpty() ) {
+      SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
+      _PTR(Study) stdDS = study->studyDS();
+      if(stdDS) {
+       if ( stdDS->GetProperties()->IsLocked() ) {
+         aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) );
+       } else {
+         aTitle += QString( " - [%1]" ).arg( sName );
+       }
+      }
+    }
+  }
+
+  desktop()->setCaption( aTitle );
+}
+
 void SalomeApp_Application::afterCloseDoc()
 {
   updateWindows();
@@ -1536,6 +1561,7 @@ void SalomeApp_Application::onProperties()
     SB->AbortCommand();
 
   //study->updateCaptions();
+  updateDesktopTitle();
 }
 
 QString SalomeApp_Application::getFileName( bool open, const QString& initial, const QString& filters, 
index 6970cf58f511f48900edeeaf69fd02b79804fafb..8f45b3854f49bbc5db68b3f06b452a80ce31e342 100644 (file)
@@ -147,6 +147,7 @@ protected:
 
   virtual void                        createPreferences( SalomeApp_Preferences* );
   virtual void                        preferencesChanged( const QString&, const QString& );
+  virtual void                        updateDesktopTitle();
 
 protected slots:
   virtual void          onDesktopActivated();
index d0acd0a36455393bdaee89207a963df2b4a2ea89..d0fd32d20c8cebc35657bd63046e8997836b5dad 100644 (file)
@@ -200,6 +200,9 @@ msgstr "All files (*.*)"
 msgid "SalomeApp_Application::PYTHON_FILES_FILTER"
 msgstr "PYTHON Files (*.py)"
 
+msgid "SalomeApp_Application::STUDY_LOCKED"
+msgstr "LOCKED"
+
 //=======================================================================================
 
 msgid "SalomeApp_ModuleDlg::CAPTION"