1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #ifndef SUIT_FILEDIALOG_H
20 #define SUIT_FILEDIALOG_H
24 #include <qfiledialog.h>
29 class SUIT_FileValidator;
31 /*! \class QFileDialog
32 * For more information see <a href="http://doc.trolltech.com">QT documentation</a>.
34 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
39 SUIT_FileDlg( QWidget*, bool open, bool showQuickDir = true, bool modal = true );
40 virtual ~SUIT_FileDlg();
43 bool isOpenDlg() const;
44 QString selectedFile() const;
46 void setValidator( SUIT_FileValidator* );
48 static QString getFileName( QWidget* parent, const QString& initial, const QStringList& filters,
49 const QString& caption, const bool open, const bool showQuickDir = true,
50 SUIT_FileValidator* validator = 0 );
51 static QStringList getOpenFileNames( QWidget* parent, const QString& initial, const QStringList& filters,
52 const QString& caption, bool showQuickDir = true,
53 SUIT_FileValidator* validator = 0 );
54 static QString getExistingDirectory( QWidget* parent, const QString& initial,
55 const QString& caption, const bool showQuickDir = true );
63 bool processPath( const QString& path );
68 void quickDir( const QString& );
72 bool myOpen; //!< open/save selector
73 QString mySelectedFile; //!< selected filename
74 SUIT_FileValidator* myValidator; //!< file validator
75 QLabel* myQuickLab; //!< quick dir combo box
76 QComboBox* myQuickCombo; //!< quick dir combo box
77 QPushButton* myQuickButton; //!< quick dir add button
80 * \brief flag is used to warkaround the Qt 2.2.2
81 * \bug accept() method is called twice if user presses 'Enter' key
82 * in file name editor while file name is not acceptable by acceptData()
83 * (e.g. permission denied)
86 /*! ASL: this bug can be fixed with help of call setDefault( false )
87 * and setAutoDefault( false ) methods for all QPushButtons of this dialog
90 static QString myLastVisitedPath; //!< last visited path