comparison ui/aboutdialog.cpp @ 427:d08e39b913ee

Added about dialog content and open the dialog via administration app.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 17 Apr 2014 12:56:23 +0200
parents 17e1c8f37d72
children d1819cd56dee
comparison
equal deleted inserted replaced
426:d7cda835abd6 427:d08e39b913ee
4 * This file is Free Software under the GNU GPL (v>=2) 4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY! 5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details. 6 * See LICENSE.txt for details.
7 */ 7 */
8 #include "aboutdialog.h" 8 #include "aboutdialog.h"
9 #include <QApplication>
9 #include <QDebug> 10 #include <QDebug>
10 #include <QVBoxLayout> 11 #include <QVBoxLayout>
11 #include <QTextEdit> 12 #include <QHBoxLayout>
12 #include <QPushButton> 13 #include <QPushButton>
14 #include <QLabel>
13 15
14 AboutDialog::AboutDialog(QMainWindow *parent) : 16 AboutDialog::AboutDialog(QMainWindow *parent) :
15 QDialog(parent) 17 QDialog(parent)
16 { 18 {
19 setWindowTitle("About TrustBridge");
17 setupGUI(); 20 setupGUI();
18 } 21 }
19 22
20 void AboutDialog::setupGUI() 23 void AboutDialog::setupGUI()
21 { 24 {
22 QVBoxLayout *mainLayout = new QVBoxLayout(this); 25 QVBoxLayout *mainLayout = new QVBoxLayout(this);
23 QTextEdit *helpText = new QTextEdit; 26 QHBoxLayout *headerLayout = new QHBoxLayout;
24 helpText->setReadOnly(true); 27 QVBoxLayout *headerTextLayout = new QVBoxLayout;
25 helpText->setPlainText(tr("This dialog contains some text about the application")); 28 QVBoxLayout *centerLayout = new QVBoxLayout;
29 QHBoxLayout *bottomLayout = new QHBoxLayout;
26 30
27 QHBoxLayout *buttonLayout = new QHBoxLayout; 31 QImage *logoImage = new QImage(":/img/logo.png");
32 QLabel *logo = new QLabel;
33 logo->setBackgroundRole(QPalette::Base);
34 logo->setPixmap(QPixmap::fromImage(*logoImage));
35 QLabel *title = new QLabel("<h2>" + tr("TrustBridge") + "</h2>");
36 QString version = tr("Version: ");
37 version.append(QApplication::applicationVersion());
38 QLabel *appVersion = new QLabel(version);
39
40 QFrame *headerSeparator = new QFrame();
41 headerSeparator->setFrameShape(QFrame::HLine);
42 headerSeparator->setFrameShadow(QFrame::Sunken);
43
44 headerTextLayout->addWidget(title);
45 headerTextLayout->addWidget(appVersion);
46 headerLayout->addWidget(logo);
47 headerLayout->addLayout(headerTextLayout);
48 headerLayout->insertStretch(2, 10);
49
50 QLabel *textDesc = new QLabel(tr("TrustBridge is a secure root certificate"
51 " installer for Windows and Linux."));
52 QLabel *textManage = new QLabel(tr("The root certificate lists are managed"
53 " by the German <a href=\"https://www.bsi.bund.de\">"
54 "Federal Office for Information Security (BSI)</a>.\n\n"));
55 QLabel *textDevel = new QLabel(tr("The software was developed by the companies"
56 " <a href=\"http://www.intevation.de\">Intevation GmbH</a> and "
57 " <a href=\"http://www.dn-systems.de\">DN-Systems GmbH</a>, <br>"
58 " contracted by the German Federal Office for Information Security (BSI).\n\n"));
59 QLabel *textLicense = new QLabel(tr("TrustBridge is Free Software licensed"
60 " under GNU GPL v2+.\n\nCopyright (C) 2014 by Bundesamt für Sicherheit"
61 " in der Informationstechnik"));
62
63 centerLayout->addWidget(headerSeparator);
64 centerLayout->addWidget(textDesc);
65 centerLayout->addWidget(textManage);
66 centerLayout->addWidget(textDevel);
67 centerLayout->addWidget(textLicense);
68 centerLayout->insertSpacing(2, 10);
69 centerLayout->insertSpacing(4, 10);
70 centerLayout->insertSpacing(6, 10);
71
28 QPushButton *closeButton = new QPushButton(tr("Close")); 72 QPushButton *closeButton = new QPushButton(tr("Close"));
29 connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); 73 connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
30 buttonLayout->insertStretch(0, 10); 74 bottomLayout->insertStretch(0, 10);
31 buttonLayout->addWidget(closeButton); 75 bottomLayout->addWidget(closeButton);
32 76
33 mainLayout->addWidget(helpText); 77 QFrame *bottomSeparator = new QFrame();
34 mainLayout->addLayout(buttonLayout); 78 bottomSeparator->setFrameShape(QFrame::HLine);
79 bottomSeparator->setFrameShadow(QFrame::Sunken);
80 mainLayout->addLayout(headerLayout);
81 mainLayout->addLayout(centerLayout);
82 mainLayout->addWidget(bottomSeparator);
83 mainLayout->addLayout(bottomLayout);
35 } 84 }

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