From 5ffd6d7b03f8c1d37f5f012d9353fa96f60359ea Mon Sep 17 00:00:00 2001 From: san Date: Mon, 27 Mar 2006 14:36:43 +0000 Subject: [PATCH] Customization of the desktop title by module --- src/LightApp/LightApp_Application.cxx | 7 +++++++ src/LightApp/LightApp_Module.cxx | 10 ++++++++++ src/LightApp/LightApp_Module.h | 3 +++ 3 files changed, 20 insertions(+) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 12bc204fe..b8cba4214 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1690,6 +1690,13 @@ void LightApp_Application::updateDesktopTitle() { aTitle += QString( " - [%1]" ).arg( sName ); } + QStringList anInfoList; + modules( anInfoList, false ); + + LightApp_Module* aModule = ( LightApp_Module* )activeModule(); + if( aModule && anInfoList.count() == 1 ) // to avoid a conflict between different modules + aTitle = aModule->updateDesktopTitle( aTitle ); + desktop()->setCaption( aTitle ); } diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index 46d3f82af..e67c95518 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -428,3 +428,13 @@ void LightApp_Module::onShowHide() if( id!=-1 ) startOperation( id ); } + +/*! + * \brief Virtual public method called to custom update of the desktop title + * \param theTitle - current desktop title + * \return Modified desktop title +*/ +QString LightApp_Module::updateDesktopTitle( const QString& theTitle ) +{ + return theTitle; +} diff --git a/src/LightApp/LightApp_Module.h b/src/LightApp/LightApp_Module.h index 2df7aab61..0c00a5ad0 100644 --- a/src/LightApp/LightApp_Module.h +++ b/src/LightApp/LightApp_Module.h @@ -66,6 +66,9 @@ public: virtual LightApp_Displayer* displayer(); + virtual QString updateDesktopTitle( const QString& ); + // Custom update desktop title + public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); -- 2.39.2