]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
IPAL BugID9021, a call to the dialog box with a list of existent studies
authorsrn <srn@opencascade.com>
Tue, 12 Jul 2005 09:40:28 +0000 (09:40 +0000)
committersrn <srn@opencascade.com>
Tue, 12 Jul 2005 09:40:28 +0000 (09:40 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index 7c2182ea1bd6e44473ebb5ab5ec70ce117402d2f..d5ff6ffff4f16b6bb7b684337b10ab93cae89f26 100644 (file)
@@ -44,6 +44,8 @@
 
 #include <STD_TabDesktop.h>
 
+#include "STD_LoadStudiesDlg.h"
+
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
 
@@ -75,6 +77,8 @@
 #include <qcombobox.h>
 #include <qmessagebox.h>
 #include <qapplication.h>
+#include <qlistbox.h>
+#include <qregexp.h>
 
 #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<std::string> 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 );
index 8f45b3854f49bbc5db68b3f06b452a80ce31e342..7ccc854423a13bd95996dd37f919cbffd66d4240 100644 (file)
@@ -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();