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"
22 #include <LogWindow.h>
24 #include <GLViewer_Viewer.h>
25 #include <GLViewer_ViewManager.h>
27 #include <Plot2d_ViewManager.h>
29 #include <OCCViewer_ViewManager.h>
30 #include <SOCC_ViewModel.h>
32 #include <SVTK_ViewModel.h>
33 #include <SVTK_ViewManager.h>
35 #include <STD_TabDesktop.h>
37 #include <SUIT_Tools.h>
38 #include <SUIT_Session.h>
40 #include <QtxToolBar.h>
41 #include <QtxDockAction.h>
43 #include <OB_Browser.h>
45 #include <PythonConsole_PyConsole.h>
47 #include <SUIT_MessageBox.h>
48 #include <SUIT_ResourceMgr.h>
49 #include <SUIT_ActionOperation.h>
51 #include <Utils_ORB_INIT.hxx>
52 #include <Utils_SINGLETON.hxx>
53 #include <SALOME_ModuleCatalog_impl.hxx>
60 #include <qcombobox.h>
61 #include <qmessagebox.h>
62 #include <qapplication.h>
64 #include "SALOMEDS_StudyManager.hxx"
66 #define OBJECT_BROWSER_WIDTH 300
68 static const char* imageEmptyIcon[] = {
71 "....................",
72 "....................",
73 "....................",
74 "....................",
75 "....................",
76 "....................",
77 "....................",
78 "....................",
79 "....................",
80 "....................",
81 "....................",
82 "....................",
83 "....................",
84 "....................",
85 "....................",
86 "....................",
87 "....................",
88 "....................",
89 "....................",
90 "...................."};
92 extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
94 return new SalomeApp_Application();
98 Class : SalomeApp_Application
99 Description : Application containing SalomeApp module
102 SalomeApp_Application::SalomeApp_Application()
103 : CAM_Application( false )
105 STD_TabDesktop* desk = new STD_TabDesktop();
109 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
110 QPixmap aLogo = aResMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) );
112 desktop()->setIcon( aLogo );
113 desktop()->setDockableMenuBar( true );
114 desktop()->setDockableStatusBar( false );
118 mySelMgr = new SalomeApp_SelectionMgr( this );
120 connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
121 this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
123 connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
126 SalomeApp_Application::~SalomeApp_Application()
128 saveWindowsGeometry();
133 desktop()->saveGeometry( resourceMgr(), "desktop" );
134 resourceMgr()->save();
139 SalomeApp_EventFilter::Destroy();
142 void SalomeApp_Application::start()
145 desktop()->loadGeometry( resourceMgr(), "desktop" );
147 CAM_Application::start();
149 QAction* a = action( ViewWindowsId );
150 if ( a && a->inherits( "QtxDockAction" ) )
151 ((QtxDockAction*)a)->setAutoPlace( true );
153 SalomeApp_EventFilter::Init();
156 updateViewManagers();
161 QString SalomeApp_Application::applicationName() const
166 CAM_Module* SalomeApp_Application::loadModule( const QString& name )
168 CAM_Module* mod = CAM_Application::loadModule( name );
171 connect( this, SIGNAL( studyOpened() ), mod, SLOT( onModelOpened() ) );
172 connect( this, SIGNAL( studySaved() ), mod, SLOT( onModelSaved() ) );
173 connect( this, SIGNAL( studyClosed() ), mod, SLOT( onModelClosed() ) );
178 bool SalomeApp_Application::activateModule( const QString& modName )
181 CAM_Module* prevMod = activeModule();
184 actName = prevMod->moduleName();
186 if ( actName == modName )
189 saveWindowsGeometry();
191 bool status = CAM_Application::activateModule( modName );
193 updateModuleActions();
199 updateViewManagers();
204 SalomeApp_SelectionMgr* SalomeApp_Application::selectionMgr() const
209 void SalomeApp_Application::createActions()
211 STD_Application::createActions();
213 SUIT_Desktop* desk = desktop();
214 SUIT_ResourceMgr* resMgr = resourceMgr();
216 // default icon for neutral point ('SALOME' module)
217 QPixmap defIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) );
218 if ( defIcon.isNull() )
219 defIcon = QPixmap( imageEmptyIcon );
221 // default icon for any module
222 QPixmap modIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_MODULE_ICO" ) );
223 if ( modIcon.isNull() )
224 modIcon = QPixmap( imageEmptyIcon );
226 QToolBar* modTBar = new QtxToolBar( true, desk );
227 modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
229 QActionGroup* modGroup = new QActionGroup( this );
230 modGroup->setExclusive( true );
231 modGroup->setUsesDropDown( true );
233 QAction* a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
234 tr( "PRP_APP_MODULE" ), 0, desk, true );
236 myActions.insert( QString(), a );
238 QMap<QString, QString> iconMap;
239 moduleIconNames( iconMap );
241 const int iconSize = 20;
243 modGroup->addTo( modTBar );
244 modTBar->addSeparator();
247 modules( modList, false );
249 for ( QStringList::Iterator it = modList.begin(); it != modList.end(); ++it )
251 if ( (*it).isEmpty() )
255 if ( iconMap.contains( *it ) )
256 iconName = iconMap[*it];
258 QString modName = moduleName( *it );
260 QPixmap icon = resMgr->loadPixmap( modName, iconName );
264 icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
266 QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
270 myActions.insert( *it, a );
273 SUIT_Tools::simplifySeparators( modTBar );
277 int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
278 int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
279 createMenu( separator(), windowMenu, -1, 1 );
281 for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
283 QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), QIconSet(),
284 tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
285 tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
286 0, desk, false, this, SLOT( onNewWindow() ) );
287 createMenu( a, newWinMenu, -1 );
290 connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
293 void SalomeApp_Application::onModuleActivation( QAction* a )
298 QString modName = a->menuText();
299 if ( modName == tr( "APP_NAME" ) )
300 modName = QString::null;
302 // Force user to create/open a study before module activation
303 QMap<QString, QString> iconMap;
304 moduleIconNames( iconMap );
305 QPixmap icon = resourceMgr()->loadPixmap( moduleName( modName ), iconMap[ modName ] );
307 bool cancelled = false;
308 while ( !modName.isEmpty() && !activeStudy() && !cancelled ){
309 SalomeApp_ModuleDlg aDlg( desktop(), modName, icon );
310 int res = aDlg.exec();
324 putInfo( tr("INF_CANCELLED") );
325 myActions[QString()]->setOn( true );
331 activateModule( modName );
334 QString SalomeApp_Application::defaultModule() const
336 QStringList aModuleNames;
337 modules( aModuleNames, false ); // obtain a complete list of module names for the current configuration
338 // If there's the one and only module --> activate it automatically
339 // TODO: Possible improvement - default module can be taken from preferences
340 return aModuleNames.count() > 1 ? "" : ( aModuleNames.count() ? aModuleNames.first() : "" );
343 void SalomeApp_Application::onNewWindow()
345 const QObject* obj = sender();
346 if ( !obj || !obj->inherits( "QAction" ) )
350 int id = actionId( (QAction*)obj );
354 type = GLViewer_Viewer::Type();
357 type = Plot2d_Viewer::Type();
360 type = OCCViewer_Viewer::Type();
363 type = VTKViewer_Viewer::Type();
367 if ( !type.isEmpty() )
368 createViewManager( type );
371 //=======================================================================
373 // Purpose : SLOT. Create new document
374 //=======================================================================
375 void SalomeApp_Application::onNewDoc()
377 SUIT_Study* study = activeStudy();
379 saveWindowsGeometry();
381 CAM_Application::onNewDoc();
383 if ( !study ) // new study will be create in THIS application
386 updateViewManagers();
390 //=======================================================================
392 // Purpose : SLOT. Open new document
393 //=======================================================================
394 void SalomeApp_Application::onOpenDoc()
396 SUIT_Study* study = activeStudy();
397 saveWindowsGeometry();
399 CAM_Application::onOpenDoc();
401 if ( !study ) // new study will be create in THIS application
404 updateViewManagers();
408 void SalomeApp_Application::onSelection()
410 onSelectionChanged();
412 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
413 ((SalomeApp_Module*)activeModule())->selectionChanged();
416 void SalomeApp_Application::onSelectionChanged()
420 void SalomeApp_Application::setActiveStudy( SUIT_Study* study )
422 CAM_Application::setActiveStudy( study );
427 //=======================================================================
428 // name : createNewStudy
429 // Purpose : Create new study
430 //=======================================================================
431 SUIT_Study* SalomeApp_Application::createNewStudy()
433 SalomeApp_Study* aStudy = new SalomeApp_Study( this );
435 // Set up processing of major study-related events
436 connect( aStudy, SIGNAL( created( SUIT_Study* ) ), this, SLOT( onStudyCreated( SUIT_Study* ) ) );
437 connect( aStudy, SIGNAL( opened ( SUIT_Study* ) ), this, SLOT( onStudyOpened ( SUIT_Study* ) ) );
438 connect( aStudy, SIGNAL( saved ( SUIT_Study* ) ), this, SLOT( onStudySaved ( SUIT_Study* ) ) );
439 connect( aStudy, SIGNAL( closed ( SUIT_Study* ) ), this, SLOT( onStudyClosed ( SUIT_Study* ) ) );
444 //=======================================================================
445 // name : createNewStudy
446 // Purpose : Enable/Disable menu items and toolbar buttons. Rebuild menu
447 //=======================================================================
448 void SalomeApp_Application::updateCommandsStatus()
450 CAM_Application::updateCommandsStatus();
452 for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
454 QAction* a = action( id );
456 a->setEnabled( activeStudy() );
460 //=======================================================================
461 // name : onHelpAbout
462 // Purpose : SLOT. Display "About" message box
463 //=======================================================================
464 void SalomeApp_Application::onHelpAbout()
466 QMessageBox aDlg( desktop(), "AboutDlg" );
468 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
469 QPixmap aPixmap = aResMgr->loadPixmap( "SalomeApp", tr( "ABOUT_ICO" ) );
471 QFontMetrics m( aDlg.font() );
472 QImage anImage = aPixmap.convertToImage();
473 int w = m.height() * 5;
474 anImage = anImage.scale( w, w );
475 aPixmap.convertFromImage( anImage );
477 aDlg.setCaption( tr( "ABOUT" ) );
478 aDlg.setText( tr( "APP_NAME_LONG" ).arg( APP_VERSION ) );
479 aDlg.setIconPixmap( aPixmap );
483 QWidget* SalomeApp_Application::window( const int flag, const int studyId ) const
490 if ( !activeStudy() )
493 sId = activeStudy()->id();
496 if ( myWindows.contains( flag ) )
497 wid = myWindows[flag]->widget( sId );
502 void SalomeApp_Application::addWindow( QWidget* wid, const int flag, const int studyId )
510 if ( !activeStudy() )
513 sId = activeStudy()->id();
516 if ( !myWindows.contains( flag ) )
518 QMap<int, int> winMap;
519 currentWindows( winMap );
521 myWindows.insert( flag, new SalomeApp_WidgetContainer( flag, desktop() ) );
522 if ( winMap.contains( flag ) )
523 desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
525 myWindows[flag]->setResizeEnabled( true );
526 myWindows[flag]->setCloseMode( QDockWindow::Always );
527 myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
530 myWindows[flag]->insert( sId, wid );
532 setWindowShown( flag, !myWindows[flag]->isEmpty() );
535 void SalomeApp_Application::removeWindow( const int flag, const int studyId )
537 if ( !myWindows.contains( flag ) )
543 if ( !activeStudy() )
546 sId = activeStudy()->id();
549 myWindows[flag]->remove( sId );
551 setWindowShown( flag, !myWindows[flag]->isEmpty() );
554 QWidget* SalomeApp_Application::getWindow( const int flag, const int studyId )
556 QWidget* wid = window( flag, studyId );
558 addWindow( wid = createWindow( flag ), flag, studyId );
563 bool SalomeApp_Application::isWindowVisible( const int type ) const
566 if ( myWindows.contains( type ) )
568 SUIT_Desktop* desk = ((SalomeApp_Application*)this)->desktop();
569 res = desk && desk->appropriate( myWindows[type] );
574 void SalomeApp_Application::setWindowShown( const int type, const bool on )
576 if ( !desktop() || !myWindows.contains( type ) )
579 QDockWindow* dw = myWindows[type];
580 desktop()->setAppropriate( dw, on );
581 on ? dw->show() : dw->hide();
584 OB_Browser* SalomeApp_Application::objectBrowser()
587 QWidget* wid = getWindow( WT_ObjectBrowser );
588 if ( wid->inherits( "OB_Browser" ) )
589 ob = (OB_Browser*)wid;
593 LogWindow* SalomeApp_Application::logWindow()
596 QWidget* wid = getWindow( WT_LogWindow );
597 if ( wid->inherits( "LogWindow" ) )
598 lw = (LogWindow*)wid;
602 SUIT_ViewManager* SalomeApp_Application::getViewManager( const QString& vmType, const bool create )
604 SUIT_ViewManager* aVM = viewManager( vmType );
605 SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager();
606 if ( anActiveVM && anActiveVM->getType() == vmType )
610 if ( !aVM->getActiveView() )
614 aVM = createViewManager( vmType );
618 SUIT_ViewManager* SalomeApp_Application::createViewManager( const QString& vmType )
620 SUIT_ViewManager* viewMgr = 0;
621 if ( vmType == GLViewer_Viewer::Type() )
623 viewMgr = new GLViewer_ViewManager( activeStudy(), desktop() );
624 new SalomeApp_GLSelector( (GLViewer_Viewer2d*)viewMgr->getViewModel(), mySelMgr );
626 else if ( vmType == Plot2d_Viewer::Type() )
627 viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() );
628 else if ( vmType == OCCViewer_Viewer::Type() )
630 viewMgr = new OCCViewer_ViewManager( activeStudy(), desktop() );
631 viewMgr->setViewModel( new SOCC_Viewer() );// custom view model, which extends SALOME_View interface
632 new SalomeApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
634 else if ( vmType == SVTK_Viewer::Type() )
636 viewMgr = new SVTK_ViewManager( activeStudy(), desktop() );
637 new SalomeApp_VTKSelector((SVTK_Viewer*)viewMgr->getViewModel(),mySelMgr);
643 addViewManager( viewMgr );
644 SUIT_ViewWindow* viewWin = viewMgr->createViewWindow();
646 if ( viewWin && desktop() )
647 viewWin->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
649 connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
650 this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
655 void SalomeApp_Application::onCloseView( SUIT_ViewManager* theVM )
657 removeViewManager( theVM );
660 void SalomeApp_Application::onStudyCreated( SUIT_Study* theStudy )
662 SUIT_DataObject* aRoot = 0;
663 if ( theStudy && theStudy->root() )
665 aRoot = theStudy->root();
666 //aRoot->setName( tr( "DATA_MODELS" ) );
668 if ( objectBrowser() != 0 )
669 objectBrowser()->setRootObject( aRoot );
671 activateModule( defaultModule() );
674 void SalomeApp_Application::onStudyOpened( SUIT_Study* theStudy )
676 SUIT_DataObject* aRoot = 0;
677 if ( theStudy && theStudy->root() )
679 aRoot = theStudy->root();
682 if ( objectBrowser() != 0 ) {
683 objectBrowser()->setRootObject( aRoot );
688 activateModule( defaultModule() );
693 void SalomeApp_Application::onStudySaved( SUIT_Study* )
698 void SalomeApp_Application::onStudyClosed( SUIT_Study* )
702 activateModule( "" );
703 if ( objectBrowser() != 0 )
704 objectBrowser()->setRootObject( 0 );
706 saveWindowsGeometry();
709 QString SalomeApp_Application::getFileFilter() const
714 void SalomeApp_Application::beforeCloseDoc( SUIT_Study* s )
716 CAM_Application::beforeCloseDoc( s );
718 for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
719 removeWindow( itr.key(), s->id() );
722 void SalomeApp_Application::updateActions()
724 updateCommandsStatus();
727 QWidget* SalomeApp_Application::createWindow( const int flag )
731 if ( flag == WT_ObjectBrowser )
733 OB_Browser* ob = new OB_Browser( desktop() );
735 ob->setCaption( tr( "OBJECT_BROWSER" ) );
736 ob->resize( OBJECT_BROWSER_WIDTH, ob->height() );
737 ob->setAutoUpdate( true );
740 new SalomeApp_OBSelector( ob, mySelMgr );
744 ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
746 else if ( flag == WT_PyConsole )
748 PythonConsole* pyCons = new PythonConsole( desktop(), new SalomeApp_PyInterp() );
749 pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
752 // pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
754 else if ( flag == WT_LogWindow )
756 LogWindow* logWin = new LogWindow( desktop() );
757 logWin->setCaption( tr( "LOG_WINDOW" ) );
760 logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
766 void SalomeApp_Application::defaultWindows( QMap<int, int>& aMap ) const
768 aMap.insert( WT_ObjectBrowser, Qt::DockLeft );
769 aMap.insert( WT_PyConsole, Qt::DockBottom );
772 void SalomeApp_Application::defaultViewManagers( QStringList& ) const
776 void SalomeApp_Application::afterCloseDoc()
780 CAM_Application::afterCloseDoc();
783 CORBA::ORB_var SalomeApp_Application::orb()
785 ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
786 CORBA::ORB_var& orb = init( qApp->argc(), qApp->argv() );
791 SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
793 static SALOMEDSClient_StudyManager* aStudyManager = NULL;
796 aStudyManager = new SALOMEDS_StudyManager();
798 return aStudyManager;
801 SALOME_NamingService* SalomeApp_Application::namingService()
803 return new SALOME_NamingService( orb() );
806 QString SalomeApp_Application::defaultEngineIOR()
808 // Look for a default module engine (needed for CORBAless modules to use SALOMEDS persistence)
810 CORBA::Object_ptr anEngine = namingService()->Resolve( "/SalomeAppEngine" );
811 if ( !CORBA::is_nil( anEngine ) )
812 anIOR = orb()->object_to_string( anEngine );
816 void SalomeApp_Application::moduleIconNames( QMap<QString, QString>& iconMap ) const
820 SUIT_ResourceMgr* resMgr = resourceMgr();
825 modules( modList, false );
827 for ( QStringList::const_iterator it = modList.begin(); it != modList.end(); ++it )
829 QString modName = *it;
830 QString modIntr = moduleName( modName );
831 QString modIcon = resMgr->stringValue( modIntr, "icon", QString::null );
833 if ( modIcon.isEmpty() )
836 if ( SUIT_Tools::extension( modIcon ).isEmpty() )
837 modIcon += QString( ".png" );
839 iconMap.insert( modName, modIcon );
843 void SalomeApp_Application::updateModuleActions()
846 if ( activeModule() )
847 modName = activeModule()->moduleName();
849 if ( myActions.contains( modName ) )
850 myActions[modName]->setOn( true );
853 void SalomeApp_Application::currentWindows( QMap<int, int>& winMap ) const
856 if ( !activeStudy() )
859 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
860 ((SalomeApp_Module*)activeModule())->windows( winMap );
862 defaultWindows( winMap );
865 void SalomeApp_Application::currentViewManagers( QStringList& lst ) const
868 if ( !activeStudy() )
871 if ( activeModule() && activeModule()->inherits( "SalomeApp_Module" ) )
872 ((SalomeApp_Module*)activeModule())->viewManagers( lst );
874 defaultViewManagers( lst );
877 void SalomeApp_Application::updateWindows()
879 QMap<int, int> winMap;
880 currentWindows( winMap );
882 for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
883 getWindow( it.key() );
885 loadWindowsGeometry();
887 for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
888 setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) );
891 void SalomeApp_Application::updateViewManagers()
894 currentViewManagers( lst );
896 for ( QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it )
897 getViewManager( *it, true );
900 void SalomeApp_Application::loadWindowsGeometry()
902 QtxDockAction* dockMgr = 0;
904 QAction* a = action( ViewWindowsId );
905 if ( a && a->inherits( "QtxDockAction" ) )
906 dockMgr = (QtxDockAction*)a;
912 if ( activeModule() )
913 modName = moduleLibrary( activeModule()->moduleName(), false );
915 QString section = QString( "windows_geometry" );
916 if ( !modName.isEmpty() )
917 section += QString( "." ) + modName;
920 dockMgr->loadGeometry( resourceMgr(), section, false );
921 dockMgr->restoreGeometry();
924 void SalomeApp_Application::saveWindowsGeometry()
926 QtxDockAction* dockMgr = 0;
928 QAction* a = action( ViewWindowsId );
929 if ( a && a->inherits( "QtxDockAction" ) )
930 dockMgr = (QtxDockAction*)a;
936 if ( activeModule() )
937 modName = moduleLibrary( activeModule()->moduleName(), false );
939 QString section = QString( "windows_geometry" );
940 if ( !modName.isEmpty() )
941 section += QString( "." ) + modName;
943 dockMgr->storeGeometry();
944 dockMgr->saveGeometry( resourceMgr(), section, false );
947 void SalomeApp_Application::activateWindows()
951 for ( WindowMap::Iterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
952 itr.data()->activate( activeStudy()->id() );