Mercurial > retraceit
annotate src/mainwindow.h @ 38:26e1521b9afd
Add the possibility to detach the picture label on doubleclick
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 06 May 2015 18:09:34 +0200 |
parents | 179239c94740 |
children | 73e6b6b12412 |
rev | line source |
---|---|
25
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
9
diff
changeset
|
1 /* Copyright (C) 2015 by ETH Zürich |
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
9
diff
changeset
|
2 * Software engineering by Intevation GmbH |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 * |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=2) |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * See LICENSE.txt for details. |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 /** @file The Main UI class. |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 * |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 * Parent class of all dialogs and graphical user interaction. |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 #include <QMainWindow> |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 #include <QSettings> |
5
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
16 #include <QDateTime> |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 class QPushButton; |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 class QDropEvent; |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 class QDragLeaveEvent; |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 class QDragMoveEvent; |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 class QDragEnterEvent; |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
23 class MetaDataView; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
24 class PNGPlayer; |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 class MainWindow : public QMainWindow |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 { |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 Q_OBJECT |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 public: |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 MainWindow(); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 protected: |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 /** @brief UI setup */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 void setupGUI(); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 /** @brief Cleanup and save the current state */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 virtual void closeEvent(QCloseEvent *event); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 /** @brief Restores the last window state */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 void readSettings(); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
43 /* The drag drop actions |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 void dragEnterEvent(QDragEnterEvent *event); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 void dragMoveEvent(QDragMoveEvent *event); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 void dragLeaveEvent(QDragLeaveEvent *event); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 void dropEvent(QDropEvent *event); |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
48 */ |
32
179239c94740
(issue7-8) Add shortcuts for play/pause and next
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
49 |
179239c94740
(issue7-8) Add shortcuts for play/pause and next
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
50 void setupShortcuts(); |
179239c94740
(issue7-8) Add shortcuts for play/pause and next
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
51 |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 public slots: |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 /** @brief set an absolute folder to read a metadata.csv from. */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
54 void setFolder(const QString &folder); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
56 /** @brief set an absolute folder to check for subfolders. */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
57 void setRootFolder(const QString &folder); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
58 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
59 public: |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
60 /** @brief start the folder selection and show afterwards. */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
61 void showWithFolderSelect(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
62 |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
63 /** @brief start the subfolder selection and show afterwards. */ |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
64 void showSubFolderSelect(); |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
65 |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
66 protected slots: |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
67 /** @brief Show an error dialog to the user. */ |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
68 void showErrorMessage(const QString& errMsg); |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
69 |
5
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
70 /** @brief update the status bar for the image. |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
71 * |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
72 * Function signature is similar to showPicture in pngviewer |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
73 */ |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
74 void showPictureNameStatus(const QString& fileName, int current, |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
75 int max, const QDateTime& timestamp ); |
107e435cb569
Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
2
diff
changeset
|
76 |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
77 private: |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
78 QSettings mSettings; |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
79 |
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
80 QString mCurFolder; |
9
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
81 QString mRootFolder; |
e3c8f61e45a9
Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents:
5
diff
changeset
|
82 QString mSubFolder; |
2
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
83 MetaDataView *mDataView; |
97d2c8869c39
First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
84 PNGPlayer *mPlayer; |
0
147b08bc7d64
Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
85 }; |