From: srn Date: Tue, 12 Jul 2005 09:40:28 +0000 (+0000) Subject: IPAL BugID9021, a call to the dialog box with a list of existent studies X-Git-Tag: V3_0_1~64 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=432a7be3e841aee0ba932def0be7c3b7e1d35ed5;p=modules%2Fgui.git IPAL BugID9021, a call to the dialog box with a list of existent studies --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 7c2182ea1..d5ff6ffff 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -44,6 +44,8 @@ #include +#include "STD_LoadStudiesDlg.h" + #include #include @@ -75,6 +77,8 @@ #include #include #include +#include +#include #include "SALOMEDS_StudyManager.hxx" @@ -524,6 +528,35 @@ bool SalomeApp_Application::onOpenDoc( const QString& aName ) return res; } +void SalomeApp_Application::onLoadDoc() +{ + QString name, studyname, ext; + + STD_LoadStudiesDlg aDlg( desktop(), TRUE); + + std::vector List = studyMgr()->GetOpenStudies(); + for (unsigned int ind = 0; ind < List.size(); ind++) { + studyname = List[ind]; + aDlg.ListComponent->insertItem( studyname ); + } + + int retVal = aDlg.exec(); + studyname = aDlg.ListComponent->currentText(); + + if (retVal == QDialog::Rejected) + return; + + if ( studyname.isNull() || studyname.isEmpty() ) + return; + + name = studyname; + name.replace( QRegExp(":"), "/" ); + + onLoadDoc(name); +} + + + bool SalomeApp_Application::onLoadDoc( const QString& aName ) { bool res = CAM_Application::onLoadDoc( aName ); diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 8f45b3854..7ccc85442 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -117,10 +117,11 @@ public slots: virtual void onOpenDoc(); virtual void onHelpAbout(); virtual bool onOpenDoc( const QString& ); + virtual void onLoadDoc(); virtual bool onLoadDoc( const QString& ); virtual void onCopy(); virtual void onPaste(); - + private slots: void onSelection(); void onRefresh();