From ec9f03d8e5a17f5a968433e55a89628666588b7c Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 17 Feb 2006 13:08:52 +0000 Subject: [PATCH] Bug CTH11464 : Name --- src/LightApp/LightApp_Application.cxx | 15 +++++++++++++++ src/LightApp/LightApp_Application.h | 4 ++++ src/LightApp/LightApp_Study.cxx | 2 ++ 3 files changed, 21 insertions(+) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 509887161..f788999e8 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -115,6 +115,13 @@ static const char* imageEmptyIcon[] = { "....................", "...................."}; +int LightApp_Application::lastStudyId = 0; + +int LightApp_Application::studyId() +{ + return LightApp_Application::lastStudyId; +} + /*!Create new instance of LightApp_Application.*/ extern "C" LIGHTAPP_EXPORT SUIT_Application* createApplication() { @@ -1297,6 +1304,8 @@ void LightApp_Application::updateActions() //======================================================================= SUIT_Study* LightApp_Application::createNewStudy() { + LightApp_Application::lastStudyId++; + LightApp_Study* aStudy = new LightApp_Study( this ); // Set up processing of major study-related events @@ -1675,6 +1684,12 @@ void LightApp_Application::updateDesktopTitle() { if ( !aVer.isEmpty() ) aTitle += QString( " " ) + aVer; + if ( activeStudy() ) + { + QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false ); + aTitle += QString( " - [%1]" ).arg( sName ); + } + desktop()->setCaption( aTitle ); } diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 14d2e4c23..26f9c30c9 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -96,6 +96,8 @@ public: SUIT_Accel* accel() const; + static int studyId(); + signals: void studyOpened(); void studySaved(); @@ -183,6 +185,8 @@ protected: SUIT_Accel* myAccel; static LightApp_Preferences* _prefs_; + + static int lastStudyId; }; #ifdef WIN32 diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index adf895f26..f90080e5d 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -65,6 +65,8 @@ LightApp_Study::~LightApp_Study() */ void LightApp_Study::createDocument() { + setStudyName( QString( "Study%1" ).arg( LightApp_Application::studyId() ) ); + // create myRoot setRoot( new LightApp_RootObject( this ) ); -- 2.39.2