From 9c0b9be9ee98a3fff0ca189574188fefdff8741c Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 13 Jul 2005 08:53:34 +0000 Subject: [PATCH] IPAL BugID9021, modified method onLoadDoc --- src/SalomeApp/SalomeApp_Application.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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; } -- 2.39.2