Replace build date with commit date (#159)
[quassel.git] / src / qtui / aboutdlg.cpp
index 0cb16ba..5661ac9 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
 #include "aboutdlg.h"
-#include "global.h"
 
-AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent) {
-  ui.setupUi(this);
+#include <QDateTime>
+#include <QIcon>
 
-  ui.versionLabel->setText(QString(tr("<b>Version %1</b><br>Protocol version: %2<br>Built: %3 %4")).arg(Global::quasselVersion)
-                          .arg(Global::protocolVersion)
-                          .arg(Global::quasselBuildDate).arg(Global::quasselBuildTime));
-  ui.aboutTextBrowser->setHtml(about());
-  ui.authorTextBrowser->setHtml(authors());
-  ui.contributorTextBrowser->setHtml(contributors());
-  ui.thanksToTextBrowser->setHtml(thanksTo());
+#include "aboutdata.h"
+#include "quassel.h"
 
+AboutDlg::AboutDlg(QWidget *parent)
+    : QDialog(parent)
+    , _aboutData(new AboutData(this))
+{
+    AboutData::setQuasselPersons(_aboutData);
+
+    ui.setupUi(this);
+    ui.quasselLogo->setPixmap(QIcon(":/icons/quassel-64.png").pixmap(64)); // don't let the icon theme affect our logo here
+
+    ui.versionLabel->setText(QString(tr("<b>Version:</b> %1<br><b>Version date:</b> %2<br><b>Protocol version:</b> %3"))
+        .arg(Quassel::buildInfo().fancyVersionString)
+        .arg(Quassel::buildInfo().commitDate)
+        .arg(Quassel::buildInfo().protocolVersion));
+    ui.aboutTextBrowser->setHtml(about());
+    ui.authorTextBrowser->setHtml(authors());
+    ui.contributorTextBrowser->setHtml(contributors());
+    ui.thanksToTextBrowser->setHtml(thanksTo());
+
+    setWindowIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")));
 }
 
-QString AboutDlg::about() const {
-  QString res;
-  res = tr("<b>A modern, distributed IRC Client</b><br><br>"
-           "&copy;2005-2008 by the Quassel Project<br>"
-           "<a href=\"http://quassel-irc.org\">http://quassel-irc.org</a><br>"
-           "<a href=\"irc://irc.freenode.net/quassel\">#quassel</a> on <a href=\"http://www.freenode.net\">Freenode</a><br><br>"
-           "Quassel IRC is dual-licensed under <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">GPLv2</a> and "
-                "<a href=\"http://www.gnu.org/licenses/gpl-3.0.txt\">GPLv3</a>.<br>"
-           "Most icons are &copy; by the <a href=\"http://www.oxygen-icons.org\">Oxygen Team</a> and used under the "
-                "<a href=\"http://www.gnu.org/licenses/lgpl.html\">LGPL</a>.<br><br>"
-           "Please use <a href=\"http://bugs.quassel-irc.org\">http://bugs.quassel-irc.org</a> to report bugs."
-          );
-
-  return res;
+
+QString AboutDlg::about() const
+{
+    QString res;
+    res = tr("<b>A modern, distributed IRC Client</b><br><br>"
+             "&copy;%1 by the Quassel Project<br>"
+             "<a href=\"http://quassel-irc.org\">http://quassel-irc.org</a><br>"
+             "<a href=\"irc://irc.freenode.net/quassel\">#quassel</a> on <a href=\"http://www.freenode.net\">Freenode</a><br><br>"
+             "Quassel IRC is dual-licensed under <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">GPLv2</a> and "
+             "<a href=\"http://www.gnu.org/licenses/gpl-3.0.txt\">GPLv3</a>.<br>"
+             "Most icons are &copy; by the <a href=\"http://www.oxygen-icons.org\">Oxygen Team</a> and used under the "
+             "<a href=\"http://www.gnu.org/licenses/lgpl.html\">LGPL</a>.<br><br>"
+             "Please use <a href=\"http://bugs.quassel-irc.org\">http://bugs.quassel-irc.org</a> to report bugs."
+        ).arg("2005-2016");
+
+    return res;
 }
 
-QString AboutDlg::authors() const {
-  QString res;
-  res = tr("Quassel IRC is mainly developed by:") +
-        "<dl>"
-        "<dt><b>Manuel \"Sputnick\" Nickschas</b></dt><dd><a href=\"mailto:sput@quassel-irc.org\">sput@quassel-irc.org</a><br>"
-             "Project Founder, Lead Developer</dd>"
-        "<dt><b>Marcus \"EgS\" Eggenberger</b></dt><dd><a href=\"mailto:egs@quassel-irc.org\">egs@quassel-irc.org</a><br>"
-             "Project Motivator, Lead Developer, Mac Maintainer</dd>"
-        "<dt><b>Alexander \"phon\" von Renteln</b></dt><dd><a href=\"mailto:phon@quassel-irc.org\">phon@quassel-irc.org</a><br>"
-             "Developer, Windows Maintainer</dd>"
-        "</dl>";
-
-  return res;
+
+QString AboutDlg::authors() const
+{
+    QString res;
+    res = tr("Quassel IRC is mainly developed by:") + "<dl>";
+    for (const auto &person : _aboutData->authors()) {
+        res.append("<dt><b>" + person.prettyName() + "</b></dt><dd>");
+        if (!person.emailAddress().isEmpty())
+            res.append("<a href=\"mailto:" + person.emailAddress() + "\">" + person.emailAddress() + "</a><br>");
+        res.append("<i>" + person.task() + "</i><br></dd>");
+    }
+    res.append("</dl>");
+    return res;
 }
 
-QString AboutDlg::contributors() const {
-  QString res;
-  res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:") + "<br>"
-           "<dl>"
-           "<dt><b>Marco \"kaffeedoktor\" Genise</b></dt><dd><a href=\"mailto:kaffeedoktor@quassel-irc.org\">kaffeedoktor@quassel-irc.org</a><br>"
-                  "Ideas, Hacking, Motivation</dd>"
-           "<dt><b>John \"nox-Hand\" Hand</b></dt><dd>Gorgeous Application and Tray Icons</dd>"
-           "<dt><b>Jonas \"Dante\" Heese</b></dt><dd>Project Founder, ebuilder</dd>"
-           "<dt><b>Diego \"Flameeyes\" Petten&ograve;</b></dt><dd>Gentoo Maintainer</dd>"
-           "<dt><b>Harald \"apachelogger\" Sitter</b></dt><dd>{k|U}buntu packager, Motivator, Promoter</dd>"
-           "<dt><b>Daniel \"son\" Steinmetz</b></dt><dd>Early Beta Tester and Bughunter (on Vista&trade;!)</dd>"
-           "<dt><b>Adam \"adamt\" Tulinius</b></dt><dd>Early Beta Tester and Bughunter, Danish Translation</dd>"
-           "<dt><b>Pavel \"int\" Volkovitskiy</b></dt><dd>Early Beta Tester and Bughunter</dd>"
-           "</dl>";
-
-  return res;
+
+QString AboutDlg::contributors() const
+{
+    QString res;
+    res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:") + "<br><dl>";
+    for (const auto &person : _aboutData->credits()) {
+        res.append("<dt><b>" + person.prettyName() + "</b></dt><dd><i>" + person.task() + "</i><br></dd>");
+    }
+    res.append("</dl>" + tr("...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!"));
+
+    return res;
 }
 
-QString AboutDlg::thanksTo() const {
-  QString res;
-  res = tr("Special thanks goes to:<br>"
-           "<dl>"
-           "<dt><b>John \"nox-Hand\" Hand</b></dt>"
-              "<dd>for great artwork and the Quassel logo/icon</dt>"
-           "<dt><b><a href=\"http://www.oxygen-icons.org\">The Oxygen Team</a></b></dt>"
-              "<dd>for creating most of the other shiny icons you see throughout Quassel</dd>"
-           "<dt><b><a href=\"http://www.trolltech.com\">Trolltech</a></b></dt>"
-              "<dd>for creating Qt and Qtopia, and for sponsoring development of Quasseltopia with Greenphones and more</dd>"
-          );
-
-  return res;
+
+QString AboutDlg::thanksTo() const
+{
+    QString res;
+    res = tr("Special thanks goes to:<br>"
+             "<dl>"
+             "<dt><img src=\":/pics/quassel-eye.png\">&nbsp;<b>John \"nox\" Hand</b></dt>"
+             "<dd><i>for the original Quassel icon - The All-Seeing Eye</i><br></dt>"
+             "<dt><img src=\":/pics/oxygen.png\">&nbsp;<b><a href=\"http://www.oxygen-icons.org\">The Oxygen Team</a></b></dt>"
+             "<dd><i>for creating all the artwork you see throughout Quassel</i><br></dd>"
+             "<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>"
+             "<dd><i>for creating Qt and Qtopia, and for sponsoring development of QuasselTopia with Greenphones and more</i><br></dd>"
+             "<dt><a href=\"http://www.nokia.com\"><img src=\":/pics/nokia.png\"></a></b></dt>"
+             "<dd><i>for sponsoring development of Quassel Mobile with N810s</i></dd>"
+        );
+
+    return res;
 }