From: vsr Date: Mon, 9 Jul 2007 09:16:44 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: qt4_porting_delivery_220807~112 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e93d6be3f2c8d38f04d4f556bb060b7d385e90c1;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 9ab7d1317..1c8061d3e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -545,14 +545,12 @@ void LightApp_Application::createActions() QStringList modList; modules( modList, false ); - if( modList.count()>1 ) + if( modList.count() > 1 ) { - QToolBar* modTBar = new QtxToolBar( true, desk ); - modTBar->setObjectName( "ModuleToolBar" ); - modTBar->setWindowTitle( tr( "INF_TOOLBAR_MODULES" ) ); - desktop()->addToolBar( Qt::TopToolBarArea, modTBar ); + int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) ); - myModuleAction = new LightApp_ModuleAction( tr( "APP_NAME" ), defIcon, desk ); + LightApp_ModuleAction* moduleAction = + new LightApp_ModuleAction( tr( "APP_NAME" ), defIcon, desk ); QMap iconMap; moduleIconNames( iconMap ); @@ -581,11 +579,11 @@ void LightApp_Application::createActions() icon.fromImage( icon.toImage().scaled( iconSize, iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation ) ); - myModuleAction->insertModule( *it, icon ); + moduleAction->insertModule( *it, icon ); } - connect( myModuleAction, SIGNAL( moduleActivated( const QString& ) ), this, SLOT( onModuleActivation( const QString& ) ) ); - modTBar->addAction( myModuleAction ); + connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ), this, SLOT( onModuleActivation( const QString& ) ) ); + createTool( registerAction( ModulesListId, moduleAction ), modTBar ); } // New window @@ -652,8 +650,11 @@ void LightApp_Application::onModuleActivation( const QString& modName ) case 0: default: putInfo( tr("INF_CANCELLED") ); - if ( myModuleAction ) - myModuleAction->setActiveModule( QString() ); + + LightApp_ModuleAction* moduleAction = + qobject_cast( action( ModulesListId ) ); + if ( moduleAction ) + moduleAction->setActiveModule( QString() ); cancelled = true; } } @@ -2145,8 +2146,10 @@ void LightApp_Application::updateModuleActions() if ( activeModule() ) modName = activeModule()->moduleName(); - if ( myModuleAction ) - myModuleAction->setActiveModule( modName ); + LightApp_ModuleAction* moduleAction = + qobject_cast( action( ModulesListId ) ); + if ( moduleAction ) + moduleAction->setActiveModule( modName ); } /*! diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 7338fafff..df47d8ff6 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -41,7 +41,6 @@ class LightApp_WidgetContainer; class LightApp_Preferences; class LightApp_SelectionMgr; class LightApp_DataObject; -class LightApp_ModuleAction; class SUIT_Study; class SUIT_Accel; class CAM_Module; @@ -96,7 +95,7 @@ public: NewQxGraphViewId, #endif - PreferencesId, MRUId, UserID }; + PreferencesId, MRUId, ModulesListId, UserID }; public: LightApp_Application(); virtual ~LightApp_Application(); @@ -249,7 +248,6 @@ protected: protected: LightApp_Preferences* myPrefs; LightApp_SelectionMgr* mySelMgr; - LightApp_ModuleAction* myModuleAction; WindowMap myWindows; WindowVisibilityMap myWindowsVisible;