-
Notifications
You must be signed in to change notification settings - Fork 42
/
ZDLAboutDialog.cpp
93 lines (78 loc) · 3.18 KB
/
ZDLAboutDialog.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* This file is part of qZDL
* Copyright (C) 2007-2010 Cody Harris
*
* qZDL is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ZDLAboutDialog.h"
#include "zdlcommon.h"
#include "zdlconf.h"
#include <QDialogButtonBox>
#include "ZDLVersion.h"
#include "bmp_logo.xpm"
extern QString versionString;
ZDLAboutDialog::ZDLAboutDialog(ZDLWidget *parent):QDialog(parent){
setWindowTitle("About ZDL");
QVBoxLayout *box = new QVBoxLayout(this);
QHBoxLayout *hbox = new QHBoxLayout();
box->addLayout(hbox);
QVBoxLayout *vbox = new QVBoxLayout();
QLabel *title = new QLabel(QString("ZDL")+" "+ZDL_VERSION_STRING,this);
QFont font;
font.setPointSize(24);
title->setFont(font);
title->setAlignment(Qt::AlignHCenter);
vbox->addWidget(title);
QLabel *pic = new QLabel(this);
QPixmap map(":zdl3.svg");
if(!map.isNull()){
pic->setPixmap(map);
}else{
pic->setPixmap(QPixmap(aboutImg));
}
hbox->addWidget(pic);
hbox->addLayout(vbox);
QFrame *hrTop = new QFrame(this);
hrTop->setFrameStyle(QFrame::HLine);
box->addWidget(hrTop);
box->addWidget(new QLabel(QString("Source: ")+QString(ZDL_SOURCE),this));
box->addWidget(new QLabel("Copyright (C) ZDL Software Foundation 2004-2012", this));
QLabel *url = new QLabel("<a href=http://zdl.vectec.net>http://zdl.vectec.net</a>",this);
url->setOpenExternalLinks(true);
box->addWidget(url);
box->addWidget(new QLabel(QString("Source: ")+QString(ZDL_SOURCE),this));
box->addWidget(new QLabel(QString("Build: ")+QString(ZDL_BUILD),this));
box->addWidget(new QLabel(QString("Revision: ")+QString(ZDL_REVISION),this));
QFrame *hrMid = new QFrame(this);
hrMid->setFrameStyle(QFrame::HLine);
box->addWidget(hrMid);
box->addWidget(new QLabel("Special thanks to BioHazard for the original version",this));
box->addWidget(new QLabel("Huge thanks to NeuralStunner. Without his help, none of this would be possible.", this));
box->addWidget(new QLabel("Special thanks to Blzut3, Risen, Enjay, DRDTeam.org, ZDoom.org, Dugan Chen",this));
auto conf = ZDLConfigurationManager::getActiveConfiguration();
QString userConfPath = conf->fileName();
QFrame *hrBot = new QFrame(this);
hrBot->setFrameStyle(QFrame::HLine);
box->addWidget(hrBot);
QLabel *userConf = new QLabel("User Configuration File: "+userConfPath,this);
userConf->setCursor(Qt::IBeamCursor);
userConf->setTextInteractionFlags(Qt::TextSelectableByMouse);
box->addWidget(userConf);
QDialogButtonBox *btnBox = new QDialogButtonBox(QDialogButtonBox::Ok,Qt::Horizontal,this);
box->addWidget(btnBox);
connect(btnBox, &QDialogButtonBox::accepted, this, &ZDLAboutDialog::close);
}
void ZDLAboutDialog::close(){
done(0);
}