aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
aheinecke@404:  * Software engineering by Intevation GmbH
aheinecke@404:  *
aheinecke@404:  * This file is Free Software under the GNU GPL (v>=2)
aheinecke@404:  * and comes with ABSOLUTELY NO WARRANTY!
aheinecke@404:  * See LICENSE.txt for details.
aheinecke@404:  */
rrenkert@199: #include "aboutdialog.h"
rrenkert@427: #include <QApplication>
rrenkert@199: #include <QDebug>
rrenkert@199: #include <QVBoxLayout>
rrenkert@427: #include <QHBoxLayout>
rrenkert@199: #include <QPushButton>
rrenkert@427: #include <QLabel>
rrenkert@199: 
rrenkert@199: AboutDialog::AboutDialog(QMainWindow *parent) :
rrenkert@199:     QDialog(parent)
rrenkert@199: {
rrenkert@427:     setWindowTitle("About TrustBridge");
rrenkert@199:     setupGUI();
rrenkert@199: }
rrenkert@199: 
rrenkert@199: void AboutDialog::setupGUI()
rrenkert@199: {
rrenkert@199:     QVBoxLayout *mainLayout = new QVBoxLayout(this);
rrenkert@427:     QHBoxLayout *headerLayout = new QHBoxLayout;
rrenkert@427:     QVBoxLayout *headerTextLayout = new QVBoxLayout;
rrenkert@427:     QVBoxLayout *centerLayout = new QVBoxLayout;
rrenkert@427:     QHBoxLayout *bottomLayout = new QHBoxLayout;
rrenkert@199: 
rrenkert@427:     QLabel *title = new QLabel("<h2>" + tr("TrustBridge") + "</h2>");
rrenkert@427:     QString version = tr("Version: ");
rrenkert@427:     version.append(QApplication::applicationVersion());
rrenkert@427:     QLabel *appVersion = new QLabel(version);
rrenkert@568:     appVersion->setTextInteractionFlags(
rrenkert@568:         Qt::TextSelectableByMouse |
rrenkert@568:         Qt::TextSelectableByKeyboard);
rrenkert@427: 
rrenkert@427:     headerTextLayout->addWidget(title);
rrenkert@427:     headerTextLayout->addWidget(appVersion);
rrenkert@427:     headerLayout->addLayout(headerTextLayout);
rrenkert@427:     headerLayout->insertStretch(2, 10);
rrenkert@427: 
emanuel@1215:     QLabel *textDesc = new QLabel("<hr>" + tr("TrustBridge is a root certificate"
andre@807:         " installer for Windows and GNU/Linux.<br/>") +
andre@807:     tr("The root certificate lists are managed"
andre@807:         " by the German <a href=\"https://www.bsi.bund.de\">"
andre@807:         "Federal Office for Information Security (BSI)</a>.<br/><br/>") +
andre@807:     tr("The software was developed by the companies"
andre@807:         " <a href=\"http://www.intevation.de\">Intevation GmbH</a> and "
andre@807:         " <a href=\"http://www.dn-systems.de\">DN-Systems GmbH</a>, <br>"
emanuel@1215:         " contracted by the BSI.<br/><br/>") +
andre@807:     tr("TrustBridge is Free Software licensed"
bernhard@1218:         " under GNU GPL v==3.<br/>Copyright (C) 2014 by Bundesamt für Sicherheit"
emanuel@1215:         " in der Informationstechnik<br/><br/>") +
emanuel@1215:     tr("TrustBridge Administrator uses several Free Software components with different licenses:") +
bernhard@1218: 	"<ul><li>TrustBridge source code (GNU GPL v>=2)" +
bernhard@1218: 	"<li>Qt (GNU LGPL v==2.1 | GNU GPL v==3)" +
bernhard@1218: 	"<li>PolarSSL (GNU GPL v>=2)" +
bernhard@1218: 	"<li>Oxygen-Icons (GNU LGPL v>=3)" +
bernhard@1218: 	"<li>OpenSSL-based signcode utility (GNU GPL v==3)" +
emanuel@1215: 	"<li>OpenSSL (OpenSSL License)" +
emanuel@1215: 	"<li>NSIS (zlib/libpng license & Common Public License version 1.0)</ul>" +
bernhard@1229:     tr("You will find the legally binding details in the 'licenses' directory "
bernhard@1229:        "where TrustBridge is installed "
bernhard@1229:        "or in the corresponding revision of the"
emanuel@1215:        "<a href=\"https://wald.intevation.org/hg/trustbridge/file/tip/licenses\">TrustBridge code repository</a>."));
emanuel@1215: 
andre@807:     textDesc->setTextFormat(Qt::RichText);
rrenkert@568:     textDesc->setTextInteractionFlags(
rrenkert@568:         Qt::TextSelectableByMouse |
andre@844:         Qt::TextSelectableByKeyboard |
andre@844:         Qt::LinksAccessibleByMouse);
emanuel@843:     textDesc->setOpenExternalLinks(true);
rrenkert@427: 
rrenkert@427:     centerLayout->addWidget(textDesc);
rrenkert@428:     centerLayout->insertStretch(8, 10);
rrenkert@427: 
rrenkert@199:     QPushButton *closeButton = new QPushButton(tr("Close"));
rrenkert@199:     connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
rrenkert@427:     bottomLayout->insertStretch(0, 10);
rrenkert@427:     bottomLayout->addWidget(closeButton);
rrenkert@199: 
rrenkert@427:     QFrame *bottomSeparator = new QFrame();
rrenkert@427:     bottomSeparator->setFrameShape(QFrame::HLine);
rrenkert@427:     bottomSeparator->setFrameShadow(QFrame::Sunken);
rrenkert@427:     mainLayout->addLayout(headerLayout);
rrenkert@427:     mainLayout->addLayout(centerLayout);
rrenkert@427:     mainLayout->addWidget(bottomSeparator);
rrenkert@427:     mainLayout->addLayout(bottomLayout);
rrenkert@199: }