Debian Codegraph @

src/editor/aboutdlg.cpp

raw symbols SCIP
1 // This file is part of Dust Racing 2D.
2 // Copyright (C) 2012 Jussi Lind <[email protected]>
3 //
4 // Dust Racing 2D is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 // Dust Racing 2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Dust Racing 2D. If not, see <http://www.gnu.org/licenses/>.
15
16 #include "aboutdlg.hpp"
17 #include "../common/config.hpp"
18
19 #include <QHBoxLayout>
20 #include <QLabel>
21 #include <QPixmap>
22 #include <QPushButton>
23 #include <QVBoxLayout>
24
25 AboutDlg::AboutDlg(QWidget * parent)
26 : QDialog(parent)
27 {
28 setWindowTitle(tr("About Dust Racing"));
29 initWidgets();
30 }
31
32 void AboutDlg::initWidgets()
33 {
34 QVBoxLayout * vLayout = new QVBoxLayout(this);
35 QLabel * pixmapLabel = new QLabel(this);
36
37 pixmapLabel->setPixmap(QPixmap(":/about.png"));
38 vLayout->addWidget(pixmapLabel);
39
40 QLabel * infoLabel = new QLabel(this);
41 infoLabel->setText(
42 QString("<h2>") + Config::Game::GAME_NAME + " v" + Config::Game::GAME_VERSION + "</h2>"
43 + "<p>" + Config::Game::GAME_NAME + " is licenced under GNU GPLv3.</p>"
44 + "<p>" + Config::General::COPYRIGHT + "</p>"
45 + "<a href='" + Config::General::WEB_SITE_URL + "'>"
46 + Config::General::WEB_SITE_URL + "</a>");
47
48 vLayout->addWidget(infoLabel);
49
50 QHBoxLayout * buttonLayout = new QHBoxLayout();
51 QPushButton * button = new QPushButton("&Ok", this);
52 connect(button, &QPushButton::clicked, this, &AboutDlg::accept);
53 buttonLayout->addWidget(button);
54 buttonLayout->insertStretch(0);
55 vLayout->addLayout(buttonLayout);
56 }