1 //  This file is part of the SpeedCrunch project
2 //  Copyright (C) 2004, 2006 Ariya Hidayat <ariya@kde.org>
3 //  Copyright (C) 2005, 2006 Johan Thelin <e8johan@gmail.com>
4 //  Copyright (C) 2007-2016 @heldercorreia
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; see the file COPYING.  If not, write to
18 //  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 //  Boston, MA 02110-1301, USA.
20 
21 #include "gui/aboutbox.h"
22 
23 #include <QGridLayout>
24 #include <QLabel>
25 #include <QPushButton>
26 #include <QSpacerItem>
27 #include <QTextEdit>
28 
29 #define THANKS(name) #name"<br>"
30 
AboutBox(QWidget * parent,Qt::WindowFlags f)31 AboutBox::AboutBox(QWidget* parent, Qt::WindowFlags f)
32     : QDialog(parent, f)
33 {
34     setObjectName("AboutBox");
35     setWindowTitle(tr("About SpeedCrunch"));
36 
37     QString msg = "<center>";
38     msg += "<img src=\":/speedcrunch.png\"><br>";
39     msg += "<b>SpeedCrunch " SPEEDCRUNCH_VERSION;
40 #ifdef SPEEDCRUNCH_PORTABLE
41     msg += " (Portable Edition)";
42 #endif
43     msg += "</b><br>(Qt " + QLatin1String(QT_VERSION_STR) + ")<br>";
44 
45     const QString authors = "<p><b>%1</b><br>%2";
46     msg += authors.arg(tr("Maintainer"), "Helder Correia");
47 
48     msg += "<p>" + QString("<b>%1</b><br>").arg(tr("Core developers"));
49     msg +=
50         THANKS(Felix Krull)
51         THANKS(Hadrien Theveneau)
52         THANKS(Pol Welter)
53         THANKS(Teyut)
54         ;
55 
56     msg += authors.arg(tr("Original author"), "Ariya Hidayat");
57     msg += authors.arg(tr("Math engine"), "Wolf Lammen");
58 
59     msg += "<p>" + QString("<b>%1</b><br>").arg(tr("Thanks"));
60     msg +=
61         THANKS(Alan Davies)
62         THANKS(Alejandro Villarreal)
63         THANKS(Alessandro Portale)
64         THANKS(Alexey Gorishny)
65         THANKS(Alexey Kouznetsov)
66         THANKS(Anders Lund)
67         THANKS(Andreas Scherer)
68         THANKS(Artem Golovinsky)
69         THANKS(Aur&eacute;lien G&acirc;teau)
70         THANKS(Bart Martens)
71         THANKS(Bernhard Schiffner)
72         THANKS(Christian Ehrlich)
73         THANKS(Damir Perisa)
74         THANKS(Daniel Sch&auml;ufele)
75         THANKS(Derek O&#39;Connor)
76         THANKS(Enrico R&oacute;s)
77         THANKS(Eugeniu Plamadeala)
78         THANKS(F Chris Carrera)
79         THANKS(Francesco di Cugno)
80         THANKS(Gary Cramblitt)
81         THANKS(Henrik Nordstrom)
82         THANKS(Henrique Pinto)
83         THANKS(James Yuzwalk)
84         THANKS(Jean-Remy Falleri)
85         THANKS(Jean-Michel Frouin)
86         THANKS(Johannes Lange)
87         THANKS(Johan Thelin)
88         THANKS(Jonathan Avraham)
89         THANKS(Jonathan Riddell)
90         THANKS(Lars Ivar Igesund)
91         THANKS(l.inc)
92         THANKS(Luigi Toscano)
93         THANKS(Maciek Borowka)
94         THANKS(Marco Wegner)
95         THANKS(Matthew J Smith)
96         THANKS(Melchior Franz)
97         THANKS(Michael Pyne)
98         THANKS(Mikko Syrj&auml;)
99         THANKS(Mohamed Eldesoky)
100         THANKS(Nikolay Zlatev)
101         THANKS(Noah Davis)
102         THANKS(Oliver Gubler)
103         THANKS(Petri Damst&eacute;n)
104         THANKS(Philippe Fremy)
105         THANKS(Pieter Pareit)
106         THANKS(Roberto Alsina)
107         THANKS(Roland &#39;liquidat&#39; Wolters)
108         THANKS(Roger Sachan)
109         THANKS(Sarah Hobbs)
110         THANKS(S&eacute;bastien Szymanski)
111         THANKS(Stephan Binner)
112         THANKS(Steven Honeyman)
113         THANKS(Thomas Luebking)
114         THANKS(Thomas Nagy)
115         THANKS(Vibet Alexis)
116         THANKS(Vladimir Pouzanov)
117         THANKS(Wictor Lund)
118         THANKS(Witold Wysota)
119         THANKS(1100101)
120         ;
121 
122     msg += "</p><p>";
123 
124     msg += "<p><b>";
125     msg += tr("Copyright (C) 2004-2016 The SpeedCrunch developers");
126     msg += "</b></p>";
127 
128     msg += "<p>";
129     msg += tr("This program is free software; you can redistribute it and/or "
130               "modify it under the terms of the GNU General Public License "
131               "as published by the Free Software Foundation; either version 2 "
132               "of the License, or (at your option) any later version");
133     msg += "</p>";
134     msg += "<p>";
135     msg += tr("This program is distributed in the hope that it will be useful, "
136               "but WITHOUT ANY WARRANTY; without even the implied warranty of "
137               "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
138               "GNU General Public License for more details.");
139     msg += "</p>";
140 
141     msg += "</center>";
142 
143     QTextEdit* textEdit = new QTextEdit(this);
144     textEdit->setReadOnly(true);
145     textEdit->setText(msg);
146 
147     QPushButton* closeButton = new QPushButton(this);
148     closeButton->setText(tr("Close"));
149     connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(close()));
150 
151     QGridLayout* mainLayout = new QGridLayout(this);
152     mainLayout->addWidget(textEdit, 0, 0, 1, 2);
153     mainLayout->addWidget(closeButton, 1, 1, 1, 1);
154     mainLayout->setColumnStretch(0, 1);
155 
156     setWindowTitle(tr("About SpeedCrunch"));
157 }
158