-
Notifications
You must be signed in to change notification settings - Fork 8
/
aboutform.cpp
106 lines (101 loc) · 4.78 KB
/
aboutform.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
/*
Copyright © 2011-13 Qtrac Ltd. All rights reserved.
This program or module 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 2 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.
*/
#include "aboutform.hpp"
#include <poppler-version.h>
#include <QApplication>
#include <QHBoxLayout>
#include <QSettings>
#include <QShortcut>
#include <QTabWidget>
#include <QTextBrowser>
static const QString Version("2.1.2");
AboutForm::AboutForm(QWidget *parent) : QDialog(parent)
{
QTextBrowser *aboutBrowser = new QTextBrowser;
aboutBrowser->setReadOnly(true);
aboutBrowser->setOpenExternalLinks(true);
aboutBrowser->setHtml(tr(
"<table border=0>"
"<tr><td width=90%><b>%1</a> %2</b> by Mark Summerfield</td>"
"<td rowspan=3><img align=right src=\":/icon.png\"></td></tr>"
"<tr><td><tt><[email protected]></tt>.</td></tr>"
"<tr><td colspan=2>Copyright © 2008-13 "
"<a href=\"http://www.qtrac.eu\">Qtrac</a> Ltd. All rights reserved."
"</td></tr>"
"<tr><td colspan=2>Built with Qt %3 and Poppler %4.</td></tr>"
"</table><hr>"
"<p>This program compares the text or the visual appearance of "
"each page in two PDF files."
"<hr><p>If you like %1 you might like my books:<ul>"
"<li><a href=\"http://www.qtrac.eu/gobook.html\">"
"Programming in Go</a></li>"
"<li><a href=\"http://www.qtrac.eu/aqpbook.html\">"
"Advanced Qt Programming</a></li>"
"<li><a href=\"http://www.qtrac.eu/py3book.html\">"
"Programming in Python 3</a></li>"
"<li><a href=\"http://www.qtrac.eu/pyqtbook.html\">"
"Rapid GUI Programming with Python and Qt</a></li>"
"</ul>"
"I also provide training and consultancy in C++, Go, Python 2, "
"Python 3, C++/Qt, and PyQt4.").arg(qApp->applicationName())
.arg(Version).arg(qVersion()).arg(POPPLER_VERSION));
QTextBrowser *contributorsBrowser = new QTextBrowser;
contributorsBrowser->setReadOnly(true);
contributorsBrowser->setHtml(tr("<table>"
"<tr><td>•</td><td bgcolor=lightyellow><i>Anonymous Company</i> "
"— funded the addition of the margin exclusion "
"functionality</td></tr>"
"<tr><td>•</td><td><b>David Paleino</b> — "
"Debian packager</td></tr>"
"<tr><td>•</td><td><b>Dirk Loss</b> — creating "
"Mac binaries</td></tr>"
"<tr><td>•</td><td>Florian Heiderich — suggested "
"using composition modes for showing subtle differences</td></tr>"
"<tr><td>•</td><td><b>Jasmin Blanchette</b> — "
"the original idea and subsequent suggestions</td></tr>"
"<tr><td>•</td><td>Liviu Andronic — suggested adding "
"drag and drop</td></tr>"
"<tr><td>•</td><td>Paul Howarth — suggestions "
"resulting in Characters mode</td></tr>"
"<tr><td>•</td><td bgcolor=\"#F0F0F0\"><i>Pavel Fric</i> — "
"Czech translation</td></tr>"
"<tr><td>•</td><td bgcolor=\"#F0F0F0\"><i>Pierre-Alain "
"Bandinelli</i>— French translation</td></tr>"
"<tr><td>•</td><td bgcolor=\"#F0F0F0\"><i>Rainer Krachten</i> "
"— German translation and various suggestions</td></tr>"
"<tr><td>•</td><td>Rory Gordon — suggested adding "
"drag and drop</td></tr>"
"<tr><td>•</td><td><b>Steven Lee</b> — creating "
"Windows binaries</td></tr>"
"</table>"));
QTextBrowser *licenceBrowser = new QTextBrowser;
licenceBrowser->setReadOnly(true);
licenceBrowser->setHtml(tr(
"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 2 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 (in file <tt>gpl-2.0.txt</tt>) "
"for more details."));
QTabWidget *tabWidget = new QTabWidget;
tabWidget->addTab(aboutBrowser, tr("&About"));
tabWidget->addTab(contributorsBrowser, tr("&Contributors"));
tabWidget->addTab(licenceBrowser, tr("&License"));
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(tabWidget);
setLayout(layout);
resize(480, 400);
setWindowTitle(tr("%1 — About").arg(qApp->applicationName()));
}