From: srn Date: Wed, 13 Jul 2005 08:53:34 +0000 (+0000) Subject: IPAL BugID9021, modified method onLoadDoc X-Git-Tag: V3_0_1~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9c0b9be9ee98a3fff0ca189574188fefdff8741c;p=modules%2Fgui.git IPAL BugID9021, modified method onLoadDoc --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 461d17fe2..1db79fa56 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -535,9 +535,22 @@ void SalomeApp_Application::onLoadDoc() STD_LoadStudiesDlg aDlg( desktop(), TRUE); std::vector List = studyMgr()->GetOpenStudies(); + + SUIT_Session* aSession = SUIT_Session::session(); + QPtrList aAppList = aSession->applications(); + SUIT_Application* aApp = 0; + for (unsigned int ind = 0; ind < List.size(); ind++) { studyname = List[ind]; - aDlg.ListComponent->insertItem( studyname ); + //Add to list only unloaded studies + bool isAlreadyOpen = false; + for ( QPtrListIterator it( aAppList ); it.current() && !isAlreadyOpen; ++it ) + { + aApp = it.current(); + if ( aApp->activeStudy()->studyName() == studyname ) isAlreadyOpen = true; + } + + if ( !isAlreadyOpen ) aDlg.ListComponent->insertItem( studyname ); } int retVal = aDlg.exec(); @@ -1704,7 +1717,8 @@ void SalomeApp_Application::createEmptyStudy() bool SalomeApp_Application::activateModule( CAM_Module* mod ) { - CAM_Application::activateModule( mod ); + bool res = CAM_Application::activateModule( mod ); if ( objectBrowser() ) objectBrowser()->updateTree(); + return res; }