annotate ui/mainwindow.h @ 590:c93730ef2a3a

Fix Linux build (unused variables)
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 28 May 2014 07:55:35 +0000
parents 02a89710a7cd
children c944de9900de
rev   line source
404
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
2 * Software engineering by Intevation GmbH
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
3 *
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
6 * See LICENSE.txt for details.
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 389
diff changeset
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>
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
25
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
26 #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
27 #include "certificatelist.h"
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
28 class QMenu;
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
29 class QAction;
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
30 class QTimer;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
31
432
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
32 Q_DECLARE_METATYPE(Certificate);
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
33
153
252ffe6e27fd Changed type of MainWindow from QDialog to QMainWindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 71
diff changeset
34 class MainWindow : public QMainWindow
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
35 {
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
36 Q_OBJECT
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 public:
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
39 /**@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
40 *
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
41 * 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
42 * 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
43 * 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
44 * an update check.
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
45 *
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
46 * @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
47 * */
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
48 MainWindow(bool trayMode);
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
49
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
50 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
51 QString getMessage() {return mCurMessage;}
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
52
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
53 enum CurrentState {
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
54 BeforeDownload,
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
55 NewListAvailable,
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
56 NewSoftwareAvailable,
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
57 DownloadingSW,
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
58 TransferError,
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
59 NothingChanged
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
60 };
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
61 CurrentState getState() {return mCurState;}
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
62 void setState(CurrentState state) {mCurState = state;}
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
63
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
64 private slots:
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
65 void showMessage();
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
66 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
67 void checkUpdates(bool downloadSW = false);
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
68 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
69 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
70 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
71 /** @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
72 void messageClicked();
155
c0fdb8d336cf Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 153
diff changeset
73 void showHelp();
c0fdb8d336cf Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 153
diff changeset
74 void showAbout();
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
75 void showDetails(QListWidgetItem*);
271
1ae15ea73850 Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 212
diff changeset
76 void resizeButtons();
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
77 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
78 void installerSuccess();
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
79 void installCerts();
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
80
481
9be337ea1e3c Save the autostart and autoupdate settings.
Raimund Renkert <rrenkert@intevation.de>
parents: 461
diff changeset
81 void saveAutoUpdate(int state);
9be337ea1e3c Save the autostart and autoupdate settings.
Raimund Renkert <rrenkert@intevation.de>
parents: 461
diff changeset
82 void saveAutoStart(int state);
9be337ea1e3c Save the autostart and autoupdate settings.
Raimund Renkert <rrenkert@intevation.de>
parents: 461
diff changeset
83
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
84 /** @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
85 * the current version.
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
86 *
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
87 * 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
88 * 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
89 * version on the download server.
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
90 *
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
91 * Calls setLastModifiedSWDate on success. Otherwise downloaderError
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
92 * is triggered. */
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
93 void getLastModForCurrentVersion();
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
94
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
95 /** @brief set the last modified software date/time
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 * The last modifiedSWDate is the corresponding last modified
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
98 * 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
99 */
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
100 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
101
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
102 /** @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
103 *
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
104 * 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
105 * [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
106 * were unselected previously.
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
107 *
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
108 * 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
109 * in the certListWidget
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
110 *
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
111 * Returns false on error.
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
112 */
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
113 bool saveUnselectedCertificates();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
114
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
115 /** @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
116 *
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
117 * 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
118 *
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
119 * 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
120 */
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
121 void loadUnselectedCertificates();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
122
559
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
123 protected slots:
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
124 /** @brief cleanup and close the main window
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
125 *
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
126 * Perform a clean exit (saving state etc.) and close
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
127 * 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
128 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
129
559
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
130 /* @brief Execute the file fileName to install the softwareupdate.
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
131 *
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
132 * Once the installer process is started this function terminates
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
133 * the application. */
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
134 void installNewSW(const QString& fileName, const QDateTime& modDate);
dd8a295d5b4d Add framework for mainwindow testing
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
135
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
136 private:
587
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
137 /** @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
138 *
587
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
139 * Note: Do not use this as a 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
140 * 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
141 * 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
142 * 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
143 * and mInstalledList.
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
144 */
587
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
145 void verifyListData();
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
146
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
147 /** @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
148 *
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
149 * Note: Do not use this as a trust check as this only works on
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
150 * 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
151 * 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
152 * removed or corrupted.
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
153 */
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
154 void verifySWData();
02a89710a7cd Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents: 563
diff changeset
155
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
156 void createTrayIcon();
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
157 void createActions();
155
c0fdb8d336cf Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 153
diff changeset
158 void createMenuBar();
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
159 void createContent();
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
160 void loadCertificateList();
2
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
161
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
162 /** @brief Create a separator item for the certificate list.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
163 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
164 * The item uses a SeparatorItemDelegate for layout and styling at the given
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
165 * index.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
166 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
167 * @param[in] text The text for the item.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
168 * @param[in] index The index of the item.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
169 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
170 * @return The new separator item.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
171 */
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
172 QListWidgetItem* createSeparator(const QString &text, int index);
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
173
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
174 /** @brief Create a certificate list item for the list.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
175 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
176 * The item uses a CertificateItemDelegate for layout and styling.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
177 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
178 * @param[in] text The certificate to display.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
179 * @param[in] status The certificate status.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
180 * @param[in] index The index of the item.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
181 *
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
182 * @return The new separator item.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
183 */
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
184 QListWidgetItem* createListItem(const Certificate &certificate,
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
185 Certificate::Status status, int index);
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 432
diff changeset
186
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
187 /* Are we running in tray mode ?*/
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
188 const bool mTrayMode;
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
189 /* 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
190 QString mCurMessage;
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
191 QString mInstalledSWVersion;
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
192 QString mInstalledListVersion;
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
193
17
c12825a651ed Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents: 16
diff changeset
194 QSettings mSettings;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
195
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
196 QSystemTrayIcon *mTrayIcon;
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
197 QTimer *mMessageTimer;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
198 QMenu *mTrayMenu;
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
199 QAction *mCheckUpdates;
2
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
200 QAction *mQuitAction;
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
201 CurrentState mCurState;
155
c0fdb8d336cf Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 153
diff changeset
202 QMenuBar *mMenuBar;
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
203
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
204 /* 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
205 CertificateList mListToInstall;
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
206 /* 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
207 CertificateList mInstalledList;
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
208 /* 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
209 * base64lines with I:/R: prefix */
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
210 QStringList mPreviouslyUnselected;
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
211
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 271
diff changeset
212 QListWidget *mCertListWidget;
432
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
213
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
214 QLabel *mSubjectCN;
531
dec797c7230c Fix usage of OU / O
Andre Heinecke <aheinecke@intevation.de>
parents: 525
diff changeset
215 QLabel *mSubjectO;
432
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
216 QLabel *mIssuerCN;
531
dec797c7230c Fix usage of OU / O
Andre Heinecke <aheinecke@intevation.de>
parents: 525
diff changeset
217 QLabel *mIssuerO;
432
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
218 QLabel *mValidFrom;
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
219 QLabel *mValidTo;
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
220 QLabel *mFingerprint;
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
221
456
37a97621b466 Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents: 447
diff changeset
222 QLabel *mCurrentListDate;
37a97621b466 Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents: 447
diff changeset
223 QLabel *mNewListDate;
37a97621b466 Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents: 447
diff changeset
224
432
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
225 QCheckBox *mAutoUpdateOption;
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
226 QCheckBox *mAutoStartOption;
16b5cd858571 Updated layout and certificate details in trustbridge installer.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
227
271
1ae15ea73850 Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 212
diff changeset
228 QPushButton *installButton;
1ae15ea73850 Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 212
diff changeset
229 QPushButton *quitButton;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
230 };
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
231
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
232 #endif // MAINWINDOW_H

http://wald.intevation.org/projects/trustbridge/