andre@9: #ifndef FOLDERSELECTDIALOG_H andre@9: #define FOLDERSELECTDIALOG_H andre@25: /* Copyright (C) 2015 by ETH Zürich andre@25: * Software engineering by Intevation GmbH andre@9: * andre@9: * This file is Free Software under the GNU GPL (v>=2) andre@9: * and comes with ABSOLUTELY NO WARRANTY! andre@9: * See LICENSE.txt for details. andre@9: */ andre@9: #include andre@9: #include andre@9: #include andre@9: andre@9: #include "filterwidget.h" andre@9: andre@9: class QTableView; andre@84: class IPAwareSortModel; andre@9: class FilterWidget; andre@9: class QStandardItemModel; andre@9: class QLabel; andre@9: class QPushButton; andre@9: class QLineEdit; andre@9: andre@66: /** andre@66: * @class FolderSelectDialog andre@66: * @brief Dialog for Folder configurable folder selection. andre@66: */ andre@9: class FolderSelectDialog : public QDialog andre@9: { andre@9: Q_OBJECT andre@9: andre@9: public: andre@9: /** @brief initialize a folder select dialog with a start folder and andre@9: * for a specific folder name pattern. andre@9: * andre@9: * If the parameter pathLabel is not empty it includes a path selection andre@9: * area. andre@9: * */ andre@9: FolderSelectDialog(const QString& startFolder, andre@9: const QString& folderPattern, andre@9: const QString& pathLabel = QString(), andre@9: QWidget * parent = 0, Qt::WindowFlags f = 0); andre@9: andre@9: void setFolder(const QString& folder); andre@9: andre@9: protected: andre@9: void setupGUI(); andre@9: andre@9: protected slots: andre@9: /** @brief The user wants to accept the selection */ andre@9: void wantToAccept(); andre@9: andre@9: /** @brief Open the folder selection dialog for the output folder */ andre@9: void changeFolderClicked(); andre@9: andre@9: /** @brief try to load the folder line into the model */ andre@9: void goClicked(); andre@9: andre@9: /** @brief enable or disable the go button depending on the path. */ andre@9: void pathLineChanged(); andre@9: andre@9: /** @brief enable or disable the ok button depending on the selection. */ andre@9: void selectionChanged (const QItemSelection& selected, andre@9: const QItemSelection& deselected); andre@9: andre@9: Q_SIGNALS: andre@9: /** @brief emited before the dialog is closed when a folder is selected */ andre@9: void folderSelected(const QString& folder); andre@9: andre@90: /** @brief Back button was clicked */ andre@90: void backClicked(); andre@90: andre@9: private: andre@9: QTableView *mView; andre@9: FilterWidget *mFilterWidget; andre@84: IPAwareSortModel *mSortModel; andre@9: QString mCurFolder, andre@9: mFolderPattern; andre@9: QString mPathLabelString; andre@9: QStandardItemModel *mModel; andre@9: QLabel *mPathLabel; andre@9: QLineEdit *mPathLineEdit; andre@9: QPushButton *mGoButton, andre@9: *mOkButton; andre@109: QWidget *mErrorWidget; andre@109: QString mErrMsg; andre@9: bool mShowPathSelection; andre@9: }; andre@9: andre@9: #endif // FOLDERSELECTDIALOG_H