-
Notifications
You must be signed in to change notification settings - Fork 0
/
colophon_pages.cpp
194 lines (157 loc) · 6.62 KB
/
colophon_pages.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/**
* Copyright 2022 naracanto <https://naracanto.github.io>.
*
* This file is part of QTabelo <https://github.com/beletalabs/qtabelo>.
*
* QTabelo is an open source table editor written in C++ using the
* Qt framework.
*
* QTabelo 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.
*
* QTabelo 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 QTabelo. If not, see <https://www.gnu.org/licenses/>.
*/
#include "colophon_pages.h"
#include <QApplication>
#include <QTextBrowser>
#include <QVBoxLayout>
//
//
// Colophon page: About
//
ColophonPageAbout::ColophonPageAbout(QWidget *parent)
: QWidget{parent}
{
QString text = QStringLiteral("<html><body>");
text += tr("<p>%1 is an open source table editor written in C++ using the Qt framework.</p>").arg(QApplication::applicationName());
text += tr("<p>Copyright © 2022 <a href=\"%1\" title=\"Visit organization's homepage\">%2</a>.</p>").arg(QApplication::organizationDomain(), QApplication::organizationName());
text += tr("<p>This application is licensed under the terms of the <a href=\"https://www.gnu.org/licenses/gpl-3.0.en.html\" title=\"Visit license's homepage\">GNU General Public License, version 3</a>.</p>");
text += QStringLiteral("</body></html>");
auto *textBox = new QTextBrowser;
textBox->setHtml(text);
textBox->setOpenExternalLinks(true);
textBox->setFrameStyle(QFrame::NoFrame);
textBox->setStyleSheet(QStringLiteral("background-color:transparent;"));
// Main layout
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(textBox);
setLayout(mainLayout);
}
QString ColophonPageAbout::title() const
{
return tr("About");
}
//
//
// Colophon page: Authors
//
ColophonPageAuthors::ColophonPageAuthors(QWidget *parent)
: QWidget{parent}
{
QString text = QStringLiteral("<html><body><dl>");
text += tr("<dt><strong>naracanto</strong></dt>");
text += tr("<dd>Created and developed by <a href=\"https://naracanto.github.io\" title=\"Visit author's homepage\">naracanto</a>.</dd>");
text += QStringLiteral("</dl></body></html>");
auto *textBox = new QTextBrowser;
textBox->setHtml(text);
textBox->setOpenExternalLinks(true);
textBox->setFrameStyle(QFrame::NoFrame);
textBox->setStyleSheet(QStringLiteral("background-color:transparent;"));
// Main layout
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(textBox);
setLayout(mainLayout);
}
QString ColophonPageAuthors::title() const
{
return tr("Authors");
}
//
//
// Colophon page: Credits
//
ColophonPageCredits::ColophonPageCredits(QWidget *parent)
: QWidget{parent}
{
QString text = QStringLiteral("<html><body><dl>");
text += tr("<dt><strong>BreezeIcons project</strong></dt>");
text += tr("<dd>Application logo and icons made by <a href=\"https://api.kde.org/frameworks/breeze-icons/html/\" title=\"Visit project's homepage\">BreezeIcons project</a> "
"from <a href=\"https://kde.org\" title=\"Visit organization's homepage\">KDE</a> are licensed under <a href=\"https://www.gnu.org/licenses/lgpl-3.0.en.html\" title=\"Visit license's homepage\">LGPLv3</a>.</dd>");
text += QStringLiteral("</dl></body></html>");
auto *textBox = new QTextBrowser;
textBox->setHtml(text);
textBox->setOpenExternalLinks(true);
textBox->setFrameStyle(QFrame::NoFrame);
textBox->setStyleSheet(QStringLiteral("background-color:transparent;"));
// Main layout
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(textBox);
setLayout(mainLayout);
}
QString ColophonPageCredits::title() const
{
return tr("Credits");
}
//
//
// Colophon page: Environment
//
ColophonPageEnvironment::ColophonPageEnvironment(QWidget *parent)
: QWidget{parent}
{
QString text = QStringLiteral("<html><body><dl>");
text += tr("<dt><strong>Application version</strong></dt>");
text += tr("<dd>%1</dd>").arg(QApplication::applicationVersion());
text += tr("<dt><strong>Qt for C++ version</strong></dt>");
text += tr("<dd>Qt %1 (Built against %2)</dd>").arg(qVersion(), QT_VERSION_STR);
text += tr("<dt><strong>Operation System</strong></dt>");
text += tr("<dd>%1 (Kernel %2 on %3)</dd>").arg(QSysInfo::prettyProductName(), QSysInfo::kernelVersion(), QSysInfo::currentCpuArchitecture());
text += QStringLiteral("</dl></body></html>");
auto *textBox = new QTextBrowser;
textBox->setHtml(text);
textBox->setOpenExternalLinks(true);
textBox->setFrameStyle(QFrame::NoFrame);
textBox->setStyleSheet(QStringLiteral("background-color:transparent;"));
// Main layout
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(textBox);
setLayout(mainLayout);
}
QString ColophonPageEnvironment::title() const
{
return tr("Environment");
}
//
//
// Colophon page: License
//
ColophonPageLicense::ColophonPageLicense(QWidget *parent)
: QWidget{parent}
{
QString text = QStringLiteral("<html><body>");
text += tr("<p>%1 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.</p>").arg(QApplication::applicationName());
text += tr("<p>%1 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.</p>").arg(QApplication::applicationName());
text += tr("<p>You should have received a copy of the GNU General Public License along with %1. If not, see <a href=\"https://www.gnu.org/licenses/\" title=\"Visit license's homepage\">https://www.gnu.org/licenses/</a>.</p>").arg(QApplication::applicationName());
text += QStringLiteral("</body></html>");
auto *textBox = new QTextBrowser;
textBox->setHtml(text);
textBox->setOpenExternalLinks(true);
textBox->setFrameStyle(QFrame::NoFrame);
textBox->setStyleSheet(QStringLiteral("background-color:transparent;"));
// Main layout
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(textBox);
setLayout(mainLayout);
}
QString ColophonPageLicense::title() const
{
return tr("License");
}