1 // File: SalomeApp_Application.cxx
2 // Created: 10/22/2004 3:23:45 PM
3 // Author: Sergey LITONIN
4 // Copyright (C) CEA 2004
6 #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
8 #include "SalomeApp_Application.h"
10 #include "SalomeApp_Study.h"
11 #include "SalomeApp_Module.h"
12 #include "SalomeApp_GLSelector.h"
13 #include "SalomeApp_OBSelector.h"
14 #include "SalomeApp_OCCSelector.h"
15 #include "SalomeApp_VTKSelector.h"
16 #include "SalomeApp_EventFilter.h"
17 #include "SalomeApp_SelectionMgr.h"
18 #include "SalomeApp_EventFilter.h"
19 #include "SalomeApp_WidgetContainer.h"
20 #include "SalomeApp_ModuleDlg.h"
21 #include "SalomeApp_OBFilter.h"
23 #include <LogWindow.h>
25 #include <GLViewer_Viewer.h>
26 #include <GLViewer_ViewManager.h>
28 #include <Plot2d_ViewManager.h>
30 #include <OCCViewer_ViewManager.h>
31 #include <SOCC_ViewModel.h>
33 #include <SVTK_ViewModel.h>
34 #include <SVTK_ViewManager.h>
36 #include <STD_TabDesktop.h>
38 #include <SUIT_Tools.h>
39 #include <SUIT_Session.h>
41 #include <QtxToolBar.h>
42 #include <QtxDockAction.h>
44 #include <OB_Browser.h>
46 #include <PythonConsole_PyConsole.h>
48 #include <SUIT_MessageBox.h>
49 #include <SUIT_ResourceMgr.h>
50 #include <SUIT_ActionOperation.h>
52 #include <Utils_ORB_INIT.hxx>
53 #include <Utils_SINGLETON.hxx>
54 #include <SALOME_ModuleCatalog_impl.hxx>
61 #include <qcombobox.h>
62 #include <qmessagebox.h>
63 #include <qapplication.h>
65 #include "SALOMEDS_StudyManager.hxx"
67 #define OBJECT_BROWSER_WIDTH 300
69 static const char* imageEmptyIcon[] = {
72 "....................",
73 "....................",
74 "....................",
75 "....................",
76 "....................",
77 "....................",
78 "....................",
79 "....................",
80 "....................",
81 "....................",
82 "....................",
83 "....................",
84 "....................",
85 "....................",
86 "....................",
87 "....................",
88 "....................",
89 "....................",
90 "....................",
91 "...................."};
93 extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
95 return new SalomeApp_Application();
99 Class : SalomeApp_Application
100 Description : Application containing SalomeApp module
103 SalomeApp_Application::SalomeApp_Application()
104 : CAM_Application( false )
106 STD_TabDesktop* desk = new STD_TabDesktop();
110 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
111 QPixmap aLogo = aResMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) );
113 desktop()->setIcon( aLogo );
114 desktop()->setDockableMenuBar( true );
115 desktop()->setDockableStatusBar( false );
119 mySelMgr = new SalomeApp_SelectionMgr( this );
121 connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
122 this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
124 connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
127 SalomeApp_Application::~SalomeApp_Application()
129 saveWindowsGeometry();
134 desktop()->saveGeometry( resourceMgr(), "desktop" );
135 resourceMgr()->save();
140 SalomeApp_EventFilter::Destroy();
143 void SalomeApp_Application::start()
146 desktop()->loadGeometry( resourceMgr(), "desktop" );
148 CAM_Application::start();
150 QAction* a = action( ViewWindowsId );
151 if ( a && a->inherits( "QtxDockAction" ) )
152 ((QtxDockAction*)a)->setAutoPlace( true );
154 SalomeApp_EventFilter::Init();
157 updateViewManagers();
162 QString SalomeApp_Application::applicationName() const
167 CAM_Module* SalomeApp_Application::loadModule( const QString& name )
169 CAM_Module* mod = CAM_Application::loadModule( name );
172 connect( this, SIGNAL( studyOpened() ), mod, SLOT( onModelOpened() ) );
173 connect( this, SIGNAL( studySaved() ), mod, SLOT( onModelSaved() ) );
174 connect( this, SIGNAL( studyClosed() ), mod, SLOT( onModelClosed() ) );
179 bool SalomeApp_Application::activateModule( const QString& modName )
182 CAM_Module* prevMod = activeModule();
185 actName = prevMod->moduleName();
187 if ( actName == modName )
190 saveWindowsGeometry();
192 bool status = CAM_Application::activateModule( modName );
194 updateModuleActions();
200 updateViewManagers();
205 SalomeApp_SelectionMgr* SalomeApp_Application::selectionMgr() const
210 void SalomeApp_Application::createActions()
212 STD_Application::createActions();
214 SUIT_Desktop* desk = desktop();
215 SUIT_ResourceMgr* resMgr = resourceMgr();
217 // default icon for neutral point ('SALOME' module)
218 QPixmap defIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) );
219 if ( defIcon.isNull() )
220 defIcon = QPixmap( imageEmptyIcon );
222 // default icon for any module
223 QPixmap modIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_MODULE_ICO" ) );
224 if ( modIcon.isNull() )
225 modIcon = QPixmap( imageEmptyIcon );
227 QToolBar* modTBar = new QtxToolBar( true, desk );
228 modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
230 QActionGroup* modGroup = new QActionGroup( this );
231 modGroup->setExclusive( true );
232 modGroup->setUsesDropDown( true );
234 QAction* a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
235 tr( "PRP_APP_MODULE" ), 0, desk, true );
237 myActions.insert( QString(), a );
239 QMap<QString, QString> iconMap;
240 moduleIconNames( iconMap );
242 const int iconSize = 20;
244 modGroup->addTo( modTBar );
245 modTBar->addSeparator();
248 modules( modList, false );
250 for ( QStringList::Iterator it = modList.begin(); it != modList.end(); ++it )
252 if ( (*it).isEmpty() )
256 if ( iconMap.contains( *it ) )
257 iconName = iconMap[*it];
259 QString modName = moduleName( *it );
261 QPixmap icon = resMgr->loadPixmap( modName, iconName );
265 icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
267 QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
271 myActions.insert( *it, a );
274 SUIT_Tools::simplifySeparators( modTBar );
278 int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
279 int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
280 createMenu( separator(), windowMenu, -1, 1 );
282 for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
284 QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), QIconSet(),
285 tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
286 tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
287 0, desk, false, this, SLOT( onNewWindow() ) );
288 createMenu( a, newWinMenu, -1 );
291 connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
294 void SalomeApp_Application::onModuleActivation( QAction* a )
299 QString modName = a->menuText();
300 if ( modName == tr( "APP_NAME" ) )
301 modName = QString::null;
303 // Force user to create/open a study before module activation
304 QMap<QString, QString> iconMap;
305 moduleIconNames( iconMap );
306 QPixmap icon = resourceMgr()->loadPixmap( moduleName( modName ), iconMap[ modName ] );
308 bool cancelled = false;
309 while ( !modName.isEmpty() && !activeStudy() && !cancelled ){
310 SalomeApp_ModuleDlg aDlg( desktop(), modName, icon );
311 int res = aDlg.exec();
325 putInfo( tr("INF_CANCELLED") );
326 myActions[QString()]->setOn( true );
332 activateModule( modName );
335 QString SalomeApp_Application::defaultModule() const
337 QStringList aModuleNames;
338 modules( aModuleNames, false ); // obtain a complete list of module names for the current configuration
339 // If there's the one and only module --> activate it automatically
340 // TODO: Possible improvement - default module can be taken from preferences
341 return aModuleNames.count() > 1 ? "" : ( aModuleNames.count() ? aModuleNames.first() : "" );
344 void SalomeApp_Application::onNewWindow()
346 const QObject* obj = sender();
347 if ( !obj || !obj->inherits( "QAction" ) )
351 int id = actionId( (QAction*)obj );
355 type = GLViewer_Viewer::Type();
358 type = Plot2d_Viewer::Type();
361 type = OCCViewer_Viewer::Type();
364 type = VTKViewer_Viewer::Type();
368 if ( !type.isEmpty() )
369 createViewManager( type );
372 //=======================================================================
374 // Purpose : SLOT. Create new document
375 //=======================================================================
376 void SalomeApp_Application::onNewDoc()
378 SUIT_Study* study = activeStudy();
380 saveWindowsGeometry();
382 CAM_Application::onNewDoc();
384 if ( !study ) // new study will be create in THIS application
387 updateViewManagers();
391 //=======================================================================
393 // Purpose : SLOT. Open new document
394 //=======================================================================
395 void SalomeApp_Application::onOpenDoc()
397 SUIT_Study* study = activeStudy();
398 saveWindowsGeometry();
400 CAM_Application::onOpenDoc();
402 if ( !study ) // new study will be create in THIS application
405 updateViewManagers();
409 void SalomeApp_Application::onSelection()
411 onSelectionChanged();
413 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
414 ((SalomeApp_Module*)activeModule())->selectionChanged();
417 void SalomeApp_Application::onSelectionChanged()
421 void SalomeApp_Application::setActiveStudy( SUIT_Study* study )
423 CAM_Application::setActiveStudy( study );
428 //=======================================================================
429 // name : createNewStudy
430 // Purpose : Create new study
431 //=======================================================================
432 SUIT_Study* SalomeApp_Application::createNewStudy()
434 SalomeApp_Study* aStudy = new SalomeApp_Study( this );
436 // Set up processing of major study-related events
437 connect( aStudy, SIGNAL( created( SUIT_Study* ) ), this, SLOT( onStudyCreated( SUIT_Study* ) ) );
438 connect( aStudy, SIGNAL( opened ( SUIT_Study* ) ), this, SLOT( onStudyOpened ( SUIT_Study* ) ) );
439 connect( aStudy, SIGNAL( saved ( SUIT_Study* ) ), this, SLOT( onStudySaved ( SUIT_Study* ) ) );
440 connect( aStudy, SIGNAL( closed ( SUIT_Study* ) ), this, SLOT( onStudyClosed ( SUIT_Study* ) ) );
445 //=======================================================================
446 // name : createNewStudy
447 // Purpose : Enable/Disable menu items and toolbar buttons. Rebuild menu
448 //=======================================================================
449 void SalomeApp_Application::updateCommandsStatus()
451 CAM_Application::updateCommandsStatus();
453 for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
455 QAction* a = action( id );
457 a->setEnabled( activeStudy() );
461 //=======================================================================
462 // name : onHelpAbout
463 // Purpose : SLOT. Display "About" message box
464 //=======================================================================
465 void SalomeApp_Application::onHelpAbout()
467 QMessageBox aDlg( desktop(), "AboutDlg" );
469 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
470 QPixmap aPixmap = aResMgr->loadPixmap( "SalomeApp", tr( "ABOUT_ICO" ) );
472 QFontMetrics m( aDlg.font() );
473 QImage anImage = aPixmap.convertToImage();
474 int w = m.height() * 5;
475 anImage = anImage.scale( w, w );
476 aPixmap.convertFromImage( anImage );
478 aDlg.setCaption( tr( "ABOUT" ) );
479 aDlg.setText( tr( "APP_NAME_LONG" ).arg( APP_VERSION ) );
480 aDlg.setIconPixmap( aPixmap );
484 QWidget* SalomeApp_Application::window( const int flag, const int studyId ) const
491 if ( !activeStudy() )
494 sId = activeStudy()->id();
497 if ( myWindows.contains( flag ) )
498 wid = myWindows[flag]->widget( sId );
503 void SalomeApp_Application::addWindow( QWidget* wid, const int flag, const int studyId )
511 if ( !activeStudy() )
514 sId = activeStudy()->id();
517 if ( !myWindows.contains( flag ) )
519 QMap<int, int> winMap;
520 currentWindows( winMap );
522 myWindows.insert( flag, new SalomeApp_WidgetContainer( flag, desktop() ) );
523 if ( winMap.contains( flag ) )
524 desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
526 myWindows[flag]->setResizeEnabled( true );
527 myWindows[flag]->setCloseMode( QDockWindow::Always );
528 myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
531 myWindows[flag]->insert( sId, wid );
533 setWindowShown( flag, !myWindows[flag]->isEmpty() );
536 void SalomeApp_Application::removeWindow( const int flag, const int studyId )
538 if ( !myWindows.contains( flag ) )
544 if ( !activeStudy() )
547 sId = activeStudy()->id();
550 QWidget* wid = myWindows[flag]->widget( sId );
551 myWindows[flag]->remove( sId );
554 setWindowShown( flag, !myWindows[flag]->isEmpty() );
557 QWidget* SalomeApp_Application::getWindow( const int flag, const int studyId )
559 QWidget* wid = window( flag, studyId );
561 addWindow( wid = createWindow( flag ), flag, studyId );
566 bool SalomeApp_Application::isWindowVisible( const int type ) const
569 if ( myWindows.contains( type ) )
571 SUIT_Desktop* desk = ((SalomeApp_Application*)this)->desktop();
572 res = desk && desk->appropriate( myWindows[type] );
577 void SalomeApp_Application::setWindowShown( const int type, const bool on )
579 if ( !desktop() || !myWindows.contains( type ) )
582 QDockWindow* dw = myWindows[type];
583 desktop()->setAppropriate( dw, on );
584 on ? dw->show() : dw->hide();
587 OB_Browser* SalomeApp_Application::objectBrowser()
590 QWidget* wid = getWindow( WT_ObjectBrowser );
591 if ( wid->inherits( "OB_Browser" ) )
592 ob = (OB_Browser*)wid;
596 LogWindow* SalomeApp_Application::logWindow()
599 QWidget* wid = getWindow( WT_LogWindow );
600 if ( wid->inherits( "LogWindow" ) )
601 lw = (LogWindow*)wid;
605 SUIT_ViewManager* SalomeApp_Application::getViewManager( const QString& vmType, const bool create )
607 SUIT_ViewManager* aVM = viewManager( vmType );
608 SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager();
609 if ( anActiveVM && anActiveVM->getType() == vmType )
613 if ( !aVM->getActiveView() )
617 aVM = createViewManager( vmType );
621 SUIT_ViewManager* SalomeApp_Application::createViewManager( const QString& vmType )
623 SUIT_ViewManager* viewMgr = 0;
624 if ( vmType == GLViewer_Viewer::Type() )
626 viewMgr = new GLViewer_ViewManager( activeStudy(), desktop() );
627 new SalomeApp_GLSelector( (GLViewer_Viewer2d*)viewMgr->getViewModel(), mySelMgr );
629 else if ( vmType == Plot2d_Viewer::Type() )
630 viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() );
631 else if ( vmType == OCCViewer_Viewer::Type() )
633 viewMgr = new OCCViewer_ViewManager( activeStudy(), desktop() );
634 viewMgr->setViewModel( new SOCC_Viewer() );// custom view model, which extends SALOME_View interface
635 new SalomeApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
637 else if ( vmType == SVTK_Viewer::Type() )
639 viewMgr = new SVTK_ViewManager( activeStudy(), desktop() );
640 new SalomeApp_VTKSelector((SVTK_Viewer*)viewMgr->getViewModel(),mySelMgr);
646 addViewManager( viewMgr );
647 SUIT_ViewWindow* viewWin = viewMgr->createViewWindow();
649 if ( viewWin && desktop() )
650 viewWin->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
652 connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
653 this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
658 void SalomeApp_Application::onCloseView( SUIT_ViewManager* theVM )
660 removeViewManager( theVM );
663 void SalomeApp_Application::onStudyCreated( SUIT_Study* theStudy )
665 SUIT_DataObject* aRoot = 0;
666 if ( theStudy && theStudy->root() )
668 aRoot = theStudy->root();
669 //aRoot->setName( tr( "DATA_MODELS" ) );
671 if ( objectBrowser() != 0 )
672 objectBrowser()->setRootObject( aRoot );
674 activateModule( defaultModule() );
677 void SalomeApp_Application::onStudyOpened( SUIT_Study* theStudy )
679 SUIT_DataObject* aRoot = 0;
680 if ( theStudy && theStudy->root() )
682 aRoot = theStudy->root();
685 if ( objectBrowser() != 0 ) {
686 objectBrowser()->setRootObject( aRoot );
691 activateModule( defaultModule() );
696 void SalomeApp_Application::onStudySaved( SUIT_Study* )
701 void SalomeApp_Application::onStudyClosed( SUIT_Study* )
705 activateModule( "" );
707 saveWindowsGeometry();
710 QString SalomeApp_Application::getFileFilter() const
715 void SalomeApp_Application::beforeCloseDoc( SUIT_Study* s )
717 CAM_Application::beforeCloseDoc( s );
719 for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
720 removeWindow( itr.key(), s->id() );
723 void SalomeApp_Application::updateActions()
725 updateCommandsStatus();
728 QWidget* SalomeApp_Application::createWindow( const int flag )
732 if ( flag == WT_ObjectBrowser )
734 OB_Browser* ob = new OB_Browser( desktop() );
735 ob->setFilter( new SalomeApp_OBFilter(selectionMgr()) );
737 ob->setCaption( tr( "OBJECT_BROWSER" ) );
738 ob->resize( OBJECT_BROWSER_WIDTH, ob->height() );
739 ob->setAutoUpdate( true );
742 new SalomeApp_OBSelector( ob, mySelMgr );
746 ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
748 else if ( flag == WT_PyConsole )
750 PythonConsole* pyCons = new PythonConsole( desktop(), new SalomeApp_PyInterp() );
751 pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
754 // pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
756 else if ( flag == WT_LogWindow )
758 LogWindow* logWin = new LogWindow( desktop() );
759 logWin->setCaption( tr( "LOG_WINDOW" ) );
762 logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
768 void SalomeApp_Application::defaultWindows( QMap<int, int>& aMap ) const
770 aMap.insert( WT_ObjectBrowser, Qt::DockLeft );
771 aMap.insert( WT_PyConsole, Qt::DockBottom );
774 void SalomeApp_Application::defaultViewManagers( QStringList& ) const
778 void SalomeApp_Application::afterCloseDoc()
782 CAM_Application::afterCloseDoc();
785 CORBA::ORB_var SalomeApp_Application::orb()
787 ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
788 CORBA::ORB_var& orb = init( qApp->argc(), qApp->argv() );
793 SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
795 static SALOMEDSClient_StudyManager* aStudyManager = NULL;
798 aStudyManager = new SALOMEDS_StudyManager();
800 return aStudyManager;
803 SALOME_NamingService* SalomeApp_Application::namingService()
805 return new SALOME_NamingService( orb() );
808 QString SalomeApp_Application::defaultEngineIOR()
810 // Look for a default module engine (needed for CORBAless modules to use SALOMEDS persistence)
812 CORBA::Object_ptr anEngine = namingService()->Resolve( "/SalomeAppEngine" );
813 if ( !CORBA::is_nil( anEngine ) )
814 anIOR = orb()->object_to_string( anEngine );
818 void SalomeApp_Application::moduleIconNames( QMap<QString, QString>& iconMap ) const
822 SUIT_ResourceMgr* resMgr = resourceMgr();
827 modules( modList, false );
829 for ( QStringList::const_iterator it = modList.begin(); it != modList.end(); ++it )
831 QString modName = *it;
832 QString modIntr = moduleName( modName );
833 QString modIcon = resMgr->stringValue( modIntr, "icon", QString::null );
835 if ( modIcon.isEmpty() )
838 if ( SUIT_Tools::extension( modIcon ).isEmpty() )
839 modIcon += QString( ".png" );
841 iconMap.insert( modName, modIcon );
845 void SalomeApp_Application::updateModuleActions()
848 if ( activeModule() )
849 modName = activeModule()->moduleName();
851 if ( myActions.contains( modName ) )
852 myActions[modName]->setOn( true );
855 void SalomeApp_Application::currentWindows( QMap<int, int>& winMap ) const
858 if ( !activeStudy() )
861 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
862 ((SalomeApp_Module*)activeModule())->windows( winMap );
864 defaultWindows( winMap );
867 void SalomeApp_Application::currentViewManagers( QStringList& lst ) const
870 if ( !activeStudy() )
873 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
874 ((SalomeApp_Module*)activeModule())->viewManagers( lst );
876 defaultViewManagers( lst );
879 void SalomeApp_Application::updateWindows()
881 QMap<int, int> winMap;
882 currentWindows( winMap );
884 for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
885 getWindow( it.key() );
887 loadWindowsGeometry();
889 for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
890 setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) );
893 void SalomeApp_Application::updateViewManagers()
896 currentViewManagers( lst );
898 for ( QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it )
899 getViewManager( *it, true );
902 void SalomeApp_Application::loadWindowsGeometry()
904 QtxDockAction* dockMgr = 0;
906 QAction* a = action( ViewWindowsId );
907 if ( a && a->inherits( "QtxDockAction" ) )
908 dockMgr = (QtxDockAction*)a;
914 if ( activeModule() )
915 modName = moduleLibrary( activeModule()->moduleName(), false );
917 QString section = QString( "windows_geometry" );
918 if ( !modName.isEmpty() )
919 section += QString( "." ) + modName;
922 dockMgr->loadGeometry( resourceMgr(), section, false );
923 dockMgr->restoreGeometry();
926 void SalomeApp_Application::saveWindowsGeometry()
928 QtxDockAction* dockMgr = 0;
930 QAction* a = action( ViewWindowsId );
931 if ( a && a->inherits( "QtxDockAction" ) )
932 dockMgr = (QtxDockAction*)a;
938 if ( activeModule() )
939 modName = moduleLibrary( activeModule()->moduleName(), false );
941 QString section = QString( "windows_geometry" );
942 if ( !modName.isEmpty() )
943 section += QString( "." ) + modName;
945 dockMgr->storeGeometry();
946 dockMgr->saveGeometry( resourceMgr(), section, false );
949 void SalomeApp_Application::activateWindows()
953 for ( WindowMap::Iterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
954 itr.data()->activate( activeStudy()->id() );