1 /* ColorCode, a free MasterMind clone with built in solver
2 * Copyright (C) 2009 Dirk Laebisch
3 * http://www.laebisch.com/
4 *
5 * ColorCode is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * ColorCode is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "about.h"
20
About(QWidget * parent,Qt::WindowFlags f)21 About::About(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f)
22 {
23 setupUi(this);
24 setWindowIcon(QIcon(QPixmap(":/img/help-about.png")));
25 mAuthorIcon->setPixmap(QPixmap(":/img/cc32.png"));
26 mLicenseIcon->setPixmap(QPixmap(":/img/GNU-icon32.png"));
27
28 mAuthorText->setText("<b>" + ColorCode::GAME_TITLE + "</b><br>" +
29 tr("A needful game to train your brain ;-)") +
30 tr("<br><br>Free MasterMind clone including a built in,<br>rather intelligent solver.") +
31 "<br><br>" + tr("Version") + ": " + ColorCode::VERSION + "<br>" + tr("Author") + ": Dirk Laebisch");
32
33 QString license_file = ":/docs/GPL.html";
34 if (QFile::exists(license_file))
35 {
36 QFont fixed_font;
37 fixed_font.setStyleHint(QFont::TypeWriter);
38 fixed_font.setFamily("Courier");
39 mLicenseText->setFont(fixed_font);
40
41 QFile f(license_file);
42 if (f.open(QIODevice::ReadOnly))
43 {
44 mLicenseText->setText(QString::fromUtf8(f.readAll().constData()));
45 }
46 f.close();
47 }
48 else
49 {
50 mLicenseText->setText(
51 "<i>" +
52 tr("This program is free software; you can redistribute it and/or modify "
53 "it under the terms of the GNU General Public License as published by "
54 "the Free Software Foundation; either version 3 of the License, or "
55 "(at your option) any later version.") + "</i>"
56 );
57 }
58 }
59
~About()60 About::~About()
61 {
62 }
63
sizeHint() const64 QSize About::sizeHint () const
65 {
66 return QSize(360, 270);
67 }
68