annotate ui/aboutdialog.cpp @ 628:3a9c0f38bbad trustbridge-refactor

Made certificate lists member of mainwindow and added some temporary debug msgs.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 23 Jun 2014 12:49:09 +0200
parents 8dbfd0cb534b
children 1e18d4c1932a
rev   line source
404
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
2 * Software engineering by Intevation GmbH
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
3 *
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
6 * See LICENSE.txt for details.
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 199
diff changeset
7 */
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 #include "aboutdialog.h"
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
9 #include <QApplication>
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 #include <QDebug>
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 #include <QVBoxLayout>
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
12 #include <QHBoxLayout>
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 #include <QPushButton>
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
14 #include <QLabel>
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 AboutDialog::AboutDialog(QMainWindow *parent) :
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 QDialog(parent)
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 {
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
19 setWindowTitle("About TrustBridge");
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 setupGUI();
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 }
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 void AboutDialog::setupGUI()
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 {
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 QVBoxLayout *mainLayout = new QVBoxLayout(this);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
26 QHBoxLayout *headerLayout = new QHBoxLayout;
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
27 QVBoxLayout *headerTextLayout = new QVBoxLayout;
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
28 QVBoxLayout *centerLayout = new QVBoxLayout;
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
29 QHBoxLayout *bottomLayout = new QHBoxLayout;
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
31 QImage *logoImage = new QImage(":/img/logo.png");
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
32 QLabel *logo = new QLabel;
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
33 logo->setBackgroundRole(QPalette::Base);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
34 logo->setPixmap(QPixmap::fromImage(*logoImage));
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
35 QLabel *title = new QLabel("<h2>" + tr("TrustBridge") + "</h2>");
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
36 QString version = tr("Version: ");
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
37 version.append(QApplication::applicationVersion());
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
38 QLabel *appVersion = new QLabel(version);
568
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
39 appVersion->setTextInteractionFlags(
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
40 Qt::TextSelectableByMouse |
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
41 Qt::TextSelectableByKeyboard);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
42
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
43 QFrame *headerSeparator = new QFrame();
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
44 headerSeparator->setFrameShape(QFrame::HLine);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
45 headerSeparator->setFrameShadow(QFrame::Sunken);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
46
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
47 headerTextLayout->addWidget(title);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
48 headerTextLayout->addWidget(appVersion);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
49 headerLayout->addWidget(logo);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
50 headerLayout->addLayout(headerTextLayout);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
51 headerLayout->insertStretch(2, 10);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
52
531
dec797c7230c Fix usage of OU / O
Andre Heinecke <aheinecke@intevation.de>
parents: 428
diff changeset
53 QLabel *textDesc = new QLabel(tr("TrustBridge is a root certificate"
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
54 " installer for Windows and Linux."));
568
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
55 textDesc->setTextInteractionFlags(
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
56 Qt::TextSelectableByMouse |
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
57 Qt::TextSelectableByKeyboard);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
58 QLabel *textManage = new QLabel(tr("The root certificate lists are managed"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
59 " by the German <a href=\"https://www.bsi.bund.de\">"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
60 "Federal Office for Information Security (BSI)</a>.\n\n"));
568
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
61 textManage->setTextInteractionFlags(
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
62 Qt::TextBrowserInteraction |
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
63 Qt::TextSelectableByKeyboard);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
64 QLabel *textDevel = new QLabel(tr("The software was developed by the companies"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
65 " <a href=\"http://www.intevation.de\">Intevation GmbH</a> and "
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
66 " <a href=\"http://www.dn-systems.de\">DN-Systems GmbH</a>, <br>"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
67 " contracted by the German Federal Office for Information Security (BSI).\n\n"));
568
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
68 textDevel->setTextInteractionFlags(
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
69 Qt::TextBrowserInteraction |
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
70 Qt::TextSelectableByKeyboard);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
71 QLabel *textLicense = new QLabel(tr("TrustBridge is Free Software licensed"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
72 " under GNU GPL v2+.\n\nCopyright (C) 2014 by Bundesamt für Sicherheit"
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
73 " in der Informationstechnik"));
568
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
74 textLicense->setTextInteractionFlags(
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
75 Qt::TextSelectableByMouse |
8dbfd0cb534b Made text selectable in about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents: 531
diff changeset
76 Qt::TextSelectableByKeyboard);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
77
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
78 centerLayout->addWidget(headerSeparator);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
79 centerLayout->addWidget(textDesc);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
80 centerLayout->addWidget(textManage);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
81 centerLayout->addWidget(textDevel);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
82 centerLayout->addWidget(textLicense);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
83 centerLayout->insertSpacing(2, 10);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
84 centerLayout->insertSpacing(4, 10);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
85 centerLayout->insertSpacing(6, 10);
428
d1819cd56dee Updated dialog layout.
Raimund Renkert <rrenkert@intevation.de>
parents: 427
diff changeset
86 centerLayout->insertStretch(8, 10);
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
87
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 QPushButton *closeButton = new QPushButton(tr("Close"));
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
90 bottomLayout->insertStretch(0, 10);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
91 bottomLayout->addWidget(closeButton);
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
92
427
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
93 QFrame *bottomSeparator = new QFrame();
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
94 bottomSeparator->setFrameShape(QFrame::HLine);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
95 bottomSeparator->setFrameShadow(QFrame::Sunken);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
96 mainLayout->addLayout(headerLayout);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
97 mainLayout->addLayout(centerLayout);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
98 mainLayout->addWidget(bottomSeparator);
d08e39b913ee Added about dialog content and open the dialog via administration app.
Raimund Renkert <rrenkert@intevation.de>
parents: 404
diff changeset
99 mainLayout->addLayout(bottomLayout);
199
4790a26c2e8b Added about dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
100 }

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