Replace build date with commit date (#159)
[quassel.git] / src / qtui / aboutdlg.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-2016 by the Quassel Project                        *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program 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 2 of the License, or     *
8  *   (at your option) version 3.                                           *
9  *                                                                         *
10  *   This program 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 this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20
21 #include "aboutdlg.h"
22
23 #include <QDateTime>
24 #include <QIcon>
25
26 #include "aboutdata.h"
27 #include "quassel.h"
28
29 AboutDlg::AboutDlg(QWidget *parent)
30     : QDialog(parent)
31     , _aboutData(new AboutData(this))
32 {
33     AboutData::setQuasselPersons(_aboutData);
34
35     ui.setupUi(this);
36     ui.quasselLogo->setPixmap(QIcon(":/icons/quassel-64.png").pixmap(64)); // don't let the icon theme affect our logo here
37
38     ui.versionLabel->setText(QString(tr("<b>Version:</b> %1<br><b>Version date:</b> %2<br><b>Protocol version:</b> %3"))
39         .arg(Quassel::buildInfo().fancyVersionString)
40         .arg(Quassel::buildInfo().commitDate)
41         .arg(Quassel::buildInfo().protocolVersion));
42     ui.aboutTextBrowser->setHtml(about());
43     ui.authorTextBrowser->setHtml(authors());
44     ui.contributorTextBrowser->setHtml(contributors());
45     ui.thanksToTextBrowser->setHtml(thanksTo());
46
47     setWindowIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")));
48 }
49
50
51 QString AboutDlg::about() const
52 {
53     QString res;
54     res = tr("<b>A modern, distributed IRC Client</b><br><br>"
55              "&copy;%1 by the Quassel Project<br>"
56              "<a href=\"http://quassel-irc.org\">http://quassel-irc.org</a><br>"
57              "<a href=\"irc://irc.freenode.net/quassel\">#quassel</a> on <a href=\"http://www.freenode.net\">Freenode</a><br><br>"
58              "Quassel IRC is dual-licensed under <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">GPLv2</a> and "
59              "<a href=\"http://www.gnu.org/licenses/gpl-3.0.txt\">GPLv3</a>.<br>"
60              "Most icons are &copy; by the <a href=\"http://www.oxygen-icons.org\">Oxygen Team</a> and used under the "
61              "<a href=\"http://www.gnu.org/licenses/lgpl.html\">LGPL</a>.<br><br>"
62              "Please use <a href=\"http://bugs.quassel-irc.org\">http://bugs.quassel-irc.org</a> to report bugs."
63         ).arg("2005-2016");
64
65     return res;
66 }
67
68
69 QString AboutDlg::authors() const
70 {
71     QString res;
72     res = tr("Quassel IRC is mainly developed by:") + "<dl>";
73     for (const auto &person : _aboutData->authors()) {
74         res.append("<dt><b>" + person.prettyName() + "</b></dt><dd>");
75         if (!person.emailAddress().isEmpty())
76             res.append("<a href=\"mailto:" + person.emailAddress() + "\">" + person.emailAddress() + "</a><br>");
77         res.append("<i>" + person.task() + "</i><br></dd>");
78     }
79     res.append("</dl>");
80     return res;
81 }
82
83
84 QString AboutDlg::contributors() const
85 {
86     QString res;
87     res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:") + "<br><dl>";
88     for (const auto &person : _aboutData->credits()) {
89         res.append("<dt><b>" + person.prettyName() + "</b></dt><dd><i>" + person.task() + "</i><br></dd>");
90     }
91     res.append("</dl>" + tr("...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!"));
92
93     return res;
94 }
95
96
97 QString AboutDlg::thanksTo() const
98 {
99     QString res;
100     res = tr("Special thanks goes to:<br>"
101              "<dl>"
102              "<dt><img src=\":/pics/quassel-eye.png\">&nbsp;<b>John \"nox\" Hand</b></dt>"
103              "<dd><i>for the original Quassel icon - The All-Seeing Eye</i><br></dt>"
104              "<dt><img src=\":/pics/oxygen.png\">&nbsp;<b><a href=\"http://www.oxygen-icons.org\">The Oxygen Team</a></b></dt>"
105              "<dd><i>for creating all the artwork you see throughout Quassel</i><br></dd>"
106              "<dt><img src=\":/pics/qt-logo-32.png\">&nbsp;<b><a href=\"http://www.trolltech.com\">Qt Software formerly known as Trolltech</a></b></dt>"
107              "<dd><i>for creating Qt and Qtopia, and for sponsoring development of QuasselTopia with Greenphones and more</i><br></dd>"
108              "<dt><a href=\"http://www.nokia.com\"><img src=\":/pics/nokia.png\"></a></b></dt>"
109              "<dd><i>for sponsoring development of Quassel Mobile with N810s</i></dd>"
110         );
111
112     return res;
113 }