Mercurial > trustbridge
annotate ui/mainwindow.h @ 17:c12825a651ed
Read out content-length and use this to skip existing files
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 19 Feb 2014 14:22:26 +0000 |
parents | 225a5ec20dad |
children | 9af6198deb8e |
rev | line source |
---|---|
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef MAINWINDOW_H |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
2 #define MAINWINDOW_H |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 #include <QSystemTrayIcon> |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 #include <QDialog> |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
6 #include <QSettings> |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
7 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
8 #include "downloader.h" |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 class QMenu; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 class QAction; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 class MainWindow : public QDialog |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 { |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 Q_OBJECT |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 public: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 MainWindow(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 void setMessage(const QString message) {mCurMessage = message;} |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 QString getMessage() {return mCurMessage;} |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
22 enum CurrentState { |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
23 BeforeDownload, |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
24 NewListAvailable, |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
25 NewSoftwareAvailable, |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
26 TransferError |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
27 }; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
28 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
29 CurrentState getState() {return mCurState;} |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
30 void setState(CurrentState state) {mCurState = state;} |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
31 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 private slots: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 void showMessage(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 void iconActivated(QSystemTrayIcon::ActivationReason reason); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
35 void checkUpdates(); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
36 void handleNewList(const QString& fileName, const QDateTime& modDate); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
37 void handleNewSW(const QString& fileName, const QDateTime& modDate); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
38 void downloaderError(const QString &message, Downloader::ErrorCode error); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
39 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
40 private: |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
41 void verifyAvailableData(); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
42 void createTrayIcon(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
43 void createActions(); |
2 | 44 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
45 QString mCurMessage; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
46 QString mInstalledSWVersion; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
47 QString mInstalledListVersion; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
48 |
17
c12825a651ed
Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents:
16
diff
changeset
|
49 QSettings mSettings; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
50 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 QSystemTrayIcon *mTrayIcon; |
2 | 52 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
53 QMenu *mTrayMenu; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 QAction *mCheckUpdates; |
2 | 55 QAction *mQuitAction; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
56 CurrentState mCurState; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
57 }; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
58 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
59 #endif // MAINWINDOW_H |