]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Add getDirectory() method to provide application-specific "Select directory" dialog box
authorvsr <vsr@opencascade.com>
Fri, 17 Jun 2005 14:01:41 +0000 (14:01 +0000)
committervsr <vsr@opencascade.com>
Fri, 17 Jun 2005 14:01:41 +0000 (14:01 +0000)
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index ebde64c8496f8c991e9ea05938e4a42b302573c1..c697a0d1a15f80d6e02ded62de1fe907c4f47534 100755 (executable)
@@ -603,10 +603,9 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q
 {
   if ( !parent )
     parent = desktop();
-  QStringList fls = QStringList::split( ";", filters, false );
   if ( open ) 
   {
-    return QFileDialog::getOpenFileName( initial, fls.join( ";;" ), parent, 0, caption );
+    return QFileDialog::getOpenFileName( initial, filters, parent, 0, caption );
   }
   else
   {
index 1aec6c5d188bbaa9fcd2fc86d018f9be42cf9b80..5f8995b6bf7aa47d98be7864abce38b62c365ed4 100755 (executable)
@@ -58,6 +58,7 @@ public:
   virtual QString       getFileFilter() const { return QString::null; }
   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 void          start();
 
index 29c44c9b300c7512e056babe5e97944725d4638b..6aae237c8e6eaef20f328df97e061b7207419cf0 100644 (file)
@@ -1380,11 +1380,17 @@ QString SalomeApp_Application::getFileName( bool open, const QString& initial, c
 {
   if ( !parent )
     parent = desktop();
-  QStringList fls = QStringList::split( ";", filters, false );
-
+  QStringList fls = QStringList::split( ";;", filters, false );
   return SUIT_FileDlg::getFileName( parent, initial, fls, caption, open, true );
 }
 
+QString SalomeApp_Application::getDirectory( const QString& initial, const QString& caption, QWidget* parent )
+{
+  if ( !parent )
+    parent = desktop();
+  return SUIT_FileDlg::getExistingDirectory( parent, initial, caption, true );
+}
+
 void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
 {
   CAM_Application::contextMenuPopup( type, thePopup, title );
index cb7ea6c7249fedf681e73b1afdcb0391a06baae9..c118787915d1dc3c2fca4fb16e279f6b404b9add 100644 (file)
@@ -76,6 +76,7 @@ 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 );
 
   SUIT_ViewManager*                   getViewManager( const QString&, const bool );