From: mpv Date: Fri, 24 Jun 2005 10:14:24 +0000 (+0000) Subject: MPV: fix for bug IPAL9235 X-Git-Tag: T3_0_0_a4~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e4e6857305d7f5b3cb723c7875d280bb2bcb115;p=modules%2Fgui.git MPV: fix for bug IPAL9235 Redefine updateDesktopTitle to add "LOCKED" information to the title of desktop window. --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 8638fdc51..842ac2ba1 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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(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, diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 6970cf58f..8f45b3854 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -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(); diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index d0acd0a36..d0fd32d20 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -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"