From: stv Date: Tue, 31 May 2005 06:45:13 +0000 (+0000) Subject: Fixed bug IPAL8999. Method SalomeApp_Study::closeDocument() invoked twice. X-Git-Tag: T3_0_0_a1~72 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d91e2cca1279a6c052bc26cd0598590f843542bb;p=modules%2Fgui.git Fixed bug IPAL8999. Method SalomeApp_Study::closeDocument() invoked twice. Module selection ComboBox and ToolButtons placed in separate tool bar without general update mechanism. --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 26cfbedcd..78e3610f0 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -29,14 +29,15 @@ #include #include -#include "SVTK_ViewManager.h" -#include "SVTK_ViewModel.h" +#include +#include #include #include #include +#include #include #include @@ -216,12 +217,14 @@ void SalomeApp_Application::createActions() QPixmap defIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) ); if ( defIcon.isNull() ) defIcon = QPixmap( imageEmptyIcon ); + // default icon for any module QPixmap modIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_MODULE_ICO" ) ); if ( modIcon.isNull() ) modIcon = QPixmap( imageEmptyIcon ); - int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) ); + QToolBar* modTBar = new QtxToolBar( true, desk ); + modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) ); QActionGroup* modGroup = new QActionGroup( this ); modGroup->setExclusive( true ); @@ -237,8 +240,8 @@ void SalomeApp_Application::createActions() const int iconSize = 20; - createTool( modGroup, modTBar ); - createTool( separator(), modTBar ); + modGroup->addTo( modTBar ); + modTBar->addSeparator(); QStringList modList; modules( modList, false ); @@ -261,12 +264,16 @@ void SalomeApp_Application::createActions() icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) ); QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true ); - createTool( a, modTBar ); + a->addTo( modTBar ); modGroup->add( a ); myActions.insert( *it, a ); } + SUIT_Tools::simplifySeparators( modTBar ); + + // New window + int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); createMenu( separator(), windowMenu, -1, 1 ); @@ -706,6 +713,14 @@ QString SalomeApp_Application::getFileFilter() const return "(*.hdf)"; } +void SalomeApp_Application::beforeCloseDoc( SUIT_Study* s ) +{ + CAM_Application::beforeCloseDoc( s ); + + for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr ) + removeWindow( itr.key(), s->id() ); +} + void SalomeApp_Application::afterCloseDoc() { updateWindows(); diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 5709b9a5e..152adac40 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -111,6 +111,7 @@ protected: virtual void onSelectionChanged(); + virtual void beforeCloseDoc( SUIT_Study* ); virtual void afterCloseDoc(); private slots: