annotate ui/mainwindow.cpp @ 643:f8be956c819b trustbridge-refactor

Fixed mainwindow layout warning.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 24 Jun 2014 17:46:45 +0200
parents dd738ef17715
children f65503c1833b
rev   line source
404
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
2 * Software engineering by Intevation GmbH
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
3 *
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
6 * See LICENSE.txt for details.
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 393
diff changeset
7 */
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
8 #include "mainwindow.h"
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
9
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10 #include <QDebug>
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
11 #include <QProcess>
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
12 #include <QProgressDialog>
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
13 #include <QMessageBox>
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
14 #include <QSystemTrayIcon>
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
15 #include <QAction>
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
16 #include <QDialog>
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
17 #include <QDir>
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
18 #include <QMenu>
2
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
19 #include <QApplication>
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
20 #include <QFile>
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
21 #include <QTimer>
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
22 #include <QHBoxLayout>
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
23 #include <QVBoxLayout>
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
24 #include <QGroupBox>
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
25 #include <QSplitter>
205
a3f542bf38f7 Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 200
diff changeset
26 #include <QLabel>
a3f542bf38f7 Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 200
diff changeset
27 #include <QImage>
250
1e112cf41e92 Updated the mainwindow layout.
Raimund Renkert <rrenkert@intevation.de>
parents: 249
diff changeset
28 #include <QCheckBox>
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
29 #include <QButtonGroup>
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
30 #include <QToolButton>
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
31
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
32 // The amount of time in minutes stay silent if we have
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
33 // something to say
548
c84dc8f6d017 Increase nag interval to 70 minutes
Andre Heinecke <aheinecke@intevation.de>
parents: 531
diff changeset
34 #define NAG_INTERVAL_MINUTES 70
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
35
409
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 407
diff changeset
36 #ifndef APPNAME
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 407
diff changeset
37 #define APPNAME "TrustBridge"
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 407
diff changeset
38 #endif
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 407
diff changeset
39
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 407
diff changeset
40 #define SERVER_URL "https://files.intevation.de:443"
531
dec797c7230c Fix usage of OU / O
Andre Heinecke <aheinecke@intevation.de>
parents: 525
diff changeset
41 #define LIST_RESOURCE "/users/aheinecke/zertifikatsliste.txt"
554
d512d8eef8f6 Use case sensitive file name for SW-Updates
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
42 #define SW_RESOURCE "/users/aheinecke/TrustBridge.exe"
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
43 #ifdef Q_OS_WIN
554
d512d8eef8f6 Use case sensitive file name for SW-Updates
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
44 #define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.exe"
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
45 #else
554
d512d8eef8f6 Use case sensitive file name for SW-Updates
Andre Heinecke <aheinecke@intevation.de>
parents: 551
diff changeset
46 #define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.sh"
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
47 #endif
72
7e304573ebd1 Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents: 71
diff changeset
48
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
49 #include "certificatelist.h"
10
fe39d93f1261 Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents: 7
diff changeset
50 #include "downloader.h"
191
246c21b1727f Show the help dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 189
diff changeset
51 #include "helpdialog.h"
200
fe424c5fc875 Show the about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 191
diff changeset
52 #include "aboutdialog.h"
267
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
53 #include "certificateitemdelegate.h"
274
90432cb1f374 Added a separator to certificate list to demonstrate how it works.
Raimund Renkert <rrenkert@intevation.de>
parents: 271
diff changeset
54 #include "separatoritemdelegate.h"
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
55 #include "installwrapper.h"
507
20973a56d5ec Use is_admin to determine if UAC icon should be painted on the button
Andre Heinecke <aheinecke@intevation.de>
parents: 499
diff changeset
56 #include "util.h"
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
57 #include "logging.h"
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents: 2
diff changeset
58
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
59 MainWindow::MainWindow(bool trayMode):
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
60 mTrayMode(trayMode)
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
61 {
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
62 mUpdatesNewSize = 0;
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
63 mUpdatesRemoveSize = 0;
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
64 mUpdatesManualSize = 0;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
65 createActions();
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
66 createTrayIcon();
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
67 createContent();
450
4932fc33ee82 Updated window and main layout size.
Raimund Renkert <rrenkert@intevation.de>
parents: 449
diff changeset
68 resize(950, 540);
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
69 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode");
265
ffd47b045d19 Added certificate status enum and register it as metatype.
Raimund Renkert <rrenkert@intevation.de>
parents: 250
diff changeset
70 qRegisterMetaType<Certificate::Status>("Certificate::Status");
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
71
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
72 connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
73 this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
74
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
75 mMessageTimer = new QTimer(this);
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
76 connect(mMessageTimer, SIGNAL(timeout()), this, SLOT(showMessage()));
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
77 mMessageTimer->setInterval(NAG_INTERVAL_MINUTES * 60 * 1000);
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
78 mMessageTimer->start();
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
79 checkUpdates();
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
80 loadUnselectedCertificates();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
81 loadCertificateList();
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
82 if (!trayMode) {
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
83 show();
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
84 }
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
85 }
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
86
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
87 void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
88 {
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
89 switch (reason) {
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
90 case QSystemTrayIcon::Trigger:
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
91 case QSystemTrayIcon::MiddleClick:
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
92 showMessage();
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
93 break;
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
94 case QSystemTrayIcon::DoubleClick:
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
95 show();
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
96 break;
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
97 default:
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
98 ;
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
99 }
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
100 }
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
101
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
102 void MainWindow::messageClicked()
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
103 {
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
104 if (mCurState == NewListAvailable) {
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
105 show();
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
106 }
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
107
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
108 if (mCurState == NewSoftwareAvailable) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
109 checkUpdates(true);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
110 mCurState = DownloadingSW;
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
111 }
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
112 }
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
113
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
114 void MainWindow::showMessage()
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
115 {
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
116 if (!isVisible() && !mCurMessage.isEmpty()) {
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
117 mTrayIcon->showMessage(QApplication::applicationName(), mCurMessage,
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
118 QSystemTrayIcon::Information, 5000);
19
9af6198deb8e Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents: 17
diff changeset
119 mMessageTimer->start(); // Restart the timer so that we don't spam
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
120 }
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
121 }
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
122
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
123 void MainWindow::verifyAvailableData()
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
124 {
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
125 QString availableFileName = mSettings.value("List/available").toString();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
126 QString installedFileName = mSettings.value("List/installed").toString();
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
127 QString swFileName = mSettings.value("Software/available").toString();
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
128
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
129 if (!availableFileName.isEmpty()) {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
130 mListToInstall.readList(availableFileName.toLocal8Bit().constData());
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
131 if (!mListToInstall.isValid()) {
82
1f27d6db5ee3 Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents: 72
diff changeset
132 mCurState = TransferError;
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
133 // Probably a bug when Qt fileName is encoded and cFileName
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
134 // fails because of this. This needs a unit test!
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
135 // Maybe check that the file is in our data directory
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
136 QFile::remove(availableFileName);
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
137 mSettings.remove("List/available");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
138 mSettings.remove("List/availableDate");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
139 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
140 } else {
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
141 // Make sure the available notation is also removed
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
142 mSettings.remove("List/available");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
143 mSettings.remove("List/availableDate");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
144 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
145
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
146 if (!installedFileName.isEmpty()) {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
147 mInstalledList.readList(installedFileName.toLocal8Bit().constData());
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
148 if (!mInstalledList.isValid()) {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
149 // Probably a bug when Qt fileName is encoded and cFileName
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
150 // fails because of this. This needs a unit test!
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
151 // Maybe check that the file is in our data directory
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
152 QFile::remove(installedFileName);
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
153 mSettings.remove("List/installed");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
154 mSettings.remove("List/installedDate");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
155 }
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
156 } else {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
157 mSettings.remove("List/installed");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
158 mSettings.remove("List/installedDate");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
159 }
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
160
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
161 if (!swFileName.isEmpty()) {
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
162 // TODO Verify integrity of the software
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
163 } else {
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
164 mSettings.remove("Software/available");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
165 mSettings.remove("Software/availableDate");
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
166 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
167 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
168
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
169 void MainWindow::handleNewList(const QString& fileName, const QDateTime& modDate) {
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
170 qDebug() << "new list available";
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
171 mSettings.setValue("List/available", fileName);
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
172 mSettings.setValue("List/availableDate", modDate);
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
173
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
174 verifyAvailableData();
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
175 if (!mListToInstall.isValid()) {
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
176 /* Downloader provided invalid files */
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
177 /* TODO: Error count. Error handling. Otherwise
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
178 * we can go into an endless loop here */
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
179
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
180 /* Retry the download again in 10 - 20 minutes */
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
181 QTimer::singleShot(600000 + (qrand() % 60000), this, SLOT(checkUpdates()));
82
1f27d6db5ee3 Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents: 72
diff changeset
182 } else {
1f27d6db5ee3 Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents: 72
diff changeset
183 mCurMessage = tr("An updated certificate list is available. Click here to install.");
1f27d6db5ee3 Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents: 72
diff changeset
184 setState(NewListAvailable);
1f27d6db5ee3 Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents: 72
diff changeset
185 showMessage();
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
186 loadCertificateList();
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
187 }
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
188 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
189
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
190 void MainWindow::handleNewSW(const QString& fileName, const QDateTime& modDate) {
555
4cc378f335f5 Use native path to execute software update on windows
Andre Heinecke <aheinecke@intevation.de>
parents: 554
diff changeset
191 mCurMessage = tr("An update for %1 is available.\n"
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
192 "Click here to download and install the update.").arg(
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
193 QApplication::applicationName());
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
194 setState(NewSoftwareAvailable);
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
195 mSettings.setValue("Software/available", fileName);
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
196 mSettings.setValue("Software/availableDate", modDate);
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
197
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
198 mSettings.sync();
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
199 showMessage();
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
200 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
201
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
202 void MainWindow::installNewSW(const QString& fileName, const QDateTime& modDate) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
203 QFileInfo instProcInfo = QFileInfo(fileName);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
204 if (!instProcInfo.isExecutable()) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
205 qWarning() << "Downloaded file: " << fileName << " is not executable.";
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
206 setState(TransferError);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
207 return;
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
208 }
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
209 QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath());
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
210 #ifdef WIN32
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
211 SHELLEXECUTEINFOW shExecInfo;
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
212 memset (&shExecInfo, 0, sizeof(SHELLEXECUTEINFOW));
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
213 shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
214
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
215 shExecInfo.lpFile = reinterpret_cast<LPCWSTR> (filePath.utf16());
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
216
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
217 shExecInfo.fMask = SEE_MASK_NOASYNC;
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
218
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
219 if (!is_admin()) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
220 shExecInfo.lpVerb = L"open";
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
221 } else {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
222 shExecInfo.lpVerb = L"runas";
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
223 }
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
224
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
225 qDebug() << "Starting process: " << filePath;
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
226
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
227 if (!ShellExecuteExW(&shExecInfo)) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
228 /* Execution failed, maybe the user aborted the UAC check? */
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
229 char* errmsg = getLastErrorMsg();
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
230 QString qerrmsg = QString::fromUtf8(errmsg);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
231 free(errmsg);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
232 qDebug() << "Failed to start process: " << qerrmsg;
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
233 setState(NewSoftwareAvailable);
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
234 return;
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
235 }
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
236 #else /* WIN32 */
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
237 qDebug() << "Starting process " << filePath;
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
238
563
aee3eb10bbba Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents: 555
diff changeset
239 if (!QProcess::startDetached(filePath)) {
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
240 qDebug() << "Failed to start process.";
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
241 return;
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
242 }
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
243 #endif
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
244 /* Installer process should now be running. We exit */
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
245
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
246 closeApp();
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
247 }
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
248
461
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
249 void MainWindow::checkUpdates(bool downloadSW)
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
250 {
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
251 verifyAvailableData();
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
252
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
253 if (!mSettings.contains("Software/installedDate") ||
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
254 mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
255 /* This should only happen on initial startup and after an update has
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
256 * been installed */
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
257 getLastModForCurrentVersion();
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
258 return;
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
259 }
17
c12825a651ed Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents: 16
diff changeset
260 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime();
c12825a651ed Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents: 16
diff changeset
261 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime();
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
262
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
263 QString listResource = QString::fromLatin1(LIST_RESOURCE);
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
264 QString swResource = QString::fromLatin1(SW_RESOURCE);
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
265
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
266 #ifndef RELEASE_BUILD
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
267 /* Use this for testing to specify another file name for updates */
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
268 listResource = mSettings.value("List/resource", listResource).toString();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
269 swResource = mSettings.value("Software/resource", swResource).toString();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
270 #endif
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
271
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
272
72
7e304573ebd1 Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents: 71
diff changeset
273 Downloader* downloader = new Downloader(this,
7e304573ebd1 Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents: 71
diff changeset
274 QString::fromLatin1(SERVER_URL),
7e304573ebd1 Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents: 71
diff changeset
275 QByteArray(),
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
276 swInstalledLastMod,
72
7e304573ebd1 Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents: 71
diff changeset
277 listInstalledLastMod,
437
4b486a14252f Acutally use the values that can be taken from the config
Andre Heinecke <aheinecke@intevation.de>
parents: 434
diff changeset
278 swResource,
461
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
279 listResource,
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
280 downloadSW);
17
c12825a651ed Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents: 16
diff changeset
281
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
282 connect(downloader, SIGNAL(newListAvailable(const QString&, const QDateTime&)),
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
283 this, SLOT(handleNewList(const QString&, const QDateTime&)));
461
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
284 if (!downloadSW) {
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
285 connect(downloader, SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&)),
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
286 this, SLOT(handleNewSW(const QString&, const QDateTime&)));
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
287 } else {
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
288 connect(downloader, SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&)),
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
289 this, SLOT(installNewSW(const QString&, const QDateTime&)));
461
1ce835c40eb7 Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents: 456
diff changeset
290 }
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
291
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
292 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater()));
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
293 connect(downloader, SIGNAL(error(const QString &, SSLConnection::ErrorCode)),
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
294 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode)));
10
fe39d93f1261 Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents: 7
diff changeset
295 downloader->start();
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
296 }
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
297
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
298 void MainWindow::getLastModForCurrentVersion()
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
299 {
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
300 QString softwareVersion = QString::fromLatin1(SW_RESOURCE_VERSION).arg(
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
301 QApplication::applicationVersion());
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
302 qDebug() << softwareVersion;
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
303 QString listResource = QString::fromLatin1(LIST_RESOURCE);
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
304 Downloader* downloader = new Downloader(this,
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
305 QString::fromLatin1(SERVER_URL),
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
306 QByteArray(),
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
307 QDateTime::currentDateTime(),
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
308 QDateTime::currentDateTime(),
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
309 softwareVersion,
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
310 listResource,
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
311 false);
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
312 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater()));
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
313 connect(downloader, SIGNAL(error(const QString &, SSLConnection::ErrorCode)),
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
314 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode)));
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
315 connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)),
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
316 this, SLOT(setLastModifiedSWDate(const QDateTime&)));
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
317
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
318 downloader->start();
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
319 }
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
320
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
321 void MainWindow::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
322 {
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
323 mSettings.beginGroup("Software");
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
324 mSettings.setValue("installedDate", date);
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
325 mSettings.setValue("installedVersion", QApplication::applicationVersion());
486
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
326 mSettings.endGroup();
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
327 checkUpdates();
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
328 }
fa56a9403939 Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents: 481
diff changeset
329
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
330 void MainWindow::downloaderError(const QString &message, SSLConnection::ErrorCode error)
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
331 {
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
332 /* TODO logging and handle error according to a plan */
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
333 mCurMessage = message;
27
62cd56cea09b Start on polarssl Downloader.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 19
diff changeset
334 showMessage();
551
15121735805e Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents: 548
diff changeset
335 setState(TransferError);
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
336 }
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
337
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
338 void MainWindow::createActions()
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
339 {
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
340 mCheckUpdates = new QAction(tr("Check for Updates"), this);
16
225a5ec20dad Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents: 11
diff changeset
341 connect(mCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdates()));
2
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
342 mQuitAction = new QAction(tr("Quit"), this);
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
343 connect(mQuitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
344 }
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
345
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
346 void MainWindow::createTrayIcon()
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
347 {
11
7e2f14c7aba2 Split up downloader component and further implement it
Andre Heinecke <aheinecke@intevation.de>
parents: 10
diff changeset
348 QIcon trayImg(":/img/tray_22.png");
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
349
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
350 mTrayMenu = new QMenu(this);
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
351 mTrayMenu->addAction(mCheckUpdates);
2
cf88cc432b9d Add quit action
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
352 mTrayMenu->addAction(mQuitAction);
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
353
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
354 mTrayIcon = new QSystemTrayIcon(this);
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
355 mTrayIcon->setContextMenu(mTrayMenu);
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
356
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
357 mTrayIcon->setIcon(trayImg);
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
358 setWindowIcon(trayImg);
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
359 mTrayIcon->show();
407
af53c40e74b1 Rename m13ui to TrustBridge
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
360 mTrayIcon->setToolTip(tr("TrustBridge"));
71
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
361
f22a99f7cb69 Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents: 45
diff changeset
362 connect(mTrayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
363 }
155
c0fdb8d336cf Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 82
diff changeset
364
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
365 void MainWindow::createContent()
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
366 {
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
367 // Create a central widget containing the main layout.
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
368 QWidget *base = new QWidget;
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
369
250
1e112cf41e92 Updated the mainwindow layout.
Raimund Renkert <rrenkert@intevation.de>
parents: 249
diff changeset
370 // Layouts and Container
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
371 QVBoxLayout *mainLayout = new QVBoxLayout;
205
a3f542bf38f7 Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 200
diff changeset
372 QHBoxLayout *headerLayout = new QHBoxLayout;
a3f542bf38f7 Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents: 200
diff changeset
373 QVBoxLayout *headerTextLayout = new QVBoxLayout;
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
374 QHBoxLayout *centerLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
375 QVBoxLayout *buttonBarLayout = new QVBoxLayout;
271
1ae15ea73850 Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 267
diff changeset
376 QHBoxLayout *bottomLayout = new QHBoxLayout;
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
377 QHBoxLayout *containerLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
378 QVBoxLayout *updatesPanelLayout = new QVBoxLayout;
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
379
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
380 // The header (icon, about text)
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
381 QImage *logoImage = new QImage(":/img/logo.png");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
382 QLabel *logo = new QLabel;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
383 logo->setBackgroundRole(QPalette::Base);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
384 logo->setPixmap(QPixmap::fromImage(*logoImage));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
385 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
386 QLabel *subTitle = new QLabel("This Software installs and removes Certificates");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
387 headerTextLayout->addWidget(title);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
388 headerTextLayout->addWidget(subTitle);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
389 headerLayout->addWidget(logo);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
390 headerLayout->addLayout(headerTextLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
391 headerLayout->setStretch(0, 0);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
392 headerLayout->setStretch(1, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
393
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
394 // Buttonbar
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
395 mButtonGroup = new QButtonGroup;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
396
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
397 QToolButton *updatesButton = new QToolButton;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
398 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
399 updatesButton->setIcon(QIcon(":/img/view-refresh.png"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
400 updatesButton->setIconSize(QSize(32, 32));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
401 updatesButton->setText(tr("Updates"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
402 updatesButton->setFixedWidth(90);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
403 updatesButton->setFixedHeight(70);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
404 updatesButton->setCheckable(true);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
405 updatesButton->setChecked(true);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
406
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
407 QToolButton *allInstallButton = new QToolButton;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
408 allInstallButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
409 allInstallButton->setIcon(QIcon(":/img/document-encrypt.png"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
410 allInstallButton->setIconSize(QSize(32, 32));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
411 allInstallButton->setText(tr("Trusted\nCertificates"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
412 allInstallButton->setFixedWidth(90);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
413 allInstallButton->setFixedHeight(70);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
414 allInstallButton->setCheckable(true);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
415
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
416 QToolButton *allRemoveButton = new QToolButton;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
417 allRemoveButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
418 allRemoveButton->setIcon(QIcon(":/img/task-attempt.png"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
419 allRemoveButton->setIconSize(QSize(32, 32));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
420 allRemoveButton->setText(tr("Insecure\nCertificates"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
421 allRemoveButton->setFixedWidth(90);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
422 allRemoveButton->setFixedHeight(70);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
423 allRemoveButton->setCheckable(true);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
424
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
425 QToolButton *infoButton = new QToolButton;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
426 infoButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
427 infoButton->setIcon(QIcon(":/img/dialog-information.png"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
428 infoButton->setIconSize(QSize(32, 32));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
429 infoButton->setText(tr("Information"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
430 infoButton->setFixedWidth(90);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
431 infoButton->setFixedHeight(70);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
432 infoButton->setCheckable(true);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
433
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
434 mButtonGroup->addButton(updatesButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
435 mButtonGroup->addButton(allInstallButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
436 mButtonGroup->addButton(allRemoveButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
437 mButtonGroup->addButton(infoButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
438 mButtonGroup->setId(updatesButton, 0);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
439 mButtonGroup->setId(allInstallButton, 1);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
440 mButtonGroup->setId(allRemoveButton, 2);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
441 mButtonGroup->setId(infoButton, 3);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
442
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
443 connect(mButtonGroup, SIGNAL(buttonClicked(int)),
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
444 this, SLOT(togglePages(int)));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
445 buttonBarLayout->addWidget(updatesButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
446 buttonBarLayout->addWidget(allInstallButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
447 buttonBarLayout->addWidget(allRemoveButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
448 buttonBarLayout->insertStretch(3, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
449 buttonBarLayout->addWidget(infoButton);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
450
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
451 //The main panels.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
452 //The updates page.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
453 mUpdatesPanel = new QScrollArea;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
454 mUpdatesWidget = new QWidget;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
455 QHBoxLayout *updatesHeaderLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
456 QVBoxLayout *updatesHeaderTextLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
457 QVBoxLayout *updatesHeaderSettLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
458
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
459 mUpdatesHeader =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
460 new QLabel("<h2>" + tr("Updates (%1/%2)").arg(2).arg(4)+ "</h2>");
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
461 mLastCertUpdate =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
462 new QLabel(tr("Last certificate update: %1").arg("today"));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
463 mLastSWupdate =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
464 new QLabel(tr("Last Software update: %1").arg("today"));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
465 updatesHeaderTextLayout->addWidget(mUpdatesHeader);
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
466 updatesHeaderTextLayout->addWidget(mLastCertUpdate);
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
467 updatesHeaderTextLayout->addWidget(mLastSWupdate);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
468
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
469 QPushButton *searchUpdates = new QPushButton(tr("Search for Updates"));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
470 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates()));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
471 updatesHeaderSettLayout->insertStretch(0, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
472 updatesHeaderSettLayout->addWidget(searchUpdates);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
473 updatesHeaderLayout->addLayout(updatesHeaderTextLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
474 updatesHeaderLayout->insertStretch(1, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
475 updatesHeaderLayout->addLayout(updatesHeaderSettLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
476
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
477 QVBoxLayout *updatesCenterLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
478 QHBoxLayout *updatesNewLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
479 QHBoxLayout *updatesRemoveLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
480 QHBoxLayout *updatesManualLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
481 QLabel *updatesTip =
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
482 new QLabel(tr("The following certificate changes are recommended."));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
483 mUpdatesNewCertificates =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
484 new QLabel("<h3>" +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
485 tr("Install new Certificates (%1/%2)").arg(2).arg(2) +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
486 "</h3>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
487 QPushButton *updatesDetailsNew = new QPushButton(tr("Details"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
488 connect(updatesDetailsNew,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
489 SIGNAL(clicked()),
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
490 this,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
491 SLOT(toggleUpdatesNew()));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
492 updatesNewLayout->addWidget(mUpdatesNewCertificates);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
493 updatesNewLayout->addWidget(updatesDetailsNew);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
494 updatesNewLayout->insertStretch(2, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
495 mUpdatesNew = new CertificateListWidget(this);
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
496 connect(mUpdatesNew, SIGNAL(certListChanged(int)),
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
497 this, SLOT(listChanged(int)));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
498 mUpdatesNew->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
499
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
500 mUpdatesRemoveCertificates =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
501 new QLabel("<h3>" +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
502 tr("Remove insecure Certificates (%1/%2)").arg(2).arg(2) +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
503 "</h3>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
504 QPushButton *updatesDetailsRemove = new QPushButton(tr("Details"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
505 connect(updatesDetailsRemove,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
506 SIGNAL(clicked()),
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
507 this,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
508 SLOT(toggleUpdatesRemove()));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
509 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
510 updatesRemoveLayout->addWidget(updatesDetailsRemove);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
511 updatesRemoveLayout->insertStretch(2, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
512 mUpdatesRemove = new CertificateListWidget(this);
642
dd738ef17715 Update the 'remove untrusted' header on list selection change.
Raimund Renkert <rrenkert@intevation.de>
parents: 641
diff changeset
513 connect(mUpdatesRemove, SIGNAL(certListChanged(int)),
dd738ef17715 Update the 'remove untrusted' header on list selection change.
Raimund Renkert <rrenkert@intevation.de>
parents: 641
diff changeset
514 this, SLOT(listChanged(int)));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
515 mUpdatesRemove->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
516
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
517 mUpdatesManualCertificates =
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
518 new QLabel("<h3>" +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
519 tr("Manualy changed Certificates (%1)").arg(2) +
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
520 "</h3>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
521 QPushButton *updatesDetailsManual = new QPushButton(tr("Details"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
522 connect(updatesDetailsManual,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
523 SIGNAL(clicked()),
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
524 this,
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
525 SLOT(toggleUpdatesManual()));
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
526 updatesManualLayout->addWidget(mUpdatesManualCertificates);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
527 updatesManualLayout->addWidget(updatesDetailsManual);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
528 updatesManualLayout->insertStretch(2, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
529 mUpdatesManual = new CertificateListWidget(this);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
530 mUpdatesManual->hide();
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
531 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)),
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
532 this, SLOT(removeFromManual(bool, const Certificate&)));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
533
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
534 QHBoxLayout *updatesBottomLayout = new QHBoxLayout;
641
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
535 QPushButton *quitButton = new QPushButton(tr("Quit without saving"));
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
536 QPushButton *installButton = new QPushButton(tr("Update"));
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
537 #ifdef Q_OS_WIN
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
538 if (is_admin()) {
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
539 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield);
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
540 installButton->setIcon(uacShield);
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
541 }
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
542 #endif
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
543 connect(quitButton, SIGNAL(clicked()), this, SLOT(closeApp()));
641
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
544 connect(installButton, SIGNAL(clicked()), this, SLOT(installCerts()));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
545 updatesBottomLayout->insertStretch(0, 10);
641
a7c3ab273d41 Some code cleanup.
Raimund Renkert <rrenkert@intevation.de>
parents: 640
diff changeset
546 updatesBottomLayout->addWidget(installButton);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
547 updatesBottomLayout->addWidget(quitButton);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
548 updatesBottomLayout->setAlignment(Qt::AlignBottom);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
549
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
550 updatesNewLayout->setAlignment(Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
551 updatesRemoveLayout->setAlignment(Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
552 updatesManualLayout->setAlignment(Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
553 updatesCenterLayout->addWidget(updatesTip, 0, Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
554 updatesCenterLayout->addLayout(updatesNewLayout);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
555 // updatesCenterLayout->setStretchFactor(updatesNewLayout, 100);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
556 updatesCenterLayout->addWidget(mUpdatesNew, 1, Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
557 updatesCenterLayout->addLayout(updatesRemoveLayout);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
558 // updatesCenterLayout->setStretchFactor(updatesRemoveLayout, 100);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
559 updatesCenterLayout->addWidget(mUpdatesRemove, 1, Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
560 updatesCenterLayout->addLayout(updatesManualLayout);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
561 // updatesCenterLayout->setStretchFactor(updatesManualLayout, 100);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
562 updatesCenterLayout->addWidget(mUpdatesManual, 1, Qt::AlignTop);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
563 updatesCenterLayout->insertStretch(7, 0);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
564 updatesCenterLayout->addLayout(updatesBottomLayout);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
565
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
566
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
567 QFrame *updatesPanelSeparator = new QFrame();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
568 updatesPanelSeparator->setFrameShape(QFrame::HLine);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
569 updatesPanelSeparator->setFrameShadow(QFrame::Sunken);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
570 updatesPanelLayout->addLayout(updatesHeaderLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
571 updatesPanelLayout->addWidget(updatesPanelSeparator);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
572 updatesPanelLayout->addLayout(updatesCenterLayout);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
573 updatesPanelLayout->setStretchFactor(updatesCenterLayout, 1);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
574 //updatesPanelLayout->insertStretch(3, 2);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
575 //updatesPanelLayout->addLayout(updatesBottomLayout);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
576 mUpdatesWidget->setLayout(updatesPanelLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
577 mUpdatesWidget->setMinimumSize(QSize(820, 440));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
578 mUpdatesPanel->setWidget(mUpdatesWidget);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
579
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
580 // Panel for trusted certificates.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
581 mInstallPanel = new QScrollArea;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
582
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
583 QVBoxLayout *installPanelLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
584 QVBoxLayout *installHeaderLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
585 QVBoxLayout *installCenterLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
586
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
587 QLabel *installHeaderLabel =
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
588 new QLabel("<h2>" + tr("Trusted Certificates") + "</h2>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
589 QLabel *installHeaderText = new QLabel(tr("The following list of root"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
590 " certificates was created by the BSI. The BSI vaidates authenticity,"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
591 " security and actuality of these certificates"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
592 installHeaderLayout->addWidget(installHeaderLabel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
593 installHeaderLayout->addWidget(installHeaderText);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
594
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
595 QLabel *installCenterText = new QLabel(tr("Please choose the certificates"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
596 " you want to trust. TrustBridge will install these certificates for"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
597 " secure communication via email or the internet (e.g. IE, Firefox,"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
598 " Thunderbird)"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
599 installCenterLayout->addWidget(installCenterText);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
600 mInstallList = new CertificateListWidget(this);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
601 connect(mInstallList, SIGNAL(certChanged(bool, const Certificate&)),
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
602 this, SLOT(toggleInManual(bool, const Certificate&)));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
603
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
604 installPanelLayout->addLayout(installHeaderLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
605 installPanelLayout->addLayout(installCenterLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
606 installPanelLayout->addWidget(mInstallList);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
607 mInstallPanel->setLayout(installPanelLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
608
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
609 // Panel for insecure certificates.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
610 mRemovePanel = new QScrollArea;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
611 QVBoxLayout *removePanelLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
612 QVBoxLayout *removeHeaderLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
613 QVBoxLayout *removeCenterLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
614
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
615 QLabel *removeHeaderLabel =
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
616 new QLabel("<h2>" + tr("Insecure Certificates") + "</h2>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
617 QLabel *removeHeaderText = new QLabel(tr("The following list of root"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
618 " certificates was created by the BSI. The BSI validates authenticity,"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
619 " security and actuality of these certificates"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
620 removeHeaderLayout->addWidget(removeHeaderLabel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
621 removeHeaderLayout->addWidget(removeHeaderText);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
622
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
623 QLabel *removeCenterText = new QLabel(tr("Please choose the certificates"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
624 " you want to remove. TrustBridge will remove these certificates."));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
625 removeCenterLayout->addWidget(removeCenterText);
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
626 mRemoveList = new CertificateListWidget(this);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
627 connect(mRemoveList, SIGNAL(certChanged(bool, const Certificate&)),
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
628 this, SLOT(toggleInManual(bool, const Certificate&)));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
629
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
630 removePanelLayout->addLayout(removeHeaderLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
631 removePanelLayout->addLayout(removeCenterLayout);
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
632 removePanelLayout->addWidget(mRemoveList);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
633 mRemovePanel->setLayout(removePanelLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
634
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
635 // Info panel.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
636 mInfoPanel = new QScrollArea;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
637
643
f8be956c819b Fixed mainwindow layout warning.
Raimund Renkert <rrenkert@intevation.de>
parents: 642
diff changeset
638 QVBoxLayout *infoPanelLayout = new QVBoxLayout;
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
639 QHBoxLayout *infoHeaderLayout = new QHBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
640 QVBoxLayout *infoHeaderTextLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
641 QVBoxLayout *infoCenterLayout = new QVBoxLayout;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
642
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
643 QImage *infoLogoImage = new QImage(":/img/logo.png");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
644 QLabel *infoLogo = new QLabel;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
645 infoLogo->setBackgroundRole(QPalette::Base);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
646 infoLogo->setPixmap(QPixmap::fromImage(*infoLogoImage));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
647 QLabel *infoTitle = new QLabel("<h1>" + tr("TrustBridge") + "</h1>");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
648 QString infoVersion = tr("Version: ");
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
649 infoVersion.append(QApplication::applicationVersion());
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
650 QLabel *appVersion = new QLabel(infoVersion);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
651 appVersion->setTextInteractionFlags(
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
652 Qt::TextSelectableByMouse |
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
653 Qt::TextSelectableByKeyboard);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
654
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
655 QFrame *infoHeaderSeparator = new QFrame();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
656 infoHeaderSeparator->setFrameShape(QFrame::HLine);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
657 infoHeaderSeparator->setFrameShadow(QFrame::Sunken);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
658
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
659 infoHeaderTextLayout->addWidget(infoTitle);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
660 infoHeaderTextLayout->addWidget(appVersion);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
661 infoHeaderLayout->addWidget(infoLogo);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
662 infoHeaderLayout->addLayout(infoHeaderTextLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
663 infoHeaderLayout->insertStretch(2, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
664
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
665 QLabel *textDesc = new QLabel(tr("TrustBridge is a root certificate"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
666 " installer for Windows and Linux."));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
667 textDesc->setTextInteractionFlags(
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
668 Qt::TextSelectableByMouse |
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
669 Qt::TextSelectableByKeyboard);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
670 QLabel *textManage = new QLabel(tr("The root certificate lists are managed"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
671 " by the German <a href=\"https://www.bsi.bund.de\">"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
672 "Federal Office for Information Security (BSI)</a>.\n\n"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
673 textManage->setTextInteractionFlags(
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
674 Qt::TextBrowserInteraction |
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
675 Qt::TextSelectableByKeyboard);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
676 QLabel *textDevel = new QLabel(tr("The software was developed by the companies"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
677 " <a href=\"http://www.intevation.de\">Intevation GmbH</a> and "
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
678 " <a href=\"http://www.dn-systems.de\">DN-Systems GmbH</a>, <br>"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
679 " contracted by the German Federal Office for Information Security (BSI).\n\n"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
680 textDevel->setTextInteractionFlags(
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
681 Qt::TextBrowserInteraction |
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
682 Qt::TextSelectableByKeyboard);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
683 QLabel *textLicense = new QLabel(tr("TrustBridge is Free Software licensed"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
684 " under GNU GPL v2+.\n\nCopyright (C) 2014 by Bundesamt für Sicherheit"
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
685 " in der Informationstechnik"));
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
686 textLicense->setTextInteractionFlags(
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
687 Qt::TextSelectableByMouse |
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
688 Qt::TextSelectableByKeyboard);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
689
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
690 infoCenterLayout->addWidget(infoHeaderSeparator);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
691 infoCenterLayout->addWidget(textDesc);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
692 infoCenterLayout->addWidget(textManage);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
693 infoCenterLayout->addWidget(textDevel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
694 infoCenterLayout->addWidget(textLicense);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
695 infoCenterLayout->insertSpacing(2, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
696 infoCenterLayout->insertSpacing(4, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
697 infoCenterLayout->insertSpacing(6, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
698 infoCenterLayout->insertStretch(8, 10);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
699
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
700 infoPanelLayout->addLayout(infoHeaderLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
701 infoPanelLayout->addLayout(infoCenterLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
702 mInfoPanel->setLayout(infoPanelLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
703
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
704 // The main layout for pages.
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
705 mInstallPanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
706 mRemovePanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
707 mInfoPanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
708 containerLayout->addWidget(mUpdatesPanel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
709 containerLayout->addWidget(mInstallPanel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
710 containerLayout->addWidget(mRemovePanel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
711 containerLayout->addWidget(mInfoPanel);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
712
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
713 centerLayout->addLayout(buttonBarLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
714 centerLayout->addLayout(containerLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
715
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
716 QFrame *topSeparator = new QFrame();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
717 topSeparator->setFrameShape(QFrame::HLine);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
718 topSeparator->setFrameShadow(QFrame::Sunken);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
719
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
720 mainLayout->addLayout(headerLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
721 mainLayout->addWidget(topSeparator);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
722 mainLayout->addLayout(centerLayout);
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
723 mainLayout->addLayout(bottomLayout);
187
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
724 base->setLayout(mainLayout);
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
725 setCentralWidget(base);
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
726 }
0c06a608e15f Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents: 155
diff changeset
727
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
728 void MainWindow::listChanged(int selected)
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
729 {
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
730 mUpdatesHeader->setText("<h2>" + tr("Updates (%1/%2)")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
731 .arg(mUpdatesRemove->selectedCertCount() + mUpdatesNew->selectedCertCount())
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
732 .arg(mUpdatesRemove->certificates().size() + mUpdatesNew->certificates().size()) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
733 "</h2>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
734 mUpdatesNewCertificates->setText("<h3>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
735 tr("Install new Certificates (%1/%2)")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
736 .arg(mUpdatesNew->selectedCertCount())
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
737 .arg(mUpdatesNew->certificates().size()) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
738 "</h3>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
739 mUpdatesRemoveCertificates->setText("<h3>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
740 tr("Remove insecure Certificates (%1/%2)")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
741 .arg(mUpdatesRemove->selectedCertCount())
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
742 .arg(mUpdatesRemove->certificates().size()) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
743 "</h3>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
744 }
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
745
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
746 void MainWindow::loadCertificateList()
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
747 {
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
748 /* TODO: if nothing is available (neither old nor new) add some progress
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
749 * indication */
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
750 mInstallList->clear();
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
751 mUpdatesNew->clear();
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
752 mRemoveList->clear();
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
753 mUpdatesRemove->clear();
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
754 QList<Certificate> newInstallCerts;
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
755 QList<Certificate> newRemoveCerts;
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
756 QList<Certificate> oldInstallCerts;
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
757 QList<Certificate> oldRemoveCerts;
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
758
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
759 if (mListToInstall.getCertificates().isEmpty()) {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
760 // No new list available, add old certificates.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
761 foreach (const Certificate &cert, mInstalledList.getCertificates()) {
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
762 bool state = !mPreviouslyUnselected.contains(cert.base64Line());
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
763 if (cert.isInstallCert()) {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
764 oldInstallCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
765 mInstallList->addCertificate(cert, state);
267
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
766 }
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
767 else {
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
768 oldRemoveCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
769 mRemoveList->addCertificate(cert, state, !state);
267
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
770 }
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
771 }
456
37a97621b466 Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents: 451
diff changeset
772 // Set the date of the old list.
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
773 // mCurrentListDate->setText(tr("Current List Date: %1")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
774 // .arg(mInstalledList.date().toString()));
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
775 }
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
776 else {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
777 // Sort and filter both lists.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
778 foreach (const Certificate &cert, mListToInstall.getCertificates()) {
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
779 bool state = !mPreviouslyUnselected.contains(cert.base64Line());
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
780 if (cert.isInstallCert()) {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
781 // Certificate with status "install".
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
782 if (mInstalledList.getCertificates().contains(cert)) {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
783 // Was in the old list.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
784 oldInstallCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
785 mInstallList->addCertificate(cert, state);
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
786 }
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
787 else {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
788 // Is a brand new certificate
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
789 newInstallCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
790 mUpdatesNew->addCertificate(cert, state);
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
791 }
267
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
792 }
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
793 else {
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
794 // Certificate with status "remove".
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
795 if (mInstalledList.getCertificates().contains(cert)) {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
796 // Was in the old list.
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
797 oldRemoveCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
798 // Is removed, so set editable to false.
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
799 mRemoveList->addCertificate(cert, state, !state);
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
800 }
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
801 else {
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
802 // Was in the old list with status "install" and now has the
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
803 // status "remove".
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
804 newRemoveCerts.append(cert);
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
805 mUpdatesRemove->addCertificate(cert, state);
445
b3721ded6f5b Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents: 437
diff changeset
806 }
267
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
807 }
89e8783866f8 Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents: 265
diff changeset
808 }
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
809 mUpdatesHeader->setText("<h2>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
810 tr("Updates (%1/%2)")
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
811 .arg(mUpdatesNew->selectedCertCount() + mUpdatesRemove->selectedCertCount())
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
812 .arg(newRemoveCerts.size() + newInstallCerts.size()) + "</h2>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
813 mLastCertUpdate->setText(tr("Last certificate update: %1")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
814 .arg(mInstalledList.date().toString()));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
815 /* mCurrentListDate->setText(tr("Current List Date: %1")
456
37a97621b466 Added label for current and updated list date.
Raimund Renkert <rrenkert@intevation.de>
parents: 451
diff changeset
816 .arg(mInstalledList.date().toString()));
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
817 mNewListDate->setText(tr("New List Date: %1").arg(mListToInstall.date().toString()));*/
189
5f0d45ca9de4 Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents: 187
diff changeset
818 }
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
819 mUpdatesNewCertificates->setText("<h3>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
820 tr("Install new Certificates (%1/%2)")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
821 .arg(mUpdatesNew->selectedCertCount())
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
822 .arg(mUpdatesNew->certificates().size()) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
823 "</h3>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
824
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
825 mUpdatesRemoveCertificates->setText("<h3>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
826 tr("Remove insecure Certificates (%1/%2)")
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
827 .arg(mUpdatesRemove->selectedCertCount())
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
828 .arg(mUpdatesRemove->certificates().size()) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
829 "</h3>");
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
830 mUpdatesManualCertificates->setText("<h3>" +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
831 tr("Manualy changed Certificates (%1)").arg(0) +
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
832 "</h3>");
271
1ae15ea73850 Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 267
diff changeset
833 }
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
834
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
835 void MainWindow::installerError(const QString& errMsg) {
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
836 QMessageBox::warning(this, tr("Error executing update"), errMsg);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
837 }
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
838
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
839 void MainWindow::installerSuccess() {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
840 if (mCurState == NewListAvailable) {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
841 mCurState = NothingChanged;
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
842 mCurMessage = QString();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
843
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
844 QString listFileName = mSettings.value("List/available").toString();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
845 QDateTime listFileDate = mSettings.value("List/availableDate").toDateTime();
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
846
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
847 mSettings.remove("List/available");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
848 mSettings.remove("List/availableDate");
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
849
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
850 if (listFileName.isEmpty() || !listFileDate.isValid()) {
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
851 qWarning() << "Error accessing settings";
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
852 return; /* Try again with next check */
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
853 }
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
854
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
855 mSettings.setValue("List/installed", listFileName);
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
856 mSettings.setValue("List/installedDate", listFileDate);
480
242f2bf5417e Update the certificate list after installing certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 479
diff changeset
857 mInstalledList = mListToInstall;
242f2bf5417e Update the certificate list after installing certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 479
diff changeset
858 mListToInstall = CertificateList();
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
859 }
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
860 loadCertificateList();
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
861 }
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
862
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
863 void MainWindow::installCerts() {
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
864 QStringList choices;
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
865 QStringList unselected;
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
866
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
867 choices << mUpdatesNew->selectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
868 choices << mUpdatesRemove->selectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
869
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
870 choices << mUpdatesManual->selectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
871 QStringList unselectedManuals = mUpdatesManual->unselectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
872 for(int i = 0; i < unselectedManuals.size(); i++) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
873 if (unselectedManuals.at(i).startsWith("I:")) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
874 QString certLine = unselectedManuals.at(i);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
875 certLine[0] = 'R';
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
876 choices << certLine;
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
877 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
878 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
879
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
880 unselected << mUpdatesNew->unselectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
881 unselected << mUpdatesRemove->unselectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
882 unselected << mInstallList->unselectedCertificates();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
883 unselected << mRemoveList->unselectedCertificates();
628
3a9c0f38bbad Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents: 584
diff changeset
884
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
885 QProgressDialog *progress = new QProgressDialog(this);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
886 progress->setWindowModality(Qt::WindowModal);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
887 progress->setLabelText(tr("Installing certificates..."));
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
888 progress->setCancelButton(0);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
889 progress->setRange(0,0);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
890 progress->setMinimumDuration(0);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
891 progress->show();
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
892
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
893 InstallWrapper *instWrap = new InstallWrapper(this,
393
ae2ef965a41b Provide installer with old list in case there are no news
Andre Heinecke <andre.heinecke@intevation.de>
parents: 389
diff changeset
894 mListToInstall.isValid() ?
ae2ef965a41b Provide installer with old list in case there are no news
Andre Heinecke <andre.heinecke@intevation.de>
parents: 389
diff changeset
895 mListToInstall.fileName() :
ae2ef965a41b Provide installer with old list in case there are no news
Andre Heinecke <andre.heinecke@intevation.de>
parents: 389
diff changeset
896 mInstalledList.fileName(),
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
897 choices);
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
898 /* Clean up object and progress dialog */
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
899 connect(instWrap, SIGNAL(finished()), instWrap, SLOT(deleteLater()));
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
900 connect(instWrap, SIGNAL(finished()), progress, SLOT(deleteLater()));
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
901 connect(instWrap, SIGNAL(finished()), progress, SLOT(cancel()));
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
902 connect(instWrap, SIGNAL(installationSuccessful()),
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
903 this, SLOT(installerSuccess()));
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
904 connect(instWrap, SIGNAL(error(const QString &)),
389
3be838c3e4d8 Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 375
diff changeset
905 this, SLOT(installerError(const QString &)));
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
906 instWrap->start();
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
907
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
908 if (!saveUnselectedCertificates(unselected)) {
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
909 qWarning() << "Failed to save previosly unselected certificates.";
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
910 }
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
911
365
75f7288ad67b Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents: 274
diff changeset
912 }
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
913
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
914 void MainWindow::loadUnselectedCertificates()
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
915 {
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
916 mPreviouslyUnselected.clear();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
917 mSettings.beginGroup("unselected");
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
918 QStringList keys = mSettings.allKeys();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
919 foreach (const QString &key, keys) {
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
920 mPreviouslyUnselected << mSettings.value(key, QString()).toString();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
921 }
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
922 mSettings.endGroup();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
923 }
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
924
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
925 bool MainWindow::saveUnselectedCertificates(QStringList unselected)
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
926 {
479
a8d56a2846a8 Fill the internal list of previously unselcted certificates when saving in settings.
Raimund Renkert <rrenkert@intevation.de>
parents: 461
diff changeset
927 mPreviouslyUnselected.clear();
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
928 mSettings.beginGroup("unselected");
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
929 mSettings.remove(""); /* Clears old choices */
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
930 for (int i = 0; i < unselected.size(); i++) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
931 QString key = QString::fromLatin1("cert%1").arg(i);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
932 QString value = unselected.at(i);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
933 mSettings.setValue(key, value);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
934 mPreviouslyUnselected << value;
372
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
935 }
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
936 mSettings.endGroup();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
937 mSettings.sync();
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
938 return mSettings.status() == QSettings::NoError;
6cc124e79066 Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents: 365
diff changeset
939 }
447
b1b14daf2116 Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents: 446
diff changeset
940
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
941 void MainWindow::toggleInManual(bool state, const Certificate &cert)
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
942 {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
943 if (!mUpdatesManual->contains(cert)) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
944 mUpdatesManual->addCertificate(cert, state);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
945 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
946 else {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
947 mUpdatesManual->removeCertificate(cert);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
948 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
949
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
950 mUpdatesManualCertificates->setText("<h3>" +
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
951 tr("Manualy changed Certificates (%1)")
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
952 .arg(mUpdatesManual->certificates().size()) +
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
953 "</h3>");
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
954 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
955
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
956 void MainWindow::removeFromManual(bool state, const Certificate &cert)
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
957 {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
958 mUpdatesManual->removeCertificate(cert);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
959
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
960 mUpdatesManualCertificates->setText("<h3>" +
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
961 tr("Manualy changed Certificates (%1)")
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
962 .arg(mUpdatesManual->certificates().size()) +
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
963 "</h3>");
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
964
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
965 if (cert.isInstallCert()) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
966 mInstallList->setCertState(state, cert);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
967 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
968 else {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
969 mRemoveList->setCertState(state, cert);
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
970 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
971 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
972
447
b1b14daf2116 Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents: 446
diff changeset
973 void MainWindow::closeApp()
b1b14daf2116 Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents: 446
diff changeset
974 {
b1b14daf2116 Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents: 446
diff changeset
975 qApp->quit();
b1b14daf2116 Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents: 446
diff changeset
976 }
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
977
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
978 void MainWindow::togglePages(int button)
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
979 {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
980 mUpdatesPanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
981 mInstallPanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
982 mRemovePanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
983 mInfoPanel->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
984 switch(button) {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
985 case 0: mUpdatesPanel->show(); break;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
986 case 1: mInstallPanel->show(); break;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
987 case 2: mRemovePanel->show(); break;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
988 case 3: mInfoPanel->show(); break;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
989 default: mUpdatesPanel->show(); break;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
990 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
991 return;
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
992 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
993
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
994 void MainWindow::toggleUpdatesNew() {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
995 QSize old = mUpdatesWidget->size();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
996 if (!mUpdatesNew->isVisible()) {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
997 mUpdatesNew->show();
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
998 if (mUpdatesNewSize == 0) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
999 mUpdatesNewSize = mUpdatesNew->height();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1000 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1001 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesNewSize);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1002 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1003 else {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1004 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesNew->height());
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1005 mUpdatesNew->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1006 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1007 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1008
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1009 void MainWindow::toggleUpdatesRemove() {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1010 QSize old = mUpdatesWidget->size();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1011 if (!mUpdatesRemove->isVisible()) {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1012 mUpdatesRemove->show();
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1013 if (mUpdatesRemoveSize == 0) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1014 mUpdatesRemoveSize = mUpdatesRemove->height();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1015 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1016 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesRemoveSize);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1017 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1018 else {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1019 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesRemove->height());
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1020 mUpdatesRemove->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1021 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1022 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1023
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1024 void MainWindow::toggleUpdatesManual() {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1025 QSize old = mUpdatesWidget->size();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1026 if (!mUpdatesManual->isVisible()) {
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1027 mUpdatesManual->show();
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1028 if (mUpdatesManualSize == 0) {
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1029 mUpdatesManualSize = mUpdatesManual->height();
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1030 }
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1031 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesManualSize);
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1032 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1033 else {
640
626507197360 Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents: 628
diff changeset
1034 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesManual->height());
584
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1035 mUpdatesManual->hide();
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1036 }
ebfe1128ee97 Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents: 563
diff changeset
1037 }

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