]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Add getOpenFileNames() method to get the list of files selected by user
authorvsr <vsr@opencascade.com>
Mon, 20 Jun 2005 05:55:26 +0000 (05:55 +0000)
committervsr <vsr@opencascade.com>
Mon, 20 Jun 2005 05:55:26 +0000 (05:55 +0000)
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index 3fd1245294982d201d38bc33ed4201948ce220b7..e898ec84c76a87b1958c08bf3f1cdd0a3ed5fcf3 100644 (file)
@@ -752,9 +752,8 @@ public:
       myCaption( caption ), 
       myOpen ( open ) {}
   virtual void Execute() {
-    if ( /*SalomeApp_Study* aStudy = */getActiveStudy() ) {
-      // VSR: TODO
-      // myResult = QAD_FileDlg::getFileName(parent, initial, filters, caption, open);
+    if ( SalomeApp_Application* anApp = getApplication() ) {
+      myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"), myCaption, myParent );
     }
   }
 };
@@ -788,9 +787,8 @@ public:
       myFilters( filters ), 
       myCaption( caption ) {}
   virtual void Execute() {
-    if ( /*SalomeApp_Study* aStudy = */getActiveStudy() ) {
-      // VSR: TODO
-      // myResult = QAD_FileDlg::getOpenFileNames(parent, initial, filters, caption);
+    if ( SalomeApp_Application* anApp = getApplication() ) {
+      myResult = anApp->getOpenFileNames( myInitial, myFilters.join(";;"), myCaption, myParent );
     }
   }
 };
@@ -820,9 +818,8 @@ public:
       myInitial( initial ), 
       myCaption( caption ) {}
   virtual void Execute() {
-    if ( /*SalomeApp_Study* aStudy = */getActiveStudy() ) {
-      // VSR: TODO
-      // myResult = QAD_FileDlg::getExistingDirectory(parent, initial, caption);
+    if ( SalomeApp_Application* anApp = getApplication() ) {
+      myResult = anApp->getDirectory( myInitial, myCaption, myParent );
     }
   }
 };
index 4a5c188543143b90af71c5346145aed361d83406..56161bd59abd3ff9040805184deb9dbc86822df9 100644 (file)
@@ -1384,6 +1384,15 @@ QString SalomeApp_Application::getDirectory( const QString& initial, const QStri
   return SUIT_FileDlg::getExistingDirectory( parent, initial, caption, true );
 }
 
+QStringList SalomeApp_Application::getOpenFileNames( const QString& initial, const QString& filters, 
+                                                    const QString& caption, QWidget* parent )
+{
+  if ( !parent )
+    parent = desktop();
+  QStringList fls = QStringList::split( ";;", filters, false );
+  return SUIT_FileDlg::getOpenFileNames( parent, initial, fls, caption, true );
+}
+
 void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
 {
   CAM_Application::contextMenuPopup( type, thePopup, title );
index 266ef4f0d3ee200fcc0ae27a16831a1889277a10..0da12339c6046a926c46f167ae720950190a4eb2 100644 (file)
@@ -78,7 +78,9 @@ public:
   virtual QString                     getFileFilter() const;
   virtual QString                     getFileName( bool open, const QString& initial, const QString& filters, 
                                                   const QString& caption, QWidget* parent );
-  QString                             getDirectory( const QString& initial, const QString& caption, QWidget* parent );
+  virtual QString                     getDirectory( const QString& initial, const QString& caption, QWidget* parent );
+  virtual QStringList                 getOpenFileNames( const QString& initial, const QString& filters, 
+                                                       const QString& caption, QWidget* parent );
 
   SUIT_ViewManager*                   getViewManager( const QString&, const bool );