annotate src/mainwindow.h @ 31:749ecdfd036a

Store ini file in relayit folder (using organization name)
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 06 May 2015 15:30:47 +0200
parents 64a51a42c01f
children 179239c94740
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 */
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 public slots:
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50 /** @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
51 void setFolder(const QString &folder);
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
52
9
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
53 /** @brief set an absolute folder to check for subfolders. */
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
54 void setRootFolder(const QString &folder);
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
55
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
56 public:
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
57 /** @brief start the folder selection and show afterwards. */
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
58 void showWithFolderSelect();
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
59
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
60 /** @brief start the subfolder selection and show afterwards. */
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
61 void showSubFolderSelect();
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
62
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
63 protected slots:
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
64 /** @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
65 void showErrorMessage(const QString& errMsg);
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
66
5
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
67 /** @brief update the status bar for the image.
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
68 *
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
69 * Function signature is similar to showPicture in pngviewer
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
70 */
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
71 void showPictureNameStatus(const QString& fileName, int current,
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
72 int max, const QDateTime& timestamp );
107e435cb569 Enable speed slider in pngplayer
Andre Heinecke <andre.heinecke@intevation.de>
parents: 2
diff changeset
73
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
74 private:
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
75 QSettings mSettings;
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
76
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
77 QString mCurFolder;
9
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
78 QString mRootFolder;
e3c8f61e45a9 Implement folderselection dialogs
Andre Heinecke <andre.heinecke@intevation.de>
parents: 5
diff changeset
79 QString mSubFolder;
2
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
80 MetaDataView *mDataView;
97d2c8869c39 First prototype implementation of table view and player
Andre Heinecke <andre.heinecke@intevation.de>
parents: 0
diff changeset
81 PNGPlayer *mPlayer;
0
147b08bc7d64 Initial commit of a basic Application framework.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
82 };
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)