Mercurial > trustbridge
annotate ui/mainwindow.h @ 713:cdf8a924e480
(UI) Increase apply/quit button height. Updated translations.
author | Emanuel Schuetze <emanuel@intevation.de> |
---|---|
date | Wed, 02 Jul 2014 15:46:50 +0200 |
parents | bd48fae793b6 |
children | 929c3db85eb7 |
rev | line source |
---|---|
404 | 1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=2) | |
5 * and comes with ABSOLUTELY NO WARRANTY! | |
6 * See LICENSE.txt for details. | |
7 */ | |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 #ifndef MAINWINDOW_H |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 #define MAINWINDOW_H |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
11 /** |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
12 * @file mainwindow.h |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
13 * @brief Main UI controller |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
14 */ |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
15 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 #include <QSystemTrayIcon> |
153
252ffe6e27fd
Changed type of MainWindow from QDialog to QMainWindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
71
diff
changeset
|
17 #include <QMainWindow> |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
18 #include <QSettings> |
155
c0fdb8d336cf
Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
153
diff
changeset
|
19 #include <QMenuBar> |
189
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
20 #include <QListWidget> |
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
21 #include <QTextEdit> |
271
1ae15ea73850
Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents:
212
diff
changeset
|
22 #include <QPushButton> |
432
16b5cd858571
Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
23 #include <QLabel> |
16b5cd858571
Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
24 #include <QCheckBox> |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
25 #include <QScrollArea> |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
26 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
27 #include "downloader.h" |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
28 #include "certificatelist.h" |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
29 #include "certificatelistwidget.h" |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
30 class QMenu; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 class QAction; |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
32 class QTimer; |
693
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
690
diff
changeset
|
33 class QPushButton; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 |
432
16b5cd858571
Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents:
404
diff
changeset
|
35 |
153
252ffe6e27fd
Changed type of MainWindow from QDialog to QMainWindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
71
diff
changeset
|
36 class MainWindow : public QMainWindow |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
37 { |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
38 Q_OBJECT |
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 public: |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
41 /**@brief create a new Main Window object |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
42 * |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
43 * In tray mode this window is not shown and only shows |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
44 * notification messages if there is some actionable state |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
45 * reached. If tray mode is true it also exits after |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
46 * an update check. |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
47 * |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
48 * @param[in] trayMode set the tray mode |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
49 * */ |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
50 MainWindow(bool trayMode); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
51 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
52 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
|
53 QString getMessage() {return mCurMessage;} |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
54 |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
55 enum CurrentState { |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
56 BeforeDownload, |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
57 NewListAvailable, |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
58 NewSoftwareAvailable, |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
59 DownloadingSW, |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
60 TransferError, |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
61 NothingChanged |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
62 }; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
63 CurrentState getState() {return mCurState;} |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
64 void setState(CurrentState state) {mCurState = state;} |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
65 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
66 private slots: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
67 void showMessage(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
68 void iconActivated(QSystemTrayIcon::ActivationReason reason); |
461
1ce835c40eb7
Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents:
456
diff
changeset
|
69 void checkUpdates(bool downloadSW = false); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
70 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
|
71 void handleNewSW(const QString& fileName, const QDateTime& modDate); |
45
c6125d73faf4
Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents:
19
diff
changeset
|
72 void downloaderError(const QString &message, SSLConnection::ErrorCode error); |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
73 /** @brief Trigger the appropiate action depending on the state */ |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
74 void messageClicked(); |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
75 void installerError(const QString& errMsg); |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
76 void installerSuccess(); |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
77 void installCerts(); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
78 void toggleInManual(bool state, const Certificate &cert); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
79 void removeFromManual(bool state, const Certificate &cert); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
80 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
81 void togglePages(int button); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
82 void toggleUpdatesNew(); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
83 void toggleUpdatesRemove(); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
84 void toggleUpdatesManual(); |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
85 void listChanged(int selected); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
86 |
609
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
87 /** @brief check for running software that needs to close before installing |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
88 * |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
89 * This function calls installCerts if no software is running otherwise |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
90 * it informs the user about the software that still needs to be closed. |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
91 */ |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
92 void checkAndInstallCerts(); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
93 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
94 /** @brief get the last modified date on the download server for |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
95 * the current version. |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
96 * |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
97 * After the initial installation this function can be used to |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
98 * determine the DateTime that corresponds to the currently installed |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
99 * version on the download server. |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
100 * |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
101 * Calls setLastModifiedSWDate on success. Otherwise downloaderError |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
102 * is triggered. */ |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
103 void getLastModForCurrentVersion(); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
104 |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
105 /** @brief set the last modified software date/time |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
106 * |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
107 * The last modifiedSWDate is the corresponding last modified |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
108 * timestamp from the download server vor the currently installed version. |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
109 */ |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
110 void setLastModifiedSWDate(const QDateTime &date); |
486
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
111 |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
112 /** @brief saves the currently unselected certificates |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
113 * |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
114 * This creates / updates a qsettings section that |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
115 * [unselected] that contains the certificates that |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
116 * were unselected previously. |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
117 * |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
118 * Unselected are certificates that are unchecked |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
119 * in the certListWidget |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
120 * |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
121 * Returns false on error. |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
122 */ |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
123 bool saveUnselectedCertificates(QStringList unselected); |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
124 |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
125 /** @brief loads previously unselected certificates from settings |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
126 * |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
127 * The certificates are strored in the list mPreviouslyUnselected. |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
128 * |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
129 * On error mPreviouslyUnselected is empty after this call. |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
130 */ |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
131 void loadUnselectedCertificates(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
132 |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
133 /** @brief log / store a successful downloader run |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
134 * |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
135 * A downloader run is successful if the finished signal |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
136 * is emited and the state is not TransferError |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
137 */ |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
138 void updateCheckSuccess(); |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
139 |
686
a2e94e88d304
(Issue27) Close the app on close event.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
654
diff
changeset
|
140 protected: |
690
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
686
diff
changeset
|
141 virtual void closeEvent(QCloseEvent *event); |
686
a2e94e88d304
(Issue27) Close the app on close event.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
654
diff
changeset
|
142 |
559
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
143 protected slots: |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
144 /** @brief cleanup and close the main window |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
145 * |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
146 * Perform a clean exit (saving state etc.) and close |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
147 * the application */ |
563
aee3eb10bbba
Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents:
559
diff
changeset
|
148 virtual void closeApp(); |
447
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
445
diff
changeset
|
149 |
559
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
150 /* @brief Execute the file fileName to install the softwareupdate. |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
151 * |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
152 * Once the installer process is started this function terminates |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
153 * the application. */ |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
154 void installNewSW(const QString& fileName, const QDateTime& modDate); |
dd8a295d5b4d
Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents:
551
diff
changeset
|
155 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
156 private: |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
157 /** @brief check the integrity of available certificate lists. |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
158 * |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
159 * Note: Do not use this as a local trust check as this only works on |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
160 * FileNames where the underlying files can change. This |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
161 * is just meant to check if the downloaded data was somehow |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
162 * removed or corrupted. It also initializes mListToInstall |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
163 * and mInstalledList. |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
164 */ |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
165 void verifyListData(); |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
166 |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
167 /** @brief check the integrity of available software updates. |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
168 * |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
169 * Note: Do not use this as a local trust check as this only works on |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
170 * FileNames where the underlying files can change. This |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
171 * is just meant to check if the downloaded data was somehow |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
172 * removed or corrupted. |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
173 */ |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
174 void verifySWData(); |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
175 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
176 void createTrayIcon(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
177 void createActions(); |
187
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
178 void createContent(); |
189
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
179 void loadCertificateList(); |
2 | 180 |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
181 /* Are we running in tray mode ?*/ |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
182 const bool mTrayMode; |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
271
diff
changeset
|
183 /* The message currently shown at intervals */ |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
184 QString mCurMessage; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
185 QString mInstalledSWVersion; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
186 QString mInstalledListVersion; |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
187 |
17
c12825a651ed
Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents:
16
diff
changeset
|
188 QSettings mSettings; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
189 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
190 QSystemTrayIcon *mTrayIcon; |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
191 QTimer *mMessageTimer; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
192 QMenu *mTrayMenu; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
193 QAction *mCheckUpdates; |
2 | 194 QAction *mQuitAction; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
195 CurrentState mCurState; |
155
c0fdb8d336cf
Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
153
diff
changeset
|
196 QMenuBar *mMenuBar; |
693
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
690
diff
changeset
|
197 QPushButton *mQuitButton; |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
198 |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
199 /* The current list that should be installed */ |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
200 CertificateList mListToInstall; |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
201 /* The last list that we installed */ |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
202 CertificateList mInstalledList; |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
203 /* Previously made "unselect" choices in the form of |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
204 * base64lines with I:/R: prefix */ |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
205 QStringList mPreviouslyUnselected; |
189
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
206 |
456
37a97621b466
Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents:
447
diff
changeset
|
207 QLabel *mCurrentListDate; |
37a97621b466
Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents:
447
diff
changeset
|
208 QLabel *mNewListDate; |
37a97621b466
Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents:
447
diff
changeset
|
209 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
210 QButtonGroup *mButtonGroup; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
211 QScrollArea *mUpdatesPanel; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
212 QWidget *mUpdatesWidget; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
213 QScrollArea *mInstallPanel; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
214 QScrollArea *mRemovePanel; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
215 QScrollArea *mInfoPanel; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
216 |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
217 QLabel *mUpdatesHeader; |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
218 QLabel *mLastCertUpdate; |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
219 QLabel *mSoftwareVersionLabel; |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
693
diff
changeset
|
220 QLabel *mLastUpdateCheck; |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
221 QLabel *mUpdatesNewCertificates; |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
222 QLabel *mUpdatesRemoveCertificates; |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
223 QLabel *mUpdatesManualCertificates; |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
224 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
225 CertificateListWidget *mUpdatesNew; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
226 CertificateListWidget *mUpdatesRemove; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
227 CertificateListWidget *mUpdatesManual; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
228 CertificateListWidget *mInstallList; |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
229 CertificateListWidget *mRemoveList; |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
641
diff
changeset
|
230 |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
641
diff
changeset
|
231 QPushButton *mUpdatesDetailsNew; |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
641
diff
changeset
|
232 QPushButton *mUpdatesDetailsRemove; |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
641
diff
changeset
|
233 QPushButton *mUpdatesDetailsManual; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
234 }; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
235 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
236 #endif // MAINWINDOW_H |