QtiPlot 0.9.8.2
|
00001 /*************************************************************************** 00002 File : ExtensibleFileDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2007 by Knut Franke, Ion Vasilief 00006 Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr 00007 Description : QFileDialog plus generic extension support 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 #ifndef EXTENSIBLE_FILE_DIALOG_H 00030 #define EXTENSIBLE_FILE_DIALOG_H 00031 00032 #include <QFileDialog> 00033 #include <QPushButton> 00034 00036 00044 class ExtensibleFileDialog : public QFileDialog 00045 { 00046 Q_OBJECT 00047 00048 public: 00050 00055 ExtensibleFileDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0); 00057 void setExtensionWidget(QWidget *extension); 00058 00060 bool isExtendable(){return d_extension != NULL;}; 00061 bool isExtended(){return d_extension_toggle->isChecked();}; 00063 void setExtended(bool extended); 00065 void setExtentionToggleButtonText(const QString& text){d_extension_toggle->setText(text);}; 00067 void setEditableFilter(bool on = true); 00068 00069 private slots: 00070 void updateToggleButtonText(bool); 00071 00072 protected: 00074 QPushButton *d_extension_toggle; 00075 00076 private: 00078 QWidget *d_extension; 00080 int d_extension_row; 00081 }; 00082 00083 #endif // ifndef EXTENSIBLE_FILE_DIALOG_H