Mercurial > trustbridge
annotate ui/mainwindow.cpp @ 990:2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 01 Sep 2014 12:04:11 +0200 |
parents | b8ae69bcc540 |
children | 8fb1b912fd8e |
rev | line source |
---|---|
404 | 1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=2) | |
5 * and comes with ABSOLUTELY NO WARRANTY! | |
6 * See LICENSE.txt for details. | |
7 */ | |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 #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 <QAction> |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 #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
|
16 #include <QDir> |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 #include <QMenu> |
2 | 18 #include <QApplication> |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
19 #include <QFile> |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
20 #include <QTimer> |
187
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
21 #include <QHBoxLayout> |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
22 #include <QVBoxLayout> |
709
8f110e6b8295
(UI) Changed update header to GridLayout and moved action buttons to bottom left.
Emanuel Schuetze <emanuel@intevation.de>
parents:
708
diff
changeset
|
23 #include <QGridLayout> |
187
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> |
857
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
31 #include <QStandardPaths> |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
32 #include <QDesktopServices> |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
33 |
609
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
34 #include "certificatelist.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
35 #include "downloader.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
36 #include "helpdialog.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
37 #include "aboutdialog.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
38 #include "separatoritemdelegate.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
39 #include "installwrapper.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
40 #include "util.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
41 #include "logging.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
42 #include "binverify.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
43 #include "processhelp.h" |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
44 #include "processwaitdialog.h" |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
45 #include "trayicon.h" |
956
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
46 #include "proxysettingsdlg.h" |
609
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
47 |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
48 // 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
|
49 // something to say |
548
c84dc8f6d017
Increase nag interval to 70 minutes
Andre Heinecke <aheinecke@intevation.de>
parents:
531
diff
changeset
|
50 #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
|
51 |
714
57bd73145e48
(Issue25) Fix typos change order and add better date formating
Andre Heinecke <andre.heinecke@intevation.de>
parents:
713
diff
changeset
|
52 #define DATETIME_FORMAT "dddd, d.MMMM yyyy HH:mm:ss" |
57bd73145e48
(Issue25) Fix typos change order and add better date formating
Andre Heinecke <andre.heinecke@intevation.de>
parents:
713
diff
changeset
|
53 |
409
09bb19e5e369
Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents:
407
diff
changeset
|
54 #ifndef APPNAME |
09bb19e5e369
Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents:
407
diff
changeset
|
55 #define APPNAME "TrustBridge" |
09bb19e5e369
Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents:
407
diff
changeset
|
56 #endif |
09bb19e5e369
Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents:
407
diff
changeset
|
57 |
09bb19e5e369
Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents:
407
diff
changeset
|
58 #define SERVER_URL "https://files.intevation.de:443" |
72
7e304573ebd1
Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents:
71
diff
changeset
|
59 |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
60 #if defined(_X86_) || defined(__i386__) |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
61 #define TB_ARCH_STRING "-i386" |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
62 #else |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
63 #define TB_ARCH_STRING "-amd64" |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
64 #endif |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
65 |
900
95e1b2dd9f0e
Deactivate release urls again
Andre Heinecke <andre.heinecke@intevation.de>
parents:
898
diff
changeset
|
66 #ifdef RELEASE_BUILD |
607
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
67 # define LIST_RESOURCE "/users/aheinecke/zertifikatsliste.txt" |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
68 # ifdef Q_OS_WIN |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
69 # define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.exe" |
664
911b94a475e0
Fix SW_Resource defines for linux
Andre Heinecke <andre.heinecke@intevation.de>
parents:
663
diff
changeset
|
70 # define SW_RESOURCE "/users/aheinecke/TrustBridge.exe" |
607
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
71 # else |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
72 # define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1" TB_ARCH_STRING ".sh" |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
73 # define SW_RESOURCE "/users/aheinecke/TrustBridge" TB_ARCH_STRING ".sh" |
607
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
74 # endif |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
75 #else // RELEASE_BUILD |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
76 # define LIST_RESOURCE "/users/aheinecke/development/zertifikatsliste.txt" |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
77 # ifdef Q_OS_WIN |
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
78 # define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development.exe" |
664
911b94a475e0
Fix SW_Resource defines for linux
Andre Heinecke <andre.heinecke@intevation.de>
parents:
663
diff
changeset
|
79 # define SW_RESOURCE "/users/aheinecke/development/TrustBridge.exe" |
607
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
80 # else |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
81 # define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development" TB_ARCH_STRING ".sh" |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
82 # define SW_RESOURCE "/users/aheinecke/development/TrustBridge" TB_ARCH_STRING ".sh" |
607
e83589f1fd7f
Use different URI's for development
Andre Heinecke <andre.heinecke@intevation.de>
parents:
594
diff
changeset
|
83 # endif |
486
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
84 #endif |
7
992c0ec57660
Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
2
diff
changeset
|
85 |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
86 /* Help installation path the path relative to the installation directory where |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
87 * the help is placed.*/ |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
88 #ifdef WIN32 |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
89 #define HELP_PATH "/doc/index.html" |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
90 #else |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
91 #define HELP_PATH "/../share/doc/trustbridge/index.html" |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
92 #endif |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
93 |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
94 MainWindow::MainWindow(bool trayMode): |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
95 mTrayMode(trayMode) |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
96 { |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
97 createActions(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
98 createTrayIcon(); |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
99 setupGUI(); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
100 resize(900, 600); |
709
8f110e6b8295
(UI) Changed update header to GridLayout and moved action buttons to bottom left.
Emanuel Schuetze <emanuel@intevation.de>
parents:
708
diff
changeset
|
101 setMinimumWidth(760); |
45
c6125d73faf4
Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents:
31
diff
changeset
|
102 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
|
103 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
|
104 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
105 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
|
106 this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
107 |
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
108 mMessageTimer = new QTimer(this); |
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
109 connect(mMessageTimer, SIGNAL(timeout()), this, SLOT(showMessage())); |
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
110 mMessageTimer->setInterval(NAG_INTERVAL_MINUTES * 60 * 1000); |
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
111 mMessageTimer->start(); |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
112 checkUpdates(); |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
113 loadUnselectedCertificates(); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
114 loadCertificateList(); |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
115 if (!trayMode) { |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
116 show(); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
117 } |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
118 } |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
119 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
120 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
|
121 { |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
122 switch (reason) { |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
123 case QSystemTrayIcon::Trigger: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
124 case QSystemTrayIcon::MiddleClick: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
125 showMessage(); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
126 break; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
127 case QSystemTrayIcon::DoubleClick: |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
128 show(); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
129 break; |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
130 default: |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
131 ; |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
132 } |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
133 } |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
134 |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
135 void MainWindow::messageClicked() |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
136 { |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
137 if (mCurState == NewSoftwareAvailable) { |
893
b61d5a289d8f
Hide after selecting to install the update
Andre Heinecke <andre.heinecke@intevation.de>
parents:
885
diff
changeset
|
138 hide(); |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
139 verifySWData(); |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
140 QString swFileName = mSettings.value("Software/available").toString(); |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
141 if (swFileName.isEmpty()) { |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
142 checkUpdates(true); |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
143 mCurState = DownloadingSW; |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
144 return; |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
145 } |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
146 installNewSW(swFileName, |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
147 mSettings.value("Software/availableDate").toDateTime()); |
965
013ca910589a
Open main window in case of error message.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
964
diff
changeset
|
148 } else { |
013ca910589a
Open main window in case of error message.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
964
diff
changeset
|
149 show(); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
150 } |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
151 } |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
152 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
153 void MainWindow::showMessage() |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
154 { |
591
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
155 if (mCurMessage.isEmpty()) { |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
156 return; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
157 } |
961
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
158 |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
159 if (!mTrayIcon->isVisible() && !mTrayIcon->isAlternative()) { |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
160 mTrayIcon->show(); |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
161 /* When the message is shown before the tray icon is fully visble |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
162 * and becoming visible may be delayed on some desktop environments |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
163 * the message will pop up somehere on the screen and not over |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
164 * the trayicon. So we delay here.*/ |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
165 QTimer::singleShot(2000, this, SLOT(showMessage())); |
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
166 } else if (mCurState == NewSoftwareAvailable || !isVisible()) { |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
167 mTrayIcon->showMessage(QApplication::applicationName(), mCurMessage, |
591
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
168 QSystemTrayIcon::Information, 10000); |
19
9af6198deb8e
Add timed trigger for the message
Andre Heinecke <aheinecke@intevation.de>
parents:
17
diff
changeset
|
169 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
|
170 } |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
171 } |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
172 |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
173 void MainWindow::verifyListData() |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
174 { |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
175 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
|
176 QString installedFileName = mSettings.value("List/installed").toString(); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
177 if (!availableFileName.isEmpty()) { |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
178 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
|
179 if (!mListToInstall.isValid()) { |
82
1f27d6db5ee3
Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents:
72
diff
changeset
|
180 mCurState = TransferError; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
181 // 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
|
182 // 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
|
183 // 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
|
184 QFile::remove(availableFileName); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
185 mSettings.remove("List/available"); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
186 mSettings.remove("List/availableDate"); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
187 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
188 } else { |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
189 // 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
|
190 mSettings.remove("List/available"); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
191 mSettings.remove("List/availableDate"); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
192 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
193 |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
194 if (!installedFileName.isEmpty()) { |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
195 mInstalledList.readList(installedFileName.toLocal8Bit().constData()); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
196 if (!mInstalledList.isValid()) { |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
197 // 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
|
198 // 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
|
199 // 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
|
200 QFile::remove(installedFileName); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
201 mSettings.remove("List/installed"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
202 mSettings.remove("List/installedDate"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
203 } |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
204 } else { |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
205 mSettings.remove("List/installed"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
206 mSettings.remove("List/installedDate"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
207 } |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
208 } |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
209 |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
210 void MainWindow::verifySWData() |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
211 { |
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
212 QString swFileName = mSettings.value("Software/available").toString(); |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
213 |
591
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
214 if (swFileName.isEmpty()) { |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
215 mSettings.remove("Software/availableDate"); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
216 return; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
217 } |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
218 |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
219 QFileInfo fi(swFileName); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
220 if (!fi.exists()) { |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
221 mSettings.remove("Software/available"); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
222 mSettings.remove("Software/availableDate"); |
591
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
223 qDebug() << "Software does not yet exist."; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
224 return; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
225 } |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
226 if (!fi.isExecutable()) { |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
227 qWarning() << "Downloaded file: " << swFileName << " is not executable."; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
228 QFile::remove(swFileName); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
229 mSettings.remove("Software/available"); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
230 mSettings.remove("Software/availableDate"); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
231 return; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
232 } |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
233 bin_verify_result verifyResult = verify_binary(swFileName.toUtf8().constData(), |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
234 swFileName.toUtf8().size()); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
235 qDebug() << "Binary verify result: " << verifyResult; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
236 if (verifyResult != VerifyValid) { |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
237 qDebug() << "Failed to verify downloaded data."; |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
238 QFile::remove(swFileName); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
239 mSettings.remove("Software/available"); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
240 mSettings.remove("Software/availableDate"); |
26a18e3c3db4
Cleanups and coding style.
Andre Heinecke <aheinecke@intevation.de>
parents:
587
diff
changeset
|
241 return; |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
242 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
243 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
244 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
245 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
|
246 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
|
247 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
|
248 mSettings.setValue("List/availableDate", modDate); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
249 |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
250 verifyListData(); |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
251 if (!mListToInstall.isValid()) { |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
252 /* 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
|
253 /* 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
|
254 * 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
|
255 |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
256 /* 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
|
257 QTimer::singleShot(600000 + (qrand() % 60000), this, SLOT(checkUpdates())); |
82
1f27d6db5ee3
Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents:
72
diff
changeset
|
258 } else { |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
259 if (mTrayIcon->isAlternative()) { |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
260 mCurMessage = tr("An updated certificate list is available."); |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
261 } else { |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
262 mCurMessage = tr("An updated certificate list is available.") +" " + tr("Click here to install."); |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
263 } |
82
1f27d6db5ee3
Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents:
72
diff
changeset
|
264 setState(NewListAvailable); |
1f27d6db5ee3
Polarssl based certificate handling
Andre Heinecke <aheinecke@intevation.de>
parents:
72
diff
changeset
|
265 showMessage(); |
189
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
266 loadCertificateList(); |
71
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
267 } |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
268 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
269 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
270 void MainWindow::handleNewSW(const QString& fileName, const QDateTime& modDate) { |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
271 if (mTrayIcon->isAlternative()) { |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
272 mCurMessage = tr("An update for %1 is available.").arg( |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
273 QApplication::applicationName()); |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
274 } else { |
904
f89b41fa7048
Fix whitespace errors
Andre Heinecke <andre.heinecke@intevation.de>
parents:
900
diff
changeset
|
275 mCurMessage = QString(tr("An update for %1 is available.") + "\n" + |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
276 tr("Click here to download and install the update.")).arg( |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
277 QApplication::applicationName()); |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
278 } |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
279 setState(NewSoftwareAvailable); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
280 mSettings.setValue("Software/available", fileName); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
281 mSettings.setValue("Software/availableDate", modDate); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
282 |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
283 mSettings.sync(); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
284 showMessage(); |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
285 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
286 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
287 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
|
288 QFileInfo instProcInfo = QFileInfo(fileName); |
563
aee3eb10bbba
Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents:
555
diff
changeset
|
289 QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath()); |
592
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
290 |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
291 if (verify_binary(filePath.toUtf8().constData(), |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
292 filePath.toUtf8().size()) != VerifyValid) { |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
293 qDebug() << "Invalid software. Not installing"; |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
294 return; |
592
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
295 } |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
296 QFileInfo fi(QCoreApplication::applicationFilePath()); |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
297 QDir installDir = fi.absoluteDir(); |
778f74d0706f
Verify the binary directly without relying on settings (which might differ)
Andre Heinecke <aheinecke@intevation.de>
parents:
591
diff
changeset
|
298 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
299 #ifdef WIN32 |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
300 QString parameters = QString::fromLatin1("/S /UPDATE=1 /D=") + |
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
301 installDir.path().replace("/", "\\") + ""; |
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
302 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
303 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
|
304 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
|
305 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
|
306 |
aee3eb10bbba
Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents:
555
diff
changeset
|
307 shExecInfo.lpFile = reinterpret_cast<LPCWSTR> (filePath.utf16()); |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
308 shExecInfo.lpParameters = reinterpret_cast<LPCWSTR> (parameters.utf16()); |
563
aee3eb10bbba
Add unit test for sw update execution and fix shell execute params
Andre Heinecke <aheinecke@intevation.de>
parents:
555
diff
changeset
|
309 |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
310 // shExecInfo.fMask = SEE_MASK_NOASYNC; |
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
311 shExecInfo.nShow = SW_SHOWDEFAULT; |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
312 |
841
216a65d7fc4b
(issue66) Implement is_system_install and use it
Andre Heinecke <andre.heinecke@intevation.de>
parents:
838
diff
changeset
|
313 if (!is_system_install() || !is_admin()) { |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
314 shExecInfo.lpVerb = L"open"; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
315 } else { |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
316 shExecInfo.lpVerb = L"runas"; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
317 } |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
318 |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
319 qDebug() << "Starting process: " << filePath |
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
320 << " with arguments: " << parameters; |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
321 |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
322 if (!ShellExecuteExW(&shExecInfo)) { |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
323 /* 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
|
324 char* errmsg = getLastErrorMsg(); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
325 QString qerrmsg = QString::fromUtf8(errmsg); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
326 free(errmsg); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
327 qDebug() << "Failed to start process: " << qerrmsg; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
328 setState(NewSoftwareAvailable); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
329 return; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
330 } |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
331 #else /* WIN32 */ |
894
2e7fff9d195a
Update in the real prefix
Andre Heinecke <andre.heinecke@intevation.de>
parents:
893
diff
changeset
|
332 /* On linux installDir is <prefix>/bin */ |
594
c944de9900de
Add installation parameters with correct quoting
Andre Heinecke <aheinecke@intevation.de>
parents:
592
diff
changeset
|
333 QStringList parameters; |
894
2e7fff9d195a
Update in the real prefix
Andre Heinecke <andre.heinecke@intevation.de>
parents:
893
diff
changeset
|
334 installDir.cdUp(); |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
335 parameters << "--prefix" << installDir.path(); |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
336 bool sudo_started = false; |
841
216a65d7fc4b
(issue66) Implement is_system_install and use it
Andre Heinecke <andre.heinecke@intevation.de>
parents:
838
diff
changeset
|
337 bool use_sudo = is_admin() && is_system_install(); |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
338 if (use_sudo) { |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
339 QStringList sudoPrograms; |
987
b8ae69bcc540
Use pkexec instead of gksudo.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
970
diff
changeset
|
340 sudoPrograms << "pkexec" << "kdesudo" << "sudo"; |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
341 QStringList sudoParams; |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
342 sudoParams << filePath + " " + parameters.join(" "); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
343 |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
344 foreach (const QString &sProg, sudoPrograms) { |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
345 qDebug() << "Starting process " << sProg <<" params: " << sudoParams; |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
346 if (!QProcess::startDetached(sProg, sudoParams)) { |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
347 continue; |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
348 } else { |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
349 sudo_started = true; |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
350 break; |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
351 } |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
352 } |
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
353 } |
894
2e7fff9d195a
Update in the real prefix
Andre Heinecke <andre.heinecke@intevation.de>
parents:
893
diff
changeset
|
354 qDebug() << "Starting process " << filePath <<" params: " << parameters; |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
355 if (!sudo_started && !QProcess::startDetached(filePath, parameters)) { |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
356 qDebug() << "Failed to start process."; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
357 return; |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
358 } |
810
ee75e236843c
Use sudo to install software in case of is_admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
807
diff
changeset
|
359 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
360 #endif |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
361 /* Installer process should now be running. We exit */ |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
362 |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
363 closeApp(); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
364 } |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
365 |
461
1ce835c40eb7
Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents:
456
diff
changeset
|
366 void MainWindow::checkUpdates(bool downloadSW) |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
367 { |
587
02a89710a7cd
Split up list and software verification and use it
Andre Heinecke <aheinecke@intevation.de>
parents:
563
diff
changeset
|
368 verifyListData(); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
369 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
370 if (!mSettings.contains("Software/installedDate") || |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
371 mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) { |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
372 /* 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
|
373 * been installed */ |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
374 getLastModForCurrentVersion(); |
486
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
375 return; |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
376 } |
17
c12825a651ed
Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents:
16
diff
changeset
|
377 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
|
378 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
|
379 |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
380 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
|
381 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
|
382 |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
383 #ifndef RELEASE_BUILD |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
384 /* 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
|
385 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
|
386 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
|
387 #endif |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
388 |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
389 |
72
7e304573ebd1
Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents:
71
diff
changeset
|
390 Downloader* downloader = new Downloader(this, |
7e304573ebd1
Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents:
71
diff
changeset
|
391 QString::fromLatin1(SERVER_URL), |
7e304573ebd1
Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents:
71
diff
changeset
|
392 QByteArray(), |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
393 swInstalledLastMod, |
72
7e304573ebd1
Add some testing hacks for interactive testing
Andre Heinecke <aheinecke@intevation.de>
parents:
71
diff
changeset
|
394 listInstalledLastMod, |
437
4b486a14252f
Acutally use the values that can be taken from the config
Andre Heinecke <aheinecke@intevation.de>
parents:
434
diff
changeset
|
395 swResource, |
461
1ce835c40eb7
Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents:
456
diff
changeset
|
396 listResource, |
1ce835c40eb7
Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents:
456
diff
changeset
|
397 downloadSW); |
17
c12825a651ed
Read out content-length and use this to skip existing files
Andre Heinecke <aheinecke@intevation.de>
parents:
16
diff
changeset
|
398 |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
399 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
|
400 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
|
401 if (!downloadSW) { |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
402 setState(BeforeDownload); |
461
1ce835c40eb7
Ask the user if software updates should be installed.
Raimund Renkert <rrenkert@intevation.de>
parents:
456
diff
changeset
|
403 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
|
404 this, SLOT(handleNewSW(const QString&, const QDateTime&))); |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
405 } else { |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
406 setState(DownloadingSW); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
407 connect(downloader, SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&)), |
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
408 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
|
409 } |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
410 |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
411 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater())); |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
412 connect(downloader, SIGNAL(finished()), this, SLOT(updateCheckSuccess())); |
45
c6125d73faf4
Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents:
31
diff
changeset
|
413 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
|
414 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode))); |
10
fe39d93f1261
Start on Downloader component
Andre Heinecke <aheinecke@intevation.de>
parents:
7
diff
changeset
|
415 downloader->start(); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
416 } |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
417 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
418 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
|
419 { |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
420 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
|
421 QApplication::applicationVersion()); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
422 qDebug() << softwareVersion; |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
423 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
|
424 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
|
425 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
|
426 QByteArray(), |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
427 QDateTime::currentDateTime(), |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
428 QDateTime::currentDateTime(), |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
429 softwareVersion, |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
430 listResource, |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
431 false); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
432 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
|
433 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
|
434 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
|
435 connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)), |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
436 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
|
437 |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
438 downloader->start(); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
439 } |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
440 |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
441 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
|
442 { |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
443 mSettings.beginGroup("Software"); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
444 mSettings.setValue("installedDate", date); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
445 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
|
446 mSettings.endGroup(); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
447 checkUpdates(); |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
448 } |
fa56a9403939
Lookup the last modified date for software installer after first installation.
Raimund Renkert <rrenkert@intevation.de>
parents:
481
diff
changeset
|
449 |
45
c6125d73faf4
Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents:
31
diff
changeset
|
450 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
|
451 { |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
452 /* TODO logging and handle error according to a plan */ |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
453 syslog_error_printf ("Failed to check for updates: %s", message.toUtf8().constData()); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
454 mCurMessage = message; |
961
423e31ac656e
Delay the tray icon after the download
Andre Heinecke <andre.heinecke@intevation.de>
parents:
956
diff
changeset
|
455 mTrayIcon->show(); |
27
62cd56cea09b
Start on polarssl Downloader.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
19
diff
changeset
|
456 showMessage(); |
551
15121735805e
Start implementation of software update installation
Andre Heinecke <aheinecke@intevation.de>
parents:
548
diff
changeset
|
457 setState(TransferError); |
16
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
458 } |
225a5ec20dad
Use QSettings and manage downloader from mainwindow.
Andre Heinecke <aheinecke@intevation.de>
parents:
11
diff
changeset
|
459 |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
460 void MainWindow::createActions() |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
461 { |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
462 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
|
463 connect(mCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdates())); |
2 | 464 mQuitAction = new QAction(tr("Quit"), this); |
465 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
|
466 } |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
467 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
468 void MainWindow::createTrayIcon() |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
469 { |
11
7e2f14c7aba2
Split up downloader component and further implement it
Andre Heinecke <aheinecke@intevation.de>
parents:
10
diff
changeset
|
470 QIcon trayImg(":/img/tray_22.png"); |
970
c80777457133
(issue50) Add window icon and icon for 48x48px
Andre Heinecke <andre.heinecke@intevation.de>
parents:
966
diff
changeset
|
471 trayImg.addFile(":/img/tray_48.png", QSize(48,48)); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
472 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
473 mTrayMenu = new QMenu(this); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
474 mTrayMenu->addAction(mCheckUpdates); |
2 | 475 mTrayMenu->addAction(mQuitAction); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
476 |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
857
diff
changeset
|
477 mTrayIcon = new TrayIcon(this); |
0
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
478 mTrayIcon->setContextMenu(mTrayMenu); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
479 |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
480 mTrayIcon->setIcon(trayImg); |
cb0cde2c5eb9
Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
481 setWindowIcon(trayImg); |
407
af53c40e74b1
Rename m13ui to TrustBridge
Andre Heinecke <aheinecke@intevation.de>
parents:
404
diff
changeset
|
482 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
|
483 |
f22a99f7cb69
Add certificatelist to install as member. Look for updates on startup
Andre Heinecke <aheinecke@intevation.de>
parents:
45
diff
changeset
|
484 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
|
485 } |
155
c0fdb8d336cf
Added menubar/menu and method stubs to mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
82
diff
changeset
|
486 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
487 QWidget * MainWindow::createInfoWidget() |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
488 { |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
489 QWidget *theWidget = new QWidget; |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
490 QVBoxLayout *infoPanelLayout = new QVBoxLayout; |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
491 QHBoxLayout *infoHeaderLayout = new QHBoxLayout; |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
492 QVBoxLayout *infoHeaderTextLayout = new QVBoxLayout; |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
493 QVBoxLayout *infoCenterLayout = new QVBoxLayout; |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
494 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
495 QString infoVersion = tr("Version: "); |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
496 infoVersion.append(QApplication::applicationVersion()); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
497 QLabel *appVersion = new QLabel(infoVersion); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
498 appVersion->setTextInteractionFlags( |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
499 Qt::TextSelectableByMouse | |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
500 Qt::TextSelectableByKeyboard); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
501 |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
502 QFrame *infoHeaderSeparator = new QFrame(); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
503 infoHeaderSeparator->setFrameShape(QFrame::HLine); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
504 infoHeaderSeparator->setFrameShadow(QFrame::Sunken); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
505 |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
506 infoHeaderTextLayout->addWidget(appVersion); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
507 infoHeaderLayout->addLayout(infoHeaderTextLayout); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
508 infoHeaderLayout->insertStretch(2, 10); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
509 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
510 QLabel *textDesc = new QLabel(tr("TrustBridge is a root certificate" |
807
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
511 " installer for Windows and GNU/Linux.<br/>") + |
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
512 tr("The root certificate lists are managed" |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
513 " by the German <a href=\"https://www.bsi.bund.de\">" |
807
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
514 "Federal Office for Information Security (BSI)</a>.<br/><br/>") + |
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
515 tr("The software was developed by the companies" |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
516 " <a href=\"http://www.intevation.de\">Intevation GmbH</a> and " |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
517 " <a href=\"http://www.dn-systems.de\">DN-Systems GmbH</a>, <br>" |
807
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
518 " contracted by the German Federal Office for Information Security (BSI).<br/><br/>") + |
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
519 tr("TrustBridge is Free Software licensed" |
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
520 " under GNU GPL v2+.<br/><br/>Copyright (C) 2014 by Bundesamt für Sicherheit" |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
521 " in der Informationstechnik")); |
807
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
522 textDesc->setTextFormat(Qt::RichText); |
1e18d4c1932a
Unify about dialog labels and Remove Trustbridge header
Andre Heinecke <andre.heinecke@intevation.de>
parents:
805
diff
changeset
|
523 textDesc->setTextInteractionFlags( |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
524 Qt::TextSelectableByMouse | |
844
fa68e5aeeaac
Make links clickable and also change the about info in mainwindow.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
842
diff
changeset
|
525 Qt::TextSelectableByKeyboard | |
fa68e5aeeaac
Make links clickable and also change the about info in mainwindow.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
842
diff
changeset
|
526 Qt::LinksAccessibleByMouse); |
fa68e5aeeaac
Make links clickable and also change the about info in mainwindow.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
842
diff
changeset
|
527 textDesc->setOpenExternalLinks(true); |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
528 |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
529 infoCenterLayout->addWidget(infoHeaderSeparator); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
530 infoCenterLayout->addWidget(textDesc); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
531 infoCenterLayout->insertSpacing(2, 10); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
532 infoCenterLayout->insertSpacing(4, 10); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
533 infoCenterLayout->insertSpacing(6, 10); |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
534 |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
535 QHBoxLayout *helpButtonLayout = new QHBoxLayout(); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
536 QPushButton *helpButton = new QPushButton(tr("Show Help")); |
964
706405a2f3e8
(issue89) Add help icon to help button
Andre Heinecke <andre.heinecke@intevation.de>
parents:
962
diff
changeset
|
537 helpButton->setIcon(QIcon(":/img/show-help_16.png")); |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
538 connect(helpButton, SIGNAL(clicked()), this, SLOT(showHelp())); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
539 helpButtonLayout->addWidget(helpButton); |
956
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
540 #ifdef USE_CURL |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
541 QPushButton *proxySettingsButton = new QPushButton(tr("Proxy settings")); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
542 proxySettingsButton->setIcon(QIcon(":/img/preferences-network_16.png")); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
543 connect(proxySettingsButton, SIGNAL(clicked()), this, SLOT(showProxySettings())); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
544 helpButtonLayout->addWidget(proxySettingsButton); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
545 #endif |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
546 helpButtonLayout->addStretch(); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
547 infoCenterLayout->addLayout(helpButtonLayout); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
548 |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
549 infoCenterLayout->insertStretch(8, 10); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
550 |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
551 infoPanelLayout->addLayout(infoHeaderLayout); |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
552 infoPanelLayout->addLayout(infoCenterLayout); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
553 theWidget->setLayout(infoPanelLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
554 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
555 return theWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
556 } |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
557 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
558 QWidget * MainWindow::createUpdatesWidget() |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
559 { |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
560 QWidget * theWidget = new QWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
561 QVBoxLayout *updatesMainLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
562 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
563 /* The header */ |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
564 QGridLayout *updatesHeaderLayout = new QGridLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
565 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
566 /* Header 1: Update date and search button */ |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
567 QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout; |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
568 mUpdatesHeader = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
569 new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>"); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
570 mLastCertUpdate = |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
571 new QLabel(tr("Installed certificates from:")); |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
572 mLastCertUpdateContents = new QLabel(QString()); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
573 mLastCertUpdate->hide(); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
574 mLastCertUpdateContents->hide(); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
575 mSoftwareVersionLabel = |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
576 new QLabel(tr("TrustBridge Version:")); |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
577 mSoftwareVersionContents = new QLabel(QApplication::applicationVersion()); |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
578 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
579 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
580 if (lastCheck.isValid()) { |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
581 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
582 mLastUpdateCheck = |
781
60d3f59f0803
Fix typos in translatable strings.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
754
diff
changeset
|
583 new QLabel(tr("Last successful update check:")); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
584 mLastUpdateCheckContents = new QLabel(lastUpdateCheck); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
585 } else { |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
586 mLastUpdateCheck = new QLabel(tr("Last successful update check:")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
587 mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
588 } |
842
bd33c6585cd0
UI improvements (issue18, 60)
Emanuel Schuetze <emanuel@intevation.de>
parents:
841
diff
changeset
|
589 QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); |
bd33c6585cd0
UI improvements (issue18, 60)
Emanuel Schuetze <emanuel@intevation.de>
parents:
841
diff
changeset
|
590 searchUpdates->setFixedHeight(22); |
802 | 591 searchUpdates->setToolTip(tr("Check for Updates")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
592 searchUpdates->setStyleSheet("font-size: 10px;"); |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
593 searchUpdates->setIcon(QIcon(":/img/update-list.png")); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
594 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
595 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); |
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
596 updateDateAndSearchButton->addWidget(searchUpdates); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
597 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
598 // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment]) |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
599 updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
600 updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
601 updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
602 updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1); |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
603 updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1); |
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
604 // updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
605 updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
606 updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1); |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
607 updatesHeaderLayout->setColumnStretch(3, 1); |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
608 |
787
07cc0aabf782
(issue60) Make update list button less prominent and icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
783
diff
changeset
|
609 // updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
610 updatesHeaderLayout->setRowMinimumHeight(4, 15); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
611 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
612 /* Header 2: Action text and buttons */ |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
613 mUpdatesTip = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
614 new QLabel(tr("There are currently no changes for your certificate stores.")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
615 mUpdatesTip->setWordWrap(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
616 QHBoxLayout *updatesHeaderActionButtonLayout = new QHBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
617 mQuitButton = new QPushButton(" " + tr("Quit without saving")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
618 mQuitButton->setIcon(QIcon(":/img/application-exit.png")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
619 mQuitButton->setFixedHeight(30); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
620 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
621 mInstallButton = new QPushButton(" " + tr("Install certificates again")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
622 mInstallButton->setFixedHeight(30); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
623 #ifdef Q_OS_WIN |
841
216a65d7fc4b
(issue66) Implement is_system_install and use it
Andre Heinecke <andre.heinecke@intevation.de>
parents:
838
diff
changeset
|
624 if (is_admin() && is_system_install()) { |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
625 QIcon uacShield = QApplication::style()->standardIcon(QStyle::SP_VistaShield); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
626 mInstallButton->setIcon(uacShield); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
627 } |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
628 #else |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
629 mInstallButton->setIcon(QIcon(":/img/view-refresh_16px.png")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
630 #endif |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
631 connect(mQuitButton, SIGNAL(clicked()), this, SLOT(closeApp())); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
632 connect(mInstallButton, SIGNAL(clicked()), this, SLOT(checkAndInstallCerts())); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
633 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
634 // addWidget(*Widget, row, column, rowspan, colspan) |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
635 updatesHeaderLayout->addWidget(mUpdatesTip, 5, 0, 1, 4); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
636 updatesHeaderActionButtonLayout->addWidget(mInstallButton); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
637 updatesHeaderActionButtonLayout->addWidget(mQuitButton); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
638 updatesHeaderLayout->addLayout(updatesHeaderActionButtonLayout, 6, 0, 1, -1, Qt::AlignRight); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
639 updatesHeaderLayout->setRowMinimumHeight(7, 10); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
640 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
641 /* The central panels. */ |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
642 QScrollArea *centralScrollArea = new QScrollArea; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
643 QVBoxLayout *updatesCenterLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
644 QHBoxLayout *updatesNewLayout = new QHBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
645 QHBoxLayout *updatesRemoveLayout = new QHBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
646 QHBoxLayout *updatesManualLayout = new QHBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
647 mUpdatesNewCertificates = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
648 new QLabel("<h3>" + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
649 tr("Install new trusted certificates (%1/%2)").arg(0).arg(0) + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
650 "</h3>"); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
651 mUpdatesDetailsNew = new QPushButton(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
652 mUpdatesDetailsNew->setText(" " + tr("Details")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
653 mUpdatesDetailsNew->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
654 mUpdatesDetailsNew->setStyleSheet("font-size: 10px;"); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
655 mUpdatesDetailsNew->setFixedHeight(22); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
656 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png")); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
657 connect(mUpdatesDetailsNew, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
658 SIGNAL(clicked()), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
659 this, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
660 SLOT(toggleUpdatesNew())); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
661 updatesNewLayout->addWidget(mUpdatesNewCertificates); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
662 updatesNewLayout->addWidget(mUpdatesDetailsNew); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
663 updatesNewLayout->addStretch(1); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
664 mUpdatesNew = new CertificateListWidget(this); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
665 connect(mUpdatesNew, SIGNAL(certListChanged(int)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
666 this, SLOT(listChanged(int))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
667 mUpdatesNew->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
668 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
669 mUpdatesRemoveCertificates = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
670 new QLabel("<h3>" + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
671 tr("Remove revoked certificates (%1/%2)").arg(0).arg(0) + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
672 "</h3>"); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
673 mUpdatesDetailsRemove = new QPushButton(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
674 mUpdatesDetailsRemove->setText(" " + tr("Details")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
675 mUpdatesDetailsRemove->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
676 mUpdatesDetailsRemove->setStyleSheet("font-size: 10px;"); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
677 mUpdatesDetailsRemove->setFixedHeight(22); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
678 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png")); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
679 connect(mUpdatesDetailsRemove, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
680 SIGNAL(clicked()), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
681 this, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
682 SLOT(toggleUpdatesRemove())); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
683 updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
684 updatesRemoveLayout->addWidget(mUpdatesDetailsRemove); |
746
d73f4e58d117
Add strecht also between remove button
Andre Heinecke <andre.heinecke@intevation.de>
parents:
743
diff
changeset
|
685 updatesRemoveLayout->addStretch(1); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
686 mUpdatesRemove = new CertificateListWidget(this); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
687 connect(mUpdatesRemove, SIGNAL(certListChanged(int)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
688 this, SLOT(listChanged(int))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
689 mUpdatesRemove->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
690 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
691 mUpdatesManualCertificates = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
692 new QLabel("<h3>" + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
693 tr("Manually changed certificates (%1)").arg(0) + |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
694 "</h3>"); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
695 mUpdatesDetailsManual = new QPushButton(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
696 mUpdatesDetailsManual->setText(" " + tr("Details")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
697 mUpdatesDetailsManual->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
698 mUpdatesDetailsManual->setStyleSheet("font-size: 10px;"); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
699 mUpdatesDetailsManual->setFixedHeight(22); |
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
700 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png")); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
701 connect(mUpdatesDetailsManual, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
702 SIGNAL(clicked()), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
703 this, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
704 SLOT(toggleUpdatesManual())); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
705 mUpdatesDetailsManual->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
706 mUpdatesManualCertificates->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
707 updatesManualLayout->addWidget(mUpdatesManualCertificates); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
708 updatesManualLayout->addWidget(mUpdatesDetailsManual); |
747
b959304d6ecf
Also space away the manual details button
Andre Heinecke <andre.heinecke@intevation.de>
parents:
746
diff
changeset
|
709 updatesManualLayout->addStretch(1); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
710 mUpdatesManual = new CertificateListWidget(this); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
711 mUpdatesManual->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
712 connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
713 this, SLOT(removeFromManual(bool, const Certificate&))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
714 connect(mUpdatesManual, SIGNAL(certListChanged(int)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
715 this, SLOT(listChanged(int))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
716 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
717 updatesNewLayout->setAlignment(Qt::AlignTop); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
718 updatesRemoveLayout->setAlignment(Qt::AlignTop); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
719 updatesManualLayout->setAlignment(Qt::AlignTop); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
720 updatesCenterLayout->addLayout(updatesNewLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
721 updatesCenterLayout->addWidget(mUpdatesNew); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
722 updatesCenterLayout->addLayout(updatesRemoveLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
723 updatesCenterLayout->addWidget(mUpdatesRemove); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
724 updatesCenterLayout->addLayout(updatesManualLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
725 updatesCenterLayout->addWidget(mUpdatesManual); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
726 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
727 QWidget *dummyWidget = new QWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
728 dummyWidget->setLayout(updatesCenterLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
729 centralScrollArea->setWidgetResizable(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
730 centralScrollArea->setWidget(dummyWidget); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
731 centralScrollArea->setFrameShape(QFrame::NoFrame); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
732 centralScrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
733 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
734 updatesMainLayout->addLayout(updatesHeaderLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
735 updatesMainLayout->addWidget(centralScrollArea); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
736 updatesCenterLayout->addSpacerItem(new QSpacerItem(0, 0, |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
737 QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
738 theWidget->setLayout(updatesMainLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
739 return theWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
740 } |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
741 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
742 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
743 QWidget *MainWindow::createInstallWidget() |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
744 { |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
745 QWidget *theWidget = new QWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
746 QScrollArea *scrollArea = new QScrollArea; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
747 QVBoxLayout *installPanelLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
748 QVBoxLayout *installHeaderLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
749 QVBoxLayout *installCenterLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
750 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
751 QLabel *installHeaderLabel = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
752 new QLabel("<h2>" + tr("Trusted certificates") + "</h2>"); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
753 QLabel *installHeaderText = new QLabel(tr("The following list of trusted root" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
754 " certificates is managed by the BSI. The BSI validates independently the" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
755 " authenticity, security and actuality of these certificates.")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
756 installHeaderText->setWordWrap(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
757 installHeaderLayout->addWidget(installHeaderLabel); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
758 installHeaderLayout->addWidget(installHeaderText); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
759 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
760 QLabel *installCenterText = new QLabel(tr("Please choose the certificates" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
761 " you want to trust or untrust. TrustBridge will install these certificates for your" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
762 " secure communication for email and internet.")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
763 installCenterText->setWordWrap(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
764 installCenterLayout->addWidget(installCenterText); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
765 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
766 installPanelLayout->addLayout(installHeaderLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
767 installPanelLayout->addLayout(installCenterLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
768 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
769 mInstallList = new CertificateListWidget(this); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
770 connect(mInstallList, SIGNAL(certChanged(bool, const Certificate&)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
771 this, SLOT(toggleInManual(bool, const Certificate&))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
772 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
773 scrollArea->setWidgetResizable(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
774 scrollArea->setWidget(mInstallList); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
775 scrollArea->setFrameShape(QFrame::NoFrame); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
776 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
777 installPanelLayout->addWidget(scrollArea); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
778 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
779 theWidget->setLayout(installPanelLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
780 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
781 return theWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
782 } |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
783 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
784 QWidget *MainWindow::createRemoveWidget() |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
785 { |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
786 QWidget * theWidget = new QWidget; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
787 QScrollArea *scrollArea = new QScrollArea; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
788 QVBoxLayout *removePanelLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
789 QVBoxLayout *removeHeaderLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
790 QVBoxLayout *removeCenterLayout = new QVBoxLayout; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
791 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
792 QLabel *removeHeaderLabel = |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
793 new QLabel("<h2>" + tr("Revoked certificates") + "</h2>"); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
794 QLabel *removeHeaderText = new QLabel(tr("Certificates can be corrupted" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
795 " or stolen and misused in many ways. Therefore the BSI recommends" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
796 " to remove all revoked certificates from your system.")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
797 removeHeaderText->setWordWrap(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
798 removeHeaderLayout->addWidget(removeHeaderLabel); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
799 removeHeaderLayout->addWidget(removeHeaderText); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
800 |
805 | 801 QLabel *removeCenterText = new QLabel(tr("The following unsecure certificates were" |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
802 " revoked by the BSI. Already uninstalled certificates cannot be reinstalled." |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
803 " It is recommended that you select all certificates to uninstall if you still" |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
804 " have revoked certificates installed.")); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
805 removeCenterText->setWordWrap(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
806 removeCenterLayout->addWidget(removeCenterText); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
807 mRemoveList = new CertificateListWidget(this); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
808 connect(mRemoveList, SIGNAL(certChanged(bool, const Certificate&)), |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
809 this, SLOT(toggleInManual(bool, const Certificate&))); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
810 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
811 removePanelLayout->addLayout(removeHeaderLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
812 removePanelLayout->addLayout(removeCenterLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
813 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
814 scrollArea->setWidgetResizable(true); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
815 scrollArea->setWidget(mRemoveList); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
816 scrollArea->setFrameShape(QFrame::NoFrame); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
817 removePanelLayout->addWidget(scrollArea); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
818 theWidget->setLayout(removePanelLayout); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
819 |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
820 return theWidget; |
739
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
821 } |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
822 |
5f0fca113ff4
Factor out Info Panel creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
732
diff
changeset
|
823 void MainWindow::setupGUI() |
187
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
824 { |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
825 // Create a central widget containing the main layout. |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
826 QWidget *base = new QWidget; |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
827 |
250
1e112cf41e92
Updated the mainwindow layout.
Raimund Renkert <rrenkert@intevation.de>
parents:
249
diff
changeset
|
828 // Layouts and Container |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
829 QVBoxLayout *mainLayout = new QVBoxLayout; |
205
a3f542bf38f7
Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
200
diff
changeset
|
830 QHBoxLayout *headerLayout = new QHBoxLayout; |
a3f542bf38f7
Added header for mainwindow.
Raimund Renkert <rrenkert@intevation.de>
parents:
200
diff
changeset
|
831 QVBoxLayout *headerTextLayout = new QVBoxLayout; |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
832 QHBoxLayout *centerLayout = new QHBoxLayout; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
833 QVBoxLayout *buttonBarLayout = new QVBoxLayout; |
271
1ae15ea73850
Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents:
267
diff
changeset
|
834 QHBoxLayout *bottomLayout = new QHBoxLayout; |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
835 QHBoxLayout *containerLayout = new QHBoxLayout; |
187
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
836 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
837 // The header (icon, about text) |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
838 QImage *logoImage = new QImage(":/img/logo.png"); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
839 QLabel *logo = new QLabel; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
840 logo->setBackgroundRole(QPalette::Base); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
841 logo->setPixmap(QPixmap::fromImage(*logoImage)); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
842 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>"); |
689
6df31cb47d54
Updated translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
687
diff
changeset
|
843 QLabel *subTitle = new QLabel(tr("Trust in your digital communication")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
844 headerTextLayout->addWidget(title); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
845 headerTextLayout->addWidget(subTitle); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
846 headerLayout->addWidget(logo); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
847 headerLayout->addLayout(headerTextLayout); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
848 headerLayout->setStretch(0, 0); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
849 headerLayout->setStretch(1, 10); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
850 |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
851 /*********************************** |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
852 * The Buttonbar on the left side. |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
853 ***********************************/ |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
854 mButtonGroup = new QButtonGroup; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
855 |
722
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
856 TextOverlayButton *updatesButton = new TextOverlayButton; |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
857 updatesButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
932
57371f2e8dae
(issue72) Set background image as pixmap in textoverlayicon
Andre Heinecke <andre.heinecke@intevation.de>
parents:
926
diff
changeset
|
858 updatesButton->setBackgroundIcon(":/img/red-circle.png"); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
859 updatesButton->setIcon(QIcon(":/img/view-refresh.png")); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
860 updatesButton->setIconSize(QSize(48, 48)); |
713
cdf8a924e480
(UI) Increase apply/quit button height. Updated translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
709
diff
changeset
|
861 updatesButton->setText(tr("Updates")); |
663
b00c26fbc695
(UI) linebreak and bigger buttons for German translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
661
diff
changeset
|
862 updatesButton->setFixedWidth(120); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
863 updatesButton->setFixedHeight(90); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
864 updatesButton->setCheckable(true); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
865 updatesButton->setChecked(true); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
866 |
722
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
867 connect(this, SIGNAL(changesChanged(const QString&)), |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
868 updatesButton, SLOT(setOverlay(const QString&))); |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
869 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
870 QToolButton *allInstallButton = new QToolButton; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
871 allInstallButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
872 allInstallButton->setIcon(QIcon(":/img/document-encrypt.png")); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
873 allInstallButton->setIconSize(QSize(48, 48)); |
659
c7405d526ead
(UI) Updated English strings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
657
diff
changeset
|
874 allInstallButton->setText(tr("Trusted\ncertificates")); |
663
b00c26fbc695
(UI) linebreak and bigger buttons for German translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
661
diff
changeset
|
875 allInstallButton->setFixedWidth(120); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
876 allInstallButton->setFixedHeight(90); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
877 allInstallButton->setCheckable(true); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
878 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
879 QToolButton *allRemoveButton = new QToolButton; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
880 allRemoveButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
673
e8bc1215904e
(UI) Changed some icons.
Emanuel Schuetze <emanuel@intevation.de>
parents:
669
diff
changeset
|
881 allRemoveButton->setIcon(QIcon(":/img/dialog-warning.png")); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
882 allRemoveButton->setIconSize(QSize(48, 48)); |
661
320a64d58e62
(UI) Updated English strings. Removed Issuer fields.
Emanuel Schuetze <emanuel@intevation.de>
parents:
659
diff
changeset
|
883 allRemoveButton->setText(tr("Revoked\ncertificates")); |
663
b00c26fbc695
(UI) linebreak and bigger buttons for German translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
661
diff
changeset
|
884 allRemoveButton->setFixedWidth(120); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
885 allRemoveButton->setFixedHeight(90); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
886 allRemoveButton->setCheckable(true); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
887 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
888 QToolButton *infoButton = new QToolButton; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
889 infoButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
890 infoButton->setIcon(QIcon(":/img/dialog-information.png")); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
891 infoButton->setIconSize(QSize(48, 48)); |
659
c7405d526ead
(UI) Updated English strings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
657
diff
changeset
|
892 infoButton->setText(tr("Information\nand help")); |
663
b00c26fbc695
(UI) linebreak and bigger buttons for German translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
661
diff
changeset
|
893 infoButton->setFixedWidth(120); |
732
d39b5b65366e
(UI) Updated png icons in correct sizes.
Emanuel Schuetze <emanuel@intevation.de>
parents:
722
diff
changeset
|
894 infoButton->setFixedHeight(90); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
895 infoButton->setCheckable(true); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
896 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
897 mButtonGroup->addButton(updatesButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
898 mButtonGroup->addButton(allInstallButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
899 mButtonGroup->addButton(allRemoveButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
900 mButtonGroup->addButton(infoButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
901 mButtonGroup->setId(updatesButton, 0); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
902 mButtonGroup->setId(allInstallButton, 1); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
903 mButtonGroup->setId(allRemoveButton, 2); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
904 mButtonGroup->setId(infoButton, 3); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
905 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
906 connect(mButtonGroup, SIGNAL(buttonClicked(int)), |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
907 this, SLOT(togglePages(int))); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
908 buttonBarLayout->addWidget(updatesButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
909 buttonBarLayout->addWidget(allInstallButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
910 buttonBarLayout->addWidget(allRemoveButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
911 buttonBarLayout->insertStretch(3, 10); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
912 buttonBarLayout->addWidget(infoButton); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
913 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
914 /* The main pages.*/ |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
915 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
916 /* The updates page. */ |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
917 mUpdatesWidget = createUpdatesWidget(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
918 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
919 /* Install (trusted certs) Page */ |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
920 mInstallWidget = createInstallWidget(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
921 |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
922 /********************************** |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
923 * Page for certificates to be removed. |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
924 **********************************/ |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
925 mRemoveWidget = createRemoveWidget(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
926 |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
927 /********************************** |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
928 * The info page. |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
929 **********************************/ |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
930 mInfoWidget = createInfoWidget(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
931 |
652
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
932 /******************************** |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
933 * The main layout for pages. |
f65503c1833b
Updated mainwindow layout and removed obsolete code.
Raimund Renkert <rrenkert@intevation.de>
parents:
643
diff
changeset
|
934 ********************************/ |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
935 mInstallWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
936 mRemoveWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
937 mInfoWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
938 containerLayout->addWidget(mUpdatesWidget); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
939 containerLayout->addWidget(mInstallWidget); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
940 containerLayout->addWidget(mRemoveWidget); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
941 containerLayout->addWidget(mInfoWidget); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
942 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
943 centerLayout->addLayout(buttonBarLayout); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
944 centerLayout->addLayout(containerLayout); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
945 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
946 mainLayout->addLayout(headerLayout); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
947 mainLayout->addLayout(centerLayout); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
948 mainLayout->addLayout(bottomLayout); |
187
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
949 base->setLayout(mainLayout); |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
950 setCentralWidget(base); |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
951 } |
0c06a608e15f
Create the mainwindow content.
Raimund Renkert <rrenkert@intevation.de>
parents:
155
diff
changeset
|
952 |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
953 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
|
954 { |
716
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
955 Q_UNUSED (selected); |
722
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
956 setChangeCount(mUpdatesRemove->selectedCertCount() + |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
957 mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size()); |
696
55f78c4166fb
(Issue32) Change Updates to Changes and track changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
694
diff
changeset
|
958 |
718
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
959 /* Show a different tip in case of manual changes, updates aviailable, updates and manual |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
960 * changes available */ |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
961 if (changeCount() && !mUpdatesManual->certificates().size()) { |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
962 mUpdatesTip->setText( |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
963 tr("You should apply the following, recommended changes to your certificate stores.")); |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
964 } else if (changeCount()) { |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
965 mUpdatesTip->setText( |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
966 tr("You can apply the following, changes to your certificate stores.")); |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
967 } else { |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
968 mUpdatesTip->setText( |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
969 tr("There are currently no changes for your certificate stores.")); |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
970 } |
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
971 |
716
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
972 if (!changeCount()) { |
693
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
692
diff
changeset
|
973 /* No changes */ |
702
9dea3d895f53
(Issue22) Add a space between button icon and text.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
696
diff
changeset
|
974 mQuitButton->setText(" " + tr("Quit")); |
696
55f78c4166fb
(Issue32) Change Updates to Changes and track changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
694
diff
changeset
|
975 mUpdatesHeader->setText("<h2>" + tr("Certificates unchanged") + |
55f78c4166fb
(Issue32) Change Updates to Changes and track changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
694
diff
changeset
|
976 "</h2>"); |
718
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
977 mInstallButton->setText(" " + tr("Install certificates again")); |
693
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
692
diff
changeset
|
978 } else { |
702
9dea3d895f53
(Issue22) Add a space between button icon and text.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
696
diff
changeset
|
979 mQuitButton->setText(" " + tr("Quit without saving")); |
713
cdf8a924e480
(UI) Increase apply/quit button height. Updated translations.
Emanuel Schuetze <emanuel@intevation.de>
parents:
709
diff
changeset
|
980 mUpdatesHeader->setText("<h2>" + tr("Changes to certificate stores (%1)") |
716
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
981 .arg(changeCount()) + |
696
55f78c4166fb
(Issue32) Change Updates to Changes and track changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
694
diff
changeset
|
982 "</h2>"); |
718
e7a070e64b80
(Issue26) Make updates tip and install button depend on changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
717
diff
changeset
|
983 mInstallButton->setText(" " + tr("Apply changes")); |
693
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
692
diff
changeset
|
984 } |
0fc1a20adaff
(Issue 27) Change Quit button text depending on changes or no changes.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
692
diff
changeset
|
985 |
719
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
986 if (mUpdatesManual->certificates().size()) { |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
987 mUpdatesDetailsManual->show(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
988 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
989 mUpdatesDetailsManual->setToolTip(tr("Show details")); |
719
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
990 mUpdatesManualCertificates->show(); |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
991 } else { |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
992 mUpdatesDetailsManual->hide(); |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
993 mUpdatesManualCertificates->hide(); |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
994 mUpdatesManual->hide(); |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
995 } |
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
996 |
717
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
997 if (mUpdatesNew->certificates().size()) { |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
998 mUpdatesNewCertificates->setText("<h3>" + |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
999 tr("Install new trusted certificates (%1/%2)") |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1000 .arg(mUpdatesNew->selectedCertCount()) |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1001 .arg(mUpdatesNew->certificates().size()) + |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1002 "</h3>"); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1003 mUpdatesDetailsNew->show(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1004 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1005 mUpdatesDetailsNew->setToolTip(tr("Show details")); |
717
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1006 mUpdatesNewCertificates->show(); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1007 } else { |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1008 mUpdatesDetailsNew->hide(); |
719
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
1009 mUpdatesNew->hide(); |
717
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1010 mUpdatesNewCertificates->hide(); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1011 } |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1012 |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1013 if (mUpdatesRemove->certificates().size()) { |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1014 mUpdatesRemoveCertificates->setText("<h3>" + |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1015 tr("Remove revoked certificates (%1/%2)") |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1016 .arg(mUpdatesRemove->selectedCertCount()) |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1017 .arg(mUpdatesRemove->certificates().size()) + |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1018 "</h3>"); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1019 mUpdatesRemoveCertificates->show(); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1020 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png")); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1021 mUpdatesDetailsRemove->setToolTip(tr("Show details")); |
717
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1022 mUpdatesDetailsRemove->show(); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1023 } else { |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1024 mUpdatesRemoveCertificates->hide(); |
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1025 mUpdatesDetailsRemove->hide(); |
719
49bf73b5c7de
(Issue34) Show / hide details area depending on available changes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
718
diff
changeset
|
1026 mUpdatesRemove->hide(); |
717
77c9c2dfc8ac
(Issue26) Hide update lists if no updates are available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
716
diff
changeset
|
1027 } |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1028 } |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1029 |
189
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
1030 void MainWindow::loadCertificateList() |
5f0d45ca9de4
Show certificates in the list view and details in the textfield.
Raimund Renkert <rrenkert@intevation.de>
parents:
187
diff
changeset
|
1031 { |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1032 /* 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
|
1033 * indication */ |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1034 mInstallList->clear(); |
684
69def231f5ac
(issue28) clear manual updates after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
673
diff
changeset
|
1035 mRemoveList->clear(); |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1036 mUpdatesNew->clear(); |
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1037 mUpdatesRemove->clear(); |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1038 QList<Certificate> newInstallCerts; |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1039 QList<Certificate> newRemoveCerts; |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1040 QList<Certificate> oldInstallCerts; |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1041 QList<Certificate> oldRemoveCerts; |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1042 |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1043 if (mListToInstall.getCertificates().isEmpty()) { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1044 // 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
|
1045 foreach (const Certificate &cert, mInstalledList.getCertificates()) { |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1046 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
|
1047 if (cert.isInstallCert()) { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1048 oldInstallCerts.append(cert); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1049 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
|
1050 } |
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1051 else { |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1052 oldRemoveCerts.append(cert); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1053 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
|
1054 } |
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1055 } |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1056 } |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1057 else { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1058 // 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
|
1059 foreach (const Certificate &cert, mListToInstall.getCertificates()) { |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1060 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
|
1061 if (cert.isInstallCert()) { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1062 // Certificate with status "install". |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1063 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
|
1064 // 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
|
1065 oldInstallCerts.append(cert); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1066 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
|
1067 } |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1068 else { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1069 // 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
|
1070 newInstallCerts.append(cert); |
687
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
684
diff
changeset
|
1071 mUpdatesNew->addCertificate(cert, state, true, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
684
diff
changeset
|
1072 tr("install"), tr("ignore")); |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1073 } |
267
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1074 } |
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1075 else { |
445
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1076 // Certificate with status "remove". |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1077 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
|
1078 // 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
|
1079 oldRemoveCerts.append(cert); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1080 // Is removed, so set editable to false. |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1081 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
|
1082 } |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1083 else { |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1084 // 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
|
1085 // status "remove". |
b3721ded6f5b
Sort and filter the certificate list, changed certificate item roles.
Raimund Renkert <rrenkert@intevation.de>
parents:
437
diff
changeset
|
1086 newRemoveCerts.append(cert); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1087 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
|
1088 } |
267
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1089 } |
89e8783866f8
Use the certificate item delegate in the mainwind list view.
Raimund Renkert <rrenkert@intevation.de>
parents:
265
diff
changeset
|
1090 } |
691
315103410002
(Issue 32) Move updates header text generation out of update avialable block
Andre Heinecke <andre.heinecke@intevation.de>
parents:
690
diff
changeset
|
1091 } |
692
3791a277f00b
Remove code duplication and calculate headers only in listchanged
Andre Heinecke <andre.heinecke@intevation.de>
parents:
691
diff
changeset
|
1092 |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1093 if (mInstalledList.date().isValid()) { |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
1094 mLastCertUpdateContents->setText(QLocale::system().toString(mInstalledList.date().toLocalTime(), |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
1095 DATETIME_FORMAT)); |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1096 mLastCertUpdate->show(); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
1097 mLastCertUpdateContents->show(); |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1098 } |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1099 mUpdatesManualCertificates->setText("<h3>" + |
659
c7405d526ead
(UI) Updated English strings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
657
diff
changeset
|
1100 tr("Manually changed certificates (%1)").arg(0) + |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1101 "</h3>"); |
692
3791a277f00b
Remove code duplication and calculate headers only in listchanged
Andre Heinecke <andre.heinecke@intevation.de>
parents:
691
diff
changeset
|
1102 listChanged(0); |
271
1ae15ea73850
Some GUI desing and layout changes.
Raimund Renkert <rrenkert@intevation.de>
parents:
267
diff
changeset
|
1103 } |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1104 |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1105 void MainWindow::installerError(const QString& errMsg) { |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1106 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
|
1107 } |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1108 |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1109 void MainWindow::installerSuccess() { |
819
a2e891b13e68
(issue67) also register list installation if software update is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
812
diff
changeset
|
1110 if (mCurState == NewListAvailable || mCurState == NewSoftwareAvailable) { |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1111 mCurState = NothingChanged; |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1112 mCurMessage = QString(); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1113 |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1114 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
|
1115 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
|
1116 |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1117 mSettings.remove("List/available"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1118 mSettings.remove("List/availableDate"); |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1119 |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1120 if (listFileName.isEmpty() || !listFileDate.isValid()) { |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1121 qWarning() << "Error accessing settings"; |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1122 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
|
1123 } |
857
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1124 /* Rename the installed list to list-installed.txt so that external |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1125 * programs (like the uninstaller can easily recognize it). */ |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1126 QString dataLoc = |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1127 QStandardPaths::writableLocation(QStandardPaths::DataLocation); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1128 QDir dataDir(dataLoc); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1129 if (!dataDir.exists()) { |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1130 /* Should not happen */ |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1131 qWarning() << "Data dir removed."; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1132 return; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1133 } |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1134 |
857
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1135 QFileInfo oldList (dataDir.absoluteFilePath("list-installed.txt")); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1136 if (oldList.exists()) { |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1137 qDebug() << "Removing old list: " << oldList.filePath(); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1138 if (!QFile::remove(oldList.filePath())) { |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1139 qWarning() << "Removal of old list failed."; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1140 return; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1141 } |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1142 } |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1143 QFile newList(listFileName); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1144 if (!newList.rename(oldList.filePath())) { |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1145 qWarning() << "Failed to rename new list."; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1146 return; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1147 } |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1148 |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1149 mSettings.setValue("List/installed", oldList.filePath()); |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1150 mSettings.setValue("List/installedDate", listFileDate); |
857
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1151 mInstalledList = CertificateList(oldList.filePath().toUtf8().constData()); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1152 if (!mInstalledList.isValid()) { |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1153 /* Something went wrong. Go back to square one. */ |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1154 qWarning () << "List corrupted after installation"; |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1155 mInstalledList = CertificateList(); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1156 QFile::remove(oldList.filePath()); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1157 mSettings.remove("List/installed"); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1158 mSettings.remove("List/installedDate"); |
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1159 } |
480
242f2bf5417e
Update the certificate list after installing certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
479
diff
changeset
|
1160 mListToInstall = CertificateList(); |
857
9bab4fc3a1fe
Delete old lists and rename the currently installed list to list-installed.txt
Andre Heinecke <andre.heinecke@intevation.de>
parents:
845
diff
changeset
|
1161 |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1162 } |
684
69def231f5ac
(issue28) clear manual updates after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
673
diff
changeset
|
1163 mUpdatesManual->clear(); |
628
3a9c0f38bbad
Made certificate lists member of mainwindow and added some temporary debug msgs.
Raimund Renkert <rrenkert@intevation.de>
parents:
584
diff
changeset
|
1164 loadCertificateList(); |
389
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1165 } |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1166 |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1167 void MainWindow::installCerts() { |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1168 QStringList choices; |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1169 QStringList unselected; |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1170 |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1171 choices << mUpdatesNew->selectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1172 choices << mUpdatesRemove->selectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1173 |
669
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1174 choices << mUpdatesManual->selectedCertificates(); |
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1175 |
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1176 /* Also include the old certificates */ |
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1177 choices << mInstallList->selectedCertificates(); |
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1178 choices << mRemoveList->selectedCertificates(); |
7147550ee15d
Always include previous certificates in choices for the installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
664
diff
changeset
|
1179 |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1180 QStringList unselectedManuals = mUpdatesManual->unselectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1181 for(int i = 0; i < unselectedManuals.size(); i++) { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1182 if (unselectedManuals.at(i).startsWith("I:")) { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1183 QString certLine = unselectedManuals.at(i); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1184 certLine[0] = 'R'; |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1185 choices << certLine; |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1186 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1187 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1188 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1189 unselected << mUpdatesNew->unselectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1190 unselected << mUpdatesRemove->unselectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1191 unselected << mInstallList->unselectedCertificates(); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1192 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
|
1193 |
918
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1194 #ifdef Q_OS_WIN |
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1195 if (!is_admin() || !is_system_install()) { |
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1196 QMessageBox::information(this, |
926
ca997bc0f790
(issue63) Updated message box text for normal user.
Emanuel Schuetze <emanuel@intevation.de>
parents:
918
diff
changeset
|
1197 tr("Installation with standard user account"), |
ca997bc0f790
(issue63) Updated message box text for normal user.
Emanuel Schuetze <emanuel@intevation.de>
parents:
918
diff
changeset
|
1198 tr("Windows will now ask you to confirm qeach root certificate modification " |
ca997bc0f790
(issue63) Updated message box text for normal user.
Emanuel Schuetze <emanuel@intevation.de>
parents:
918
diff
changeset
|
1199 "because TrustBridge does not have the necessary privileges to install " |
ca997bc0f790
(issue63) Updated message box text for normal user.
Emanuel Schuetze <emanuel@intevation.de>
parents:
918
diff
changeset
|
1200 "root certificates into the Windows certificate store silently.")); |
918
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1201 } |
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1202 #endif |
e5fd2d0cf42f
(issue63) Add warning message when installation is not as admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
904
diff
changeset
|
1203 |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1204 QProgressDialog *progress = new QProgressDialog(this); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1205 progress->setWindowModality(Qt::WindowModal); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1206 progress->setLabelText(tr("Installing certificates...")); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1207 progress->setCancelButton(0); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1208 progress->setRange(0,0); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1209 progress->setMinimumDuration(0); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1210 progress->show(); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1211 |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1212 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
|
1213 mListToInstall.isValid() ? |
ae2ef965a41b
Provide installer with old list in case there are no news
Andre Heinecke <andre.heinecke@intevation.de>
parents:
389
diff
changeset
|
1214 mListToInstall.fileName() : |
ae2ef965a41b
Provide installer with old list in case there are no news
Andre Heinecke <andre.heinecke@intevation.de>
parents:
389
diff
changeset
|
1215 mInstalledList.fileName(), |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1216 choices); |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1217 /* Clean up object and progress dialog */ |
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1218 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
|
1219 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
|
1220 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
|
1221 connect(instWrap, SIGNAL(installationSuccessful()), |
3be838c3e4d8
Handle installation success. Save / load last installed list.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
375
diff
changeset
|
1222 this, SLOT(installerSuccess())); |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1223 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
|
1224 this, SLOT(installerError(const QString &))); |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1225 instWrap->start(); |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1226 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1227 if (!saveUnselectedCertificates(unselected)) { |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1228 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
|
1229 } |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1230 |
365
75f7288ad67b
Switch from listupdatedialog to installwrapper. Minor UI improvements
Andre Heinecke <aheinecke@intevation.de>
parents:
274
diff
changeset
|
1231 } |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1232 |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1233 void MainWindow::loadUnselectedCertificates() |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1234 { |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1235 mPreviouslyUnselected.clear(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1236 mSettings.beginGroup("unselected"); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1237 QStringList keys = mSettings.allKeys(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1238 foreach (const QString &key, keys) { |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1239 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
|
1240 } |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1241 mSettings.endGroup(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1242 } |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1243 |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1244 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
|
1245 { |
479
a8d56a2846a8
Fill the internal list of previously unselcted certificates when saving in settings.
Raimund Renkert <rrenkert@intevation.de>
parents:
461
diff
changeset
|
1246 mPreviouslyUnselected.clear(); |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1247 mSettings.beginGroup("unselected"); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1248 mSettings.remove(""); /* Clears old choices */ |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1249 for (int i = 0; i < unselected.size(); i++) { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1250 QString key = QString::fromLatin1("cert%1").arg(i); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1251 QString value = unselected.at(i); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1252 mSettings.setValue(key, value); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1253 mPreviouslyUnselected << value; |
372
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1254 } |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1255 mSettings.endGroup(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1256 mSettings.sync(); |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1257 return mSettings.status() == QSettings::NoError; |
6cc124e79066
Add save/load unselected and add role enumerator
Andre Heinecke <andre.heinecke@intevation.de>
parents:
365
diff
changeset
|
1258 } |
447
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
446
diff
changeset
|
1259 |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1260 void MainWindow::toggleInManual(bool state, const Certificate &cert) |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1261 { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1262 if (!mUpdatesManual->contains(cert)) { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1263 mUpdatesManual->addCertificate(cert, state); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1264 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1265 else { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1266 mUpdatesManual->removeCertificate(cert); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1267 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1268 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1269 mUpdatesManualCertificates->setText("<h3>" + |
661
320a64d58e62
(UI) Updated English strings. Removed Issuer fields.
Emanuel Schuetze <emanuel@intevation.de>
parents:
659
diff
changeset
|
1270 tr("Manually changed certificates (%1)") |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1271 .arg(mUpdatesManual->certificates().size()) + |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1272 "</h3>"); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1273 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1274 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1275 void MainWindow::removeFromManual(bool state, const Certificate &cert) |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1276 { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1277 mUpdatesManual->removeCertificate(cert); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1278 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1279 mUpdatesManualCertificates->setText("<h3>" + |
661
320a64d58e62
(UI) Updated English strings. Removed Issuer fields.
Emanuel Schuetze <emanuel@intevation.de>
parents:
659
diff
changeset
|
1280 tr("Manually changed certificates (%1)") |
640
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1281 .arg(mUpdatesManual->certificates().size()) + |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1282 "</h3>"); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1283 |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1284 if (cert.isInstallCert()) { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1285 mInstallList->setCertState(state, cert); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1286 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1287 else { |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1288 mRemoveList->setCertState(state, cert); |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1289 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1290 } |
626507197360
Updated mainwindow and handle certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
628
diff
changeset
|
1291 |
447
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
446
diff
changeset
|
1292 void MainWindow::closeApp() |
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
446
diff
changeset
|
1293 { |
782
20ca94680003
Implemented detection of running instance on linux using a lock file.
Sascha Wilde <wilde@intevation.de>
parents:
754
diff
changeset
|
1294 ProcessHelp::cleanUp(); |
447
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
446
diff
changeset
|
1295 qApp->quit(); |
b1b14daf2116
Save the select state of certificate items when closing the app.
Raimund Renkert <rrenkert@intevation.de>
parents:
446
diff
changeset
|
1296 } |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1297 |
609
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1298 void MainWindow::checkAndInstallCerts() |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1299 { |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1300 /* Checking before opening the dialog should be cheaper */ |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1301 QList<int> pids = ProcessHelp::getProcessesIdForName("firefox"); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1302 pids.append(ProcessHelp::getProcessesIdForName("thunderbird")); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1303 |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1304 if (pids.isEmpty()) { |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1305 installCerts(); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1306 return; |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1307 } |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1308 |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1309 QStringList pNames; |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1310 pNames << "firefox" << "thunderbird"; |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1311 |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1312 ProcessWaitDialog *waitDialog = new ProcessWaitDialog(this, pNames); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1313 |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1314 connect(waitDialog, SIGNAL(accepted()), this, SLOT(installCerts())); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1315 connect(waitDialog, SIGNAL(accepted()), waitDialog, SLOT(deleteLater())); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1316 |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1317 waitDialog->exec(); |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1318 return; |
292c590ba9cb
Add warning dialog for running firefox and tunderbird processes
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
1319 } |
654
129e611eaf50
Merge branch trustbridge-refactor
Andre Heinecke <andre.heinecke@intevation.de>
diff
changeset
|
1320 |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1321 void MainWindow::togglePages(int button) |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1322 { |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1323 mUpdatesWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1324 mInstallWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1325 mRemoveWidget->hide(); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1326 mInfoWidget->hide(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1327 switch(button) { |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1328 case 0: mUpdatesWidget->show(); break; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1329 case 1: mInstallWidget->show(); break; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1330 case 2: mRemoveWidget->show(); break; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1331 case 3: mInfoWidget->show(); break; |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
740
diff
changeset
|
1332 default: mUpdatesWidget->show(); break; |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1333 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1334 return; |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1335 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1336 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1337 void MainWindow::toggleUpdatesNew() { |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1338 if (!mUpdatesNew->isVisible()) { |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1339 mUpdatesDetailsNew->setToolTip(tr("Hide details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1340 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1341 mUpdatesNew->show(); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1342 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1343 else { |
653
39f03316f675
Change button text when toggling details and select the first list item.
Raimund Renkert <rrenkert@intevation.de>
parents:
652
diff
changeset
|
1344 mUpdatesNew->hide(); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1345 mUpdatesDetailsNew->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1346 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1347 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1348 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1349 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1350 void MainWindow::toggleUpdatesRemove() { |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1351 if (!mUpdatesRemove->isVisible()) { |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1352 mUpdatesDetailsRemove->setToolTip(tr("Hide details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1353 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1354 mUpdatesRemove->show(); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1355 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1356 else { |
653
39f03316f675
Change button text when toggling details and select the first list item.
Raimund Renkert <rrenkert@intevation.de>
parents:
652
diff
changeset
|
1357 mUpdatesRemove->hide(); |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1358 mUpdatesDetailsRemove->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1359 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1360 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1361 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1362 |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1363 void MainWindow::toggleUpdatesManual() { |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1364 if (!mUpdatesManual->isVisible()) { |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1365 mUpdatesDetailsManual->setToolTip(tr("Hide details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1366 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1367 mUpdatesManual->show(); |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1368 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1369 else { |
790
399bc0df073d
(issue60) Make windows smaller and change details buttons to icon only
Andre Heinecke <andre.heinecke@intevation.de>
parents:
787
diff
changeset
|
1370 mUpdatesDetailsManual->setToolTip(tr("Show details")); |
845
d33834129d2a
(issue59) Improve details button.
Emanuel Schuetze <emanuel@intevation.de>
parents:
844
diff
changeset
|
1371 mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png")); |
653
39f03316f675
Change button text when toggling details and select the first list item.
Raimund Renkert <rrenkert@intevation.de>
parents:
652
diff
changeset
|
1372 mUpdatesManual->hide(); |
584
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1373 } |
ebfe1128ee97
Started trustbridge mainwindow refactoring.
Raimund Renkert <rrenkert@intevation.de>
parents:
563
diff
changeset
|
1374 } |
690
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1375 |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1376 void MainWindow::closeEvent(QCloseEvent *event) |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1377 { |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1378 if (getState() == NewListAvailable) { |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1379 /* Only minimize to tray if there is a new list */ |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1380 QMainWindow::closeEvent(event); |
965
013ca910589a
Open main window in case of error message.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
964
diff
changeset
|
1381 mTrayIcon->show(); |
690
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1382 return; |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1383 } |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1384 return closeApp(); |
e4abb41484a0
(issue 27)Only close if no new list is available
Andre Heinecke <andre.heinecke@intevation.de>
parents:
689
diff
changeset
|
1385 } |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1386 |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1387 void MainWindow::updateCheckSuccess() |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1388 { |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1389 if (getState() != TransferError) { |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1390 const QDateTime now = QDateTime::currentDateTime(); |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1391 mSettings.setValue("lastUpdateCheck", now); |
754
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
1392 mLastUpdateCheckContents->setText(QLocale::system().toString(now, DATETIME_FORMAT)); |
27043d74dc90
(Issue25) Align header contents in their own column.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
748
diff
changeset
|
1393 mLastUpdateCheckContents->show(); |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1394 mLastUpdateCheck->show(); |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1395 syslog_info_printf(tr("Sucessfully checked for updates.").toUtf8().constData()); |
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1396 } |
962
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1397 if (getState() != NewSoftwareAvailable && getState() != NewListAvailable && mTrayMode) { |
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1398 qDebug() << "Shutting down as no list or Software is available."; |
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1399 closeApp(); |
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1400 } else { |
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1401 mTrayIcon->show(); |
0a4f7235e759
Close the application if nothing new is available and in tray mode.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
961
diff
changeset
|
1402 } |
708
bd48fae793b6
(Issue25) Log update check success, change header labels.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
703
diff
changeset
|
1403 } |
716
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
1404 |
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
1405 int MainWindow::changeCount() |
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
1406 { |
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
1407 return mChangeCount; |
929c3db85eb7
Add central place to obtain current change count.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
714
diff
changeset
|
1408 } |
722
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1409 |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1410 void MainWindow::setChangeCount(int cnt) |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1411 { |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1412 if (mChangeCount != cnt) { |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1413 mChangeCount = cnt; |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1414 emit changesChanged(QString("%1").arg(cnt)); |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1415 } |
b0929968562a
(Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
719
diff
changeset
|
1416 } |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1417 |
956
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1418 void MainWindow::showProxySettings() |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1419 { |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1420 ProxySettingsDlg *dlg = new ProxySettingsDlg(this); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1421 dlg->exec(); |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1422 } |
879a634d0a40
(issue41) Add proxy support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
940
diff
changeset
|
1423 |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1424 void MainWindow::showHelp() |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1425 { |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1426 char *inst_dir = get_install_dir(); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1427 if (!inst_dir) { |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1428 qDebug() << "Failed to find install dir"; |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1429 return; |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1430 } |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1431 QString helpPath = QString::fromUtf8(inst_dir); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1432 helpPath += HELP_PATH; |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1433 QFileInfo fiHelp(helpPath); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1434 qDebug() << "Opening help: " << fiHelp.absoluteFilePath(); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1435 if (!fiHelp.exists()) { |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1436 QMessageBox::warning(this, tr("Error!"), tr ("Failed to find the manual")); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1437 return; |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1438 } |
966
9783e32e215f
(issue89) Use platform specific help url.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
965
diff
changeset
|
1439 #ifdef Q_OS_WIN |
9783e32e215f
(issue89) Use platform specific help url.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
965
diff
changeset
|
1440 QDesktopServices::openUrl(QUrl("file:///" + fiHelp.absoluteFilePath())); |
9783e32e215f
(issue89) Use platform specific help url.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
965
diff
changeset
|
1441 #else |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1442 QDesktopServices::openUrl(QUrl(fiHelp.absoluteFilePath())); |
966
9783e32e215f
(issue89) Use platform specific help url.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
965
diff
changeset
|
1443 #endif |
940
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1444 free (inst_dir); |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1445 return; |
7c89c5dc2200
(issue89) Add ui to open help in browser
Andre Heinecke <andre.heinecke@intevation.de>
parents:
932
diff
changeset
|
1446 } |