1 /*
2     Copyright © 2011-13 Qtrac Ltd. All rights reserved.
3     This program or module is free software: you can redistribute it
4     and/or modify it under the terms of the GNU General Public License
5     as published by the Free Software Foundation, either version 2 of
6     the License, or (at your option) any later version. This program is
7     distributed in the hope that it will be useful, but WITHOUT ANY
8     WARRANTY; without even the implied warranty of MERCHANTABILITY or
9     FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10     for more details.
11 */
12 
13 #include "aboutform.hpp"
14 #include <QApplication>
15 #include <QHBoxLayout>
16 #include <QSettings>
17 #include <QShortcut>
18 #include <QTabWidget>
19 #include <QTextBrowser>
20 
21 
22 static const QString Version("2.1.3");
23 
24 
AboutForm(QWidget * parent)25 AboutForm::AboutForm(QWidget *parent) : QDialog(parent)
26 {
27     QTextBrowser *aboutBrowser = new QTextBrowser;
28     aboutBrowser->setReadOnly(true);
29     aboutBrowser->setOpenExternalLinks(true);
30     aboutBrowser->setHtml(tr(
31     "<table border=0>"
32     "<tr><td width=90%><b>%1</a> %2</b> by Mark Summerfield</td>"
33     "<td rowspan=3><img align=right src=\":/icon.png\"></td></tr>"
34     "<tr><td><tt>&lt;mark@qtrac.eu&gt;</tt>.</td></tr>"
35     "<tr><td colspan=2>Copyright &copy; 2008-13 "
36     "<a href=\"http://www.qtrac.eu\">Qtrac</a> Ltd. All rights reserved."
37     "</td></tr>"
38     "<tr><td colspan=2>Built with Qt %3 and Poppler %4.</td></tr>"
39     "</table><hr>"
40     "<p>This program compares the text or the visual appearance of "
41     "each page in two PDF files."
42     "<hr><p>If you like %1 you might like my books:<ul>"
43     "<li><a href=\"http://www.qtrac.eu/gobook.html\">"
44     "Programming in Go</a></li>"
45     "<li><a href=\"http://www.qtrac.eu/aqpbook.html\">"
46     "Advanced Qt Programming</a></li>"
47     "<li><a href=\"http://www.qtrac.eu/py3book.html\">"
48     "Programming in Python 3</a></li>"
49     "<li><a href=\"http://www.qtrac.eu/pyqtbook.html\">"
50     "Rapid GUI Programming with Python and Qt</a></li>"
51     "</ul>"
52     "I also provide training and consultancy in C++, Go, Python&nbsp;2, "
53     "Python&nbsp;3, C++/Qt, and PyQt4.").arg(qApp->applicationName())
54             .arg(Version).arg(qVersion()).arg("Qt 5"));
55     QTextBrowser *contributorsBrowser = new QTextBrowser;
56     contributorsBrowser->setReadOnly(true);
57     contributorsBrowser->setHtml(tr("<table>"
58     "<tr><td>&bull;</td><td bgcolor=lightyellow><i>Anonymous Company</i> "
59     "&mdash; funded the addition of the margin exclusion "
60     "functionality</td></tr>"
61     "<tr><td>&bull;</td><td><b>David Paleino</b> &mdash; "
62     "Debian packager</td></tr>"
63     "<tr><td>&bull;</td><td><b>Dirk Loss</b> &mdash; creating "
64     "Mac binaries</td></tr>"
65     "<tr><td>&bull;</td><td>Florian Heiderich &mdash; suggested "
66     "using composition modes for showing subtle differences</td></tr>"
67     "<tr><td>&bull;</td><td><b>Jasmin Blanchette</b> &mdash; "
68     "the original idea and subsequent suggestions</td></tr>"
69     "<tr><td>&bull;</td><td>Liviu Andronic &mdash; suggested adding "
70     "drag and drop</td></tr>"
71     "<tr><td>&bull;</td><td>Paul Howarth &mdash; suggestions "
72     "resulting in Characters mode</td></tr>"
73     "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Pavel Fric</i> &mdash; "
74     "Czech translation</td></tr>"
75     "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Pierre-Alain "
76     "Bandinelli</i>&mdash; French translation</td></tr>"
77     "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Rainer Krachten</i> "
78     "&mdash; German translation and various suggestions</td></tr>"
79     "<tr><td>&bull;</td><td>Rory Gordon &mdash; suggested adding "
80     "drag and drop</td></tr>"
81     "<tr><td>&bull;</td><td>Bryan Huh &mdash; subtle bug fix"
82     "</td></tr>"
83     "<tr><td>&bull;</td><td><b>Steven Lee</b> &mdash; creating "
84     "Windows binaries</td></tr>"
85     "</table>"));
86     QTextBrowser *licenceBrowser = new QTextBrowser;
87     licenceBrowser->setReadOnly(true);
88     licenceBrowser->setHtml(tr(
89     "This program is free software: you can redistribute it "
90     "and/or modify it under the terms of the GNU General Public License "
91     "as published by the Free Software Foundation, either version 2 of "
92     "the License, or (at your option), any "
93     "later version. This program is distributed in the hope that it will "
94     "be useful, but WITHOUT ANY WARRANTY; without even the implied "
95     "warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
96     "See the GNU General Public License (in file <tt>gpl-2.0.txt</tt>) "
97     "for more details."));
98     QTabWidget *tabWidget = new QTabWidget;
99     tabWidget->addTab(aboutBrowser, tr("&About"));
100     tabWidget->addTab(contributorsBrowser, tr("&Contributors"));
101     tabWidget->addTab(licenceBrowser, tr("&License"));
102     QHBoxLayout *layout = new QHBoxLayout;
103     layout->addWidget(tabWidget);
104     setLayout(layout);
105     resize(480, 400);
106     setWindowTitle(tr("%1 — About").arg(qApp->applicationName()));
107 }
108