forked from krojew/evernus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutDialog.cpp
70 lines (62 loc) · 2.92 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* This program 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 <QCoreApplication>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QIcon>
#include "AboutDialog.h"
namespace Evernus
{
AboutDialog::AboutDialog(QWidget *parent)
: QDialog{parent}
{
auto mainLayout = new QVBoxLayout{this};
auto textLayout = new QHBoxLayout{};
mainLayout->addLayout(textLayout);
auto icon = parent->windowIcon();
auto iconLabel = new QLabel{this};
textLayout->addWidget(iconLabel);
iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize{64, 64})));
const auto link = QStringLiteral("http://evernus.com");
const auto oldForum = QStringLiteral("https://forums-archive.eveonline.com/default.aspx?g=posts&t=362779");
const auto newForum = QStringLiteral("https://forums.eveonline.com/t/evernus-2-2-release-the-ultimate-market-tool/6031");
auto aboutLabel = new QLabel{tr(
"<strong>%1</strong><br />%2<br /><br />"
"Created by <strong><a href='http://evewho.com/pilot/Pete+Butcher'>Pete Butcher</a></strong><br />"
"German translation by <strong><a href='http://evewho.com/pilot/Hel+O%27Ween'>Hel O'Ween</a></strong><br />"
"Thanks to <strong><a href='https://www.twitch.tv/maximilon'>Robert Knox</a></strong> for testing and tips.<br />"
"All donations are welcome :)<br /><br />"
"<a href='%3'>%3</a><br />"
"Twitter: <a href='http://twitter.com/evernusproject'>@evernusproject</a><br />"
"New forum topic: <a href='%4'>%4</a><br />"
"Old forum topic: <a href='%5'>%5</a>")
.arg(QCoreApplication::applicationName())
.arg(QCoreApplication::applicationVersion())
.arg(link)
.arg(newForum)
.arg(oldForum),
this};
textLayout->addWidget(aboutLabel);
aboutLabel->setTextFormat(Qt::RichText);
aboutLabel->setOpenExternalLinks(true);
const auto buttons = new QDialogButtonBox{QDialogButtonBox::Close, this};
mainLayout->addWidget(buttons);
buttons->setCenterButtons(true);
connect(buttons, &QDialogButtonBox::rejected, this, &AboutDialog::close);
setWindowTitle(tr("About"));
}
}