forked from ciphrex/mSIGNA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaboutdialog.cpp
57 lines (46 loc) · 1.74 KB
/
aboutdialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
///////////////////////////////////////////////////////////////////////////////
//
// mSIGNA
//
// aboutdialog.cpp
//
// Copyright (c) 2014 Eric Lombrozo
//
// All Rights Reserved.
#include "aboutdialog.h"
#include "settings.h"
#include "versioninfo.h"
#include "copyrightinfo.h"
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QVBoxLayout>
#include <QLabel>
AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent)
{
setWindowTitle(tr("About ") + getDefaultSettings().getAppName());
setStyleSheet("font: bold 9pt");
// Buttons
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
QLabel* versionLabel = new QLabel(getVersionText());
versionLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
QLabel* schemaLabel = new QLabel(getSchemaVersionText());
schemaLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
QLabel* commitLabel = new QLabel(getCommitHash());
commitLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
QLabel* openSSLLabel = new QLabel(getOpenSSLVersionText());
openSSLLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
QFormLayout* formLayout = new QFormLayout();
formLayout->addRow(tr("Version:"), versionLabel);
formLayout->addRow(tr("Schema:"), schemaLabel);
formLayout->addRow(tr("Commit:"), commitLabel);
formLayout->addRow(tr("OpenSSL:"), openSSLLabel);
QVBoxLayout* mainLayout = new QVBoxLayout();
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addLayout(formLayout);
mainLayout->addSpacing(20);
mainLayout->addWidget(new QLabel(getCopyrightText()));
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
}