Mercurial > retraceit
annotate src/folderselectdialog.h @ 113:20ec21924338 tip
Added tag 1.4 for changeset 9daf778feaf1
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 08 Dec 2016 15:34:30 +0100 |
parents | 0ad468912ff3 |
children |
rev | line source |
---|---|
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef FOLDERSELECTDIALOG_H |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 #define FOLDERSELECTDIALOG_H |
25
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
9
diff
changeset
|
3 /* Copyright (C) 2015 by ETH Zürich |
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
9
diff
changeset
|
4 * Software engineering by Intevation GmbH |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 #include <QWidget> |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 #include <QDialog> |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 #include <QItemSelection> |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 #include "filterwidget.h" |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 class QTableView; |
84
90c297a2a3dd
Sort IP Addresses by their actual number in folder selection
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
17 class IPAwareSortModel; |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 class FilterWidget; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 class QStandardItemModel; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 class QLabel; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 class QPushButton; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 class QLineEdit; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 |
66
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
24 /** |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
25 * @class FolderSelectDialog |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
26 * @brief Dialog for Folder configurable folder selection. |
098a10fc2e83
Add doxygen files and improve doxygen comments
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
27 */ |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 class FolderSelectDialog : public QDialog |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 { |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 Q_OBJECT |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 public: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 /** @brief initialize a folder select dialog with a start folder and |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 * for a specific folder name pattern. |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 * |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 * If the parameter pathLabel is not empty it includes a path selection |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 * area. |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 * */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 FolderSelectDialog(const QString& startFolder, |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 const QString& folderPattern, |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 const QString& pathLabel = QString(), |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 QWidget * parent = 0, Qt::WindowFlags f = 0); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 void setFolder(const QString& folder); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 protected: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 void setupGUI(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
49 protected slots: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 /** @brief The user wants to accept the selection */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
51 void wantToAccept(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 /** @brief Open the folder selection dialog for the output folder */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
54 void changeFolderClicked(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
56 /** @brief try to load the folder line into the model */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
57 void goClicked(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
58 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
59 /** @brief enable or disable the go button depending on the path. */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
60 void pathLineChanged(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
61 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
62 /** @brief enable or disable the ok button depending on the selection. */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
63 void selectionChanged (const QItemSelection& selected, |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
64 const QItemSelection& deselected); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
65 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
66 Q_SIGNALS: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
67 /** @brief emited before the dialog is closed when a folder is selected */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
68 void folderSelected(const QString& folder); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
69 |
90
c3000fa6ca56
Add back button to subfolder selection dialog
Andre Heinecke <andre.heinecke@intevation.de>
parents:
84
diff
changeset
|
70 /** @brief Back button was clicked */ |
c3000fa6ca56
Add back button to subfolder selection dialog
Andre Heinecke <andre.heinecke@intevation.de>
parents:
84
diff
changeset
|
71 void backClicked(); |
c3000fa6ca56
Add back button to subfolder selection dialog
Andre Heinecke <andre.heinecke@intevation.de>
parents:
84
diff
changeset
|
72 |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
73 private: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
74 QTableView *mView; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
75 FilterWidget *mFilterWidget; |
84
90c297a2a3dd
Sort IP Addresses by their actual number in folder selection
Andre Heinecke <andre.heinecke@intevation.de>
parents:
66
diff
changeset
|
76 IPAwareSortModel *mSortModel; |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
77 QString mCurFolder, |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
78 mFolderPattern; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
79 QString mPathLabelString; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
80 QStandardItemModel *mModel; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
81 QLabel *mPathLabel; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
82 QLineEdit *mPathLineEdit; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
83 QPushButton *mGoButton, |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
84 *mOkButton; |
109
0ad468912ff3
Add warning about folder names to widget
Andre Heinecke <andre.heinecke@intevation.de>
parents:
90
diff
changeset
|
85 QWidget *mErrorWidget; |
0ad468912ff3
Add warning about folder names to widget
Andre Heinecke <andre.heinecke@intevation.de>
parents:
90
diff
changeset
|
86 QString mErrMsg; |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
87 bool mShowPathSelection; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
88 }; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
89 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
90 #endif // FOLDERSELECTDIALOG_H |