From: vsr Date: Fri, 17 Jun 2005 14:01:41 +0000 (+0000) Subject: Add getDirectory() method to provide application-specific "Select directory" dialog box X-Git-Tag: T3_0_0_a4~77 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b5ba60a2717669c9a2c487920427e72f2f1bf526;p=modules%2Fgui.git Add getDirectory() method to provide application-specific "Select directory" dialog box --- diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index ebde64c84..c697a0d1a 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -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 { diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 1aec6c5d1..5f8995b6b 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -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(); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 29c44c9b3..6aae237c8 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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 ); diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index cb7ea6c72..c11878791 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -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 );