From: Manuel Nickschas Date: Wed, 4 Feb 2015 23:20:06 +0000 (+0100) Subject: Simplify the handling of the contributor list in AboutDlg X-Git-Tag: 0.12-beta1~38 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=ef13687df76b292f36f330bed44cf9f35ac53632 Simplify the handling of the contributor list in AboutDlg This introduces an AboutData class akin to KAboutData from KDE Frameworks. Together with brace initialization, which we can now use thanks to C++11, this makes specifying the (huge!) list of contributors to Quassel much nicer, compared to editing a long HTML string. AboutData also can create a KAboutData object that can be used for KF5 integration, and later for showing the native KAboutDialog instead of our own if KDE integration is enabled. The list of contributors has also been synced with the Git history again. If you find your name missing, or want changes, please let us know. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 69424f63..2e152a5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,13 @@ if (USE_QT5) endif() if (WITH_KDE) + find_package(KF5CoreAddons QUIET) + set_package_properties(KF5CoreAddons PROPERTIES TYPE REQUIRED + URL "http://inqlude.org/libraries/kcoreaddons.html" + DESCRIPTION "framework for solving common problems such as caching, randomization, and more" + PURPOSE "Required for KDE Frameworks integration" + ) + find_package(KF5TextWidgets QUIET) set_package_properties(KF5TextWidgets PROPERTIES TYPE REQUIRED URL "http://inqlude.org/libraries/ktextwidgets.html" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e24ea40..62219306 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,6 +30,11 @@ if (WITH_OXYGEN) add_definitions(-DWITH_OXYGEN) endif() +# For KAboutData +if (WITH_KF5) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} KF5::CoreAddons) +endif() + # Needed for showing the cli option if appropriate if (HAVE_SYSLOG) add_definitions(-DHAVE_SYSLOG) diff --git a/src/common/main.cpp b/src/common/main.cpp index 9d87c4b8..9d75da4e 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -25,8 +25,10 @@ #ifdef BUILD_CORE # include "coreapplication.h" #elif defined BUILD_QTUI +# include "aboutdata.h" # include "qtuiapplication.h" #elif defined BUILD_MONO +# include "aboutdata.h" # include "monoapplication.h" #else @@ -37,10 +39,17 @@ #if defined HAVE_KDE4 && defined BUILD_CORE # undef HAVE_KDE4 #endif +// We don't want quasselcore to depend on KDE +#if defined HAVE_KF5 && defined BUILD_CORE +# undef HAVE_KF5 +#endif #ifdef HAVE_KDE4 # include # include "kcmdlinewrapper.h" +#elif defined HAVE_KF5 +# include +# include "qt5cliparser.h" #elif defined HAVE_QT5 # include "qt5cliparser.h" #else @@ -97,7 +106,6 @@ int main(int argc, char **argv) #ifdef HAVE_KDE4 // We need to init KCmdLineArgs first - // TODO: build an AboutData compat class to replace our aboutDlg strings KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(), ki18n("A modern, distributed IRC client")); aboutData.addLicense(KAboutData::License_GPL_V2); @@ -116,6 +124,7 @@ int main(int argc, char **argv) // Initialize CLI arguments // NOTE: We can't use tr() at this point, since app is not yet created + // TODO: Change this once we get rid of KDE4 and can initialize the parser after creating the app // put shared client&core arguments here cliParser->addSwitch("debug", 'd', "Enable debug output"); @@ -181,6 +190,15 @@ int main(int argc, char **argv) } #endif - if (!app.init()) return EXIT_FAILURE; + if (!app.init()) + return EXIT_FAILURE; + +#ifdef HAVE_KF5 + // FIXME: This should be done after loading the translation catalogue, but still in main() + AboutData aboutData; + AboutData::setQuasselPersons(&aboutData); + KAboutData::setApplicationData(aboutData.kAboutData()); +#endif + return app.exec(); } diff --git a/src/qtui/aboutdlg.cpp b/src/qtui/aboutdlg.cpp index 68fd6554..582fe932 100644 --- a/src/qtui/aboutdlg.cpp +++ b/src/qtui/aboutdlg.cpp @@ -18,14 +18,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include "aboutdlg.h" + #include #include -#include "aboutdlg.h" +#include "aboutdata.h" #include "quassel.h" -AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent) +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 @@ -63,16 +69,14 @@ QString AboutDlg::about() const QString AboutDlg::authors() const { QString res; - res = tr("Quassel IRC is mainly developed by:") + - "
" - "
Manuel \"Sputnick\" Nickschas
sput@quassel-irc.org
" - "Project Founder, Lead Developer
" - "
Marcus \"EgS\" Eggenberger
egs@quassel-irc.org
" - "Project Motivator, Lead Developer, Mac Maintainer
" - "
Alexander \"phon\" von Renteln
phon@quassel-irc.org
" - "Developer, Windows Maintainer
" - "
"; - + res = tr("Quassel IRC is mainly developed by:") + "
"; + for (const auto &person : _aboutData->authors()) { + res.append("
" + person.prettyName() + "
"); + if (!person.emailAddress().isEmpty()) + res.append("" + person.emailAddress() + "
"); + res.append(person.task() + "
"); + } + res.append("
"); return res; } @@ -80,126 +84,11 @@ QString AboutDlg::authors() const 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:") - + QString::fromUtf8("
" - "
" - "
Daniel \"al\" Albers
Master Of Translation, many fixes and enhancements
" - "
Liudas Alisauskas
Lithuanian translation
" - "
Terje \"tan\" Andersen
Norwegian translation, documentation
" - "
Jens \"amiconn\" Arnold
Postgres migration fixes
" - "
Adolfo Jayme Barrientos
Spanish translation
" - "
Mattia Basaglia
Fixes
" - "
Pete \"elbeardmorez\" Beardmore
Linewrap for input line
" - "
Rafael \"EagleScreen\" Belmonte
Spanish translation
" - "
Sergiu Bivol
Romanian translation
" - "
Bruno Brigras
Crash fixes
" - "
Florent Castelli
Sanitize topic handling
" - "
Theo \"tampakrap\" Chatzimichos
Greek translation
" - "
Yuri Chornoivan
Ukrainian translation
" - "
Tomáš \"scarabeus\" Chvátal
Czech translation
" - "
\"Condex\"
Galician translation
" - "
Joshua \"tvakah\" Corbin
Various fixes
" - "
\"cordata\"
Esperanto translation
" - "
Matthias \"pennywise\" Coy
German translation
" - "
\"derpella\"
Polish translation
" - "
\"Dorian\"
French translation
" - "
Luke Faraone
Doc fixes
" - "
Chris \"stitch\" Fuenty
SASL support
" - "
Kevin \"KRF\" Funk
German translation
" - "
Fabiano \"elbryan\" Francesconi
Italian translation
" - "
Leo Franchi
OSX improvements
" - "
Sebastien Fricker
Audio backend improvements
" - "
Alf Gaida
Language improvements
" - "
Aurélien \"agateau\" Gâteau
Message Indicator support
" - "
Marco \"kaffeedoktor\" Genise
Ideas, hacking, motivation
" - "
Felix \"debfx\" Geyer
Certificate handling improvements
" - "
Volkan Gezer
Turkish translation
" - "
Sjors \"dazjorz\" Gielen
Fixes
" - "
Sebastian \"seezer\" Goth
Many improvements and features
" - "
Michael \"brot\" Groh
German translation, fixes
" - "
\"Gryllida\"
IRC parser improvements
" - "
H. İbrahim \"igungor\" Güngör
Turkish translation
" - "
Jiri Grönroos
Finnish translation
" - "
Chris \"Zren\" H
Various improvements
" - "
Edward Hades
Russian translation
" - "
John \"nox\" Hand
Former All-Seeing Eye logo
" - "
Adam \"2kah\" Harwood
ChatView improvements
" - "
Jonas \"Dante\" Heese
Project founder, various improvements
" - "
Thomas \"Datafreak\" Hogh
Windows builder
" - "
Johannes \"j0hu\" Huber
Many fixes and features, bug triaging
" - "
Theofilos Intzoglou
Greek translation
" - "
Jovan Jojkić
Serbian translation
" - "
Allan Jude
Documentation improvements
" - "
Michael \"ycros\" Kedzierski
Mac fixes
" - "
Scott \"ScottK\" Kitterman
Kubuntu nightly packager, (packaging/build system) bughunter
" - "
Paul \"Haudrauf\" Klumpp
Initial design and mainwindow layout
" - "
Maia Kozheva
Russian translation
" - "
Tae-Hoon Kwon
Korean translation
" - "
\"Larso\"
Finnish translation
" - "
Patrick \"bonsaikitten\" Lauer
Gentoo packaging
" - "
Chris \"Fish-Face\" Le Sueur
Various fixes and improvements
" - "
Jerome \"Adys\" Leclanche
Context menu fixes
" - "
Hendrik \"nevcairiel\" Leppkes
Various features
" - "
Jason Lynch
Bugfixes
" - "
Awad \"firesock\" Mackie
ChatView improvements
" - "
Michael \"mamarley\" Marley
Various fixes and improvements
" - "
Martin \"m4yer\" Mayer
German translation
" - "
Daniel \"hydrogen\" Meltzer
Various fixes and improvements
" - "
Sebastian Meyer
Fixes
" - "
Daniel E. Moctezuma
Japanese translation
" - "
Chris \"kode54\" Moeller
Various fixes and improvements
" - "
Thomas Müller
Fixes, Debian packaging
" - "
Gábor \"ELITE_x\" Németh
Hungarian translation
" - "
Per Nielsen
Danish translation
" - "
J-P Nurmi
Fixes
" - "
Marco \"Quizzlo\" Paolone
Italian translation
" - "
Bas \"Tucos\" Pape
Many fixes and improvements, bug and patch triaging, tireless community support
" - "
Bruno Patri
French translation
" - "
Drew \"LinuxDolt\" Patridge
BluesTheme stylesheet
" - "
Celeste \"seele\" Paul
Usability Queen
" - "
Vit Pelcak
Czech translation
" - "
Regis \"ZRegis\" Perrin
French translation
" - "
Diego \"Flameeyes\" Pettenò
Gentoo maintainer, build system improvements
" - "
Simon Philips
Dutch translation
" - "
Daniel \"billie\" Pielmeier
Gentoo maintainer
" - "
Nuno \"pinheiro\" Pinheiro
Tons of Oxygen icons including our application icon
" - "
David Planella
Translation system fixes
" - "
Jure \"JLP\" Repinc
Slovenian translation
" - "
Patrick \"TheOneRing\" von Reth
MinGW support, SNORE backend, Windows packager
" - "
Dirk \"MarcLandis\" Rettschlag
Various fixes and new features
" - "
Miguel Revilla
Spanish translation
" - "
Jaak Ristioja
Fixes
" - "
David \"Bombe\" Roden
Fixes
" - "
Henning \"honk\" Rohlfs
Various fixes
" - "
Stella \"differentreality\" Rouzi
Greek translation
" - "
\"salnx\"
Highlight configuration improvements
" - "
Martin \"sandsmark\" Sandsmark
Core fixes, Quasseldroid
" - "
David Sansome
OSX Notification Center support
" - "
Dennis \"DevUrandom\" Schridde
D-Bus notifications
" - "
Jussi \"jussi01\" Schultink
Tireless tester, {ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol
" - "
Tim \"xAFFE\" Schumacher
Fixes and feedback
" - "
\"sfionov\"
Russian translation
" - "
Harald \"apachelogger\" Sitter
{ku|U}buntu packager, motivator, promoter
" - "
Ramanathan Sivagurunathan
Fixes
" - "
Stefanos Sofroniou
Greek translation
" - "
Rüdiger \"ruediger\" Sonderfeld
Emacs keybindings
" - "
Alexander Stein
Tray icon fix
" - "
Daniel \"son\" Steinmetz
Early beta tester and bughunter (on Vista™!)
" - "
Jesper Thomschütz
Various fixes
" - "
Arthur \"roentgen\" Titeica
Romanian translation
" - "
\"ToBeFree\"
German translation
" - "
Edward \"Aides\" Toroshchin
Russian translation
" - "
Adam \"adamt\" Tulinius
Early beta tester and bughunter, Danish translation
" - "
Deniz Türkoglu
Mac fixes
" - "
Frederik M.J. \"freqmod\" Vestre
Norwegian translation
" - "
Atte Virtanen
Finnish translation
" - "
Pavel \"int\" Volkovitskiy
Early beta tester and bughunter
" - "
Roscoe van Wyk
Fixes
" - "
Zé
Portuguese translation
" - "
Benjamin \"zbenjamin\" Zeller
Windows build system fixes
" - "
\"zeugma\"
Turkish translation
" - "

" - "...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!"); + res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:") + "
"; + for (const auto &person : _aboutData->credits()) { + res.append("
" + person.prettyName() + "
" + person.task() + "
"); + } + res.append("

" + tr("...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!")); return res; } diff --git a/src/qtui/aboutdlg.h b/src/qtui/aboutdlg.h index d9fe3c28..d54df8c9 100644 --- a/src/qtui/aboutdlg.h +++ b/src/qtui/aboutdlg.h @@ -25,6 +25,8 @@ #include "ui_aboutdlg.h" +class AboutData; + class AboutDlg : public QDialog { Q_OBJECT @@ -39,6 +41,8 @@ private: QString authors() const; QString contributors() const; QString thanksTo() const; + + AboutData *_aboutData; }; diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index c0d6e4bd..0b78acc9 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -1,6 +1,7 @@ # Builds the uisupport module set(SOURCES + aboutdata.cpp abstractbuffercontainer.cpp abstractitemview.cpp action.cpp @@ -58,5 +59,5 @@ if (WITH_KDE4) endif() if (WITH_KF5) - target_link_libraries(mod_uisupport KF5::TextWidgets) + target_link_libraries(mod_uisupport KF5::CoreAddons KF5::TextWidgets) endif() diff --git a/src/uisupport/aboutdata.cpp b/src/uisupport/aboutdata.cpp new file mode 100644 index 00000000..561f5e80 --- /dev/null +++ b/src/uisupport/aboutdata.cpp @@ -0,0 +1,299 @@ +/*************************************************************************** + * Copyright (C) 2005-2015 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "aboutdata.h" + +#include + +#include "quassel.h" + + +AboutPerson::AboutPerson(const QString &name, const QString &nick, const QString &task, const QString &emailAddress, QLocale::Language translatedLanguage) + : _name(name) + , _nick(nick) + , _task(task) + , _emailAddress(emailAddress) + , _language(translatedLanguage) +{ + +} + + +QString AboutPerson::name() const +{ + return _name; +} + + +QString AboutPerson::nick() const +{ + return _nick; +} + + +QString AboutPerson::task() const +{ + return _task; +} + + +QString AboutPerson::emailAddress() const +{ + return _emailAddress; +} + + +QLocale::Language AboutPerson::translatedLanguage() const +{ + return _language; +} + + +QString AboutPerson::prettyName() const +{ + if (!name().isEmpty() && !nick().isEmpty()) + return name() + " (" + nick() + ')'; + + if (name().isEmpty() && !nick().isEmpty()) + return nick(); + + return name(); +} + + +/**************************************************************************************************/ + + +AboutData::AboutData(QObject *parent) + : QObject(parent) +{ + +} + + +QList AboutData::authors() const +{ + return _authors; +} + + +QList< AboutPerson > AboutData::credits() const +{ + return _credits; +} + + +AboutData &AboutData::addAuthor(const AboutPerson &author) +{ + _authors.append(author); + return *this; +} + + +AboutData &AboutData::addAuthors(std::initializer_list authors) +{ + _authors.append(authors); + return *this; +} + + +AboutData &AboutData::addCredit(const AboutPerson &credit) +{ + _credits.append(credit); + return *this; +} + + +AboutData &AboutData::addCredits(std::initializer_list credits) +{ + _credits.append(credits); + return *this; +} + +#ifdef HAVE_KF5 + +KAboutData AboutData::kAboutData() const +{ + KAboutData aboutData( + Quassel::buildInfo().applicationName, + tr("Quassel IRC"), + Quassel::buildInfo().plainVersionString + ); + aboutData.addLicense(KAboutLicense::GPL_V2); + aboutData.addLicense(KAboutLicense::GPL_V3); + aboutData.setShortDescription(tr("A modern, distributed IRC client")); + aboutData.setProgramLogo(QVariant::fromValue(QImage(":/pics/quassel-logo.png"))); + aboutData.setBugAddress("http://bugs.quassel-irc.org/projects/quassel-irc/issues/new"); + aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8()); + + for (const auto &person : authors()) { + aboutData.addAuthor(person.prettyName(), person.task(), person.emailAddress()); + } + + for (const auto &person : credits()) { + aboutData.addCredit(person.prettyName(), person.task(), person.emailAddress()); + } + + return aboutData; +} + +#endif + + +/**************************************************************************************************/ + +/* + * NOTE: The list of contributors was retrieved from the Git history, but sometimes things fall + * through the cracks... especially for translations, we don't have an easy way to track + * contributors' names. + * If you find wrong data for yourself, want your nickname and/or mail addresses added or + * removed, or feel left out or unfairly credited, please don't hesitate to let us know! We + * do want to credit everyone who has contributed to Quassel development. + */ + +void AboutData::setQuasselPersons(AboutData *aboutData) +{ + aboutData->addAuthors({ + { "Manuel Nickschas", "Sputnick", tr("Project Founder, Lead Developer"), "sputnick@quassel-irc.org" }, + { "Marcus Eggenberger", "EgS", tr("Project Motivator, Lead Developer"), "egs@quassel-irc.org" }, + { "Alexander von Renteln", "phon", tr("Former Lead Developer"), "phon@quassel-irc.org" }, + { "Daniel Albers", "al", tr("Master of Translation, many fixes and enhancements") }, + { "Sebastian Goth", "seezer", tr("Many features, fixes and improvements") }, + { "Bas Pape", "Tucos", tr("Many fixes and improvements, bug and patch triaging, community support") }, + }); + + aboutData->addCredits({ + { "Adam Harwood", "2kah", tr("Chatview improvements") }, + { "Adam Tulinius", "adamt", tr("Early beta tester and bughunter, Danish translation"), "", QLocale::Danish }, + { "Adolfo Jayme Barrientos", "", tr("Spanish translation"), "", QLocale::Spanish }, + { "Alexander Stein", "", tr("Tray icon fix") }, + { "Alf Gaida", "agaida", tr("Language improvements") }, + { "Allan Jude", "", tr("Documentation improvements") }, + { "Arthur Titeica", "roentgen", tr("Romanian translation"), "", QLocale::Romanian }, + { "Atte Virtanen", "", tr("Finnish translation"), "", QLocale::Finnish }, + { "Aurélien Gâteau", "agateau", tr("Message indicator support") }, + { "Awad Mackie", "firesock", tr("Chatview improvements") }, + { "Benjamin Zeller", "zbenjamin", tr("Windows build system fixes") }, + { "Bruno Brigras", "", tr("Crash fixes") }, + { "Bruno Patri", "", tr("French translation"), "", QLocale::French }, + { "Celeste Paul", "seele", tr("Usability review") }, + { "Chris Fuenty", "stitch", tr("SASL support") }, + { "Chris H", "Zren", tr("Various improvements") }, + { "Chris Le Sueur", "Fish-Face", tr("Various fixes and improvements") }, + { "Chris Moeller", "kode54", tr("Various fixes and improvements") }, + { "", "Condex", tr("Galician translation"), "", QLocale::Galician }, + { "", "cordata", tr("Esperanto translation"), "", QLocale::Esperanto }, + { "Daniel E. Moctezuma", "", tr("Japanese translation"), "", QLocale::Japanese }, + { "Daniel Meltzer", "hydrogen", tr("Various fixes and improvements") }, + { "Daniel Pielmeier", "billie", tr("Gentoo maintainer") }, + { "Daniel Steinmetz", "son", tr("Early beta tester and bughunter (on Vista™!)") }, + { "David Planella", "", tr("Translation system fixes") }, + { "David Sansome", "", tr("OSX Notification Center support") }, + { "David Roden", "Bombe", tr("Fixes") }, + { "Deniz Türkoglu", "", tr("Mac fixes") }, + { "Dennis Schridde", "devurandom", tr("D-Bus notifications") }, + { "", "derpella", tr("Polish translation"), "", QLocale::Polish }, + { "Diego Pettenò", "Flameeyes", tr("Build system improvements") }, + { "Dirk Rettschlag", "MarcLandis", tr("Formatting support and other input line improvements, many other fixes") }, + { "", "Dorian", tr("French translation"), "", QLocale::French }, + { "Drew Patridge", "LinuxDolt", tr("BluesTheme stylesheet") }, + { "Edward Hades", "", tr("Russian translation"), "", QLocale::Russian }, + { "Fabiano Francesconi", "elbryan", tr("Italian translation"), "", QLocale::Italian }, + { "Felix Geyer", "debfx", tr("Certificate handling improvements") }, + { "Florent Castelli", "", tr("Sanitize topic handling") }, + { "Frederik M.J. Vestre", "freqmod", tr("Norwegian translation"), "", QLocale::Norwegian }, + { "Gábor Németh", "ELITE_x", tr("Hungarian translation"), "", QLocale::Hungarian }, + { "Gryllida A", "gry", tr("IRC parser improvements") }, + { "H. İbrahim Güngör", "igungor", tr("Turkish translation"), "", QLocale::Turkish }, + { "Harald Fernengel", "harryF", tr("Initial Qt5 support") }, + { "Harald Sitter", "apachelogger", tr("{Ku|U}buntu packager, motivator, promoter") }, + { "Hendrik Leppkes", "nevcairiel", tr("Various features") }, + { "Henning Rohlfs", "honk", tr("Various fixes") }, + { "J-P Nurmi", "", tr("Various fixes") }, + { "Jaak Ristioja", "", tr("Bugfixes") }, + { "Jason Lynch", "", tr("Bugfixes") }, + { "Jens Arnold", "amiconn", tr("Postgres migration fixes") }, + { "Jerome Leclanche", "Adys", tr("Context menu fixes") }, + { "Jesper Thomschütz", "", tr("Various fixes") }, + { "Jiri Grönroos", "", tr("Finnish translation"), "", QLocale::Finnish }, + { "Johannes Huber", "johu", tr("Many fixes and improvements, bug triaging") }, + { "John Hand", "nox", tr("Original \"All-Seeing Eye\" logo") }, + { "Jonas Heese", "Dante", tr("Project founder, various improvements") }, + { "Joshua T Corbin", "tvakah", tr("Various fixes") }, + { "Jovan Jojkić", "", tr("Serbian translation"), "", QLocale::Serbian }, + { "Jure Repinc", "JLP", tr("Slovenian translation"), "", QLocale::Slovenian }, + { "Jussi Schultink", "jussi01", tr("Tireless tester, {Ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol") }, + { "K. Ernest Lee", "iFire", tr("Qt5 porting help, Travis CI setup") }, + { "Kevin Funk", "KRF", tr("German translation"), "", QLocale::German }, + { "", "Larso", tr("Finnish translation"), "", QLocale::Finnish }, + { "Lasse Liehu", "", tr("Finnish translation"), "", QLocale::Finnish }, + { "Leo Franchi", "", tr("OSX improvements") }, + { "Liudas Alisauskas", "", tr("Lithuanian translation"), "", QLocale::Lithuanian }, + { "Luke Faraone", "", tr("Documentation fixes") }, + { "Maia Kozheva", "", tr("Russian translation"), "", QLocale::Russian }, + { "Marco Genise", "kaffeedoktor", tr("Ideas, hacking, initial motivation") }, + { "Marco Paolone", "Quizzlo", tr("Italian translation"), "", QLocale::Italian }, + { "Martin Mayer", "m4yer", tr("German translation"), "", QLocale::German }, + { "Martin Sandsmark", "sandsmark", tr("Core and other fixes, QuasselDroid") }, + { "Matthias Coy", "pennywise", tr("German translation"), "", QLocale::German }, + { "Mattia Basaglia", "", tr("Fixes") }, + { "Michael Groh", "brot", tr("German translation, fixes"), "", QLocale::German }, + { "Michael Kedzierski", "ycros", tr("Mac fixes") }, + { "Michael Marley", "mamarley", tr("Many fixes and improvements; Ubuntu live packages") }, + { "Miguel Revilla", "", tr("Spanish translation"), "", QLocale::Spanish }, + { "Nuno Pinheiro", "", tr("Tons of Oxygen icons including the Quassel logo") }, + { "Patrick Lauer", "bonsaikitten", tr("Gentoo maintainer") }, + { "Patrick von Reth", "TheOneRing", tr("MinGW support, SNORE backend, Windows packaging") }, + { "Paul Klumpp", "Haudrauf", tr("Initial design and main window layout") }, + { "Pavel Volkovitskiy", "int", tr("Early beta tester and bughunter") }, + { "Per Nielsen", "", tr("Danish translation"), "", QLocale::Danish }, + { "Pete Beardmore", "elbeardmorez", tr("Linewrap for input line") }, + { "Ramanathan Sivagurunathan", "", tr("Bugfixes") }, + { "Regis Perrin", "ZRegis", tr("French translation"), "", QLocale::French }, + { "Rolf Eike Beer", "", tr("Build system fixes") }, + { "Roscoe van Wyk", "", tr("Bugfixes") }, + { "Rüdiger Sonderfeld", "ruediger", tr("Emacs keybindings") }, + { "", "salnx", tr("Highlight configuration improvements") }, + { "Scott Kitterman", "ScottK", tr("Kubuntu packager, (packaging/build system) bughunter") }, + { "Sebastian Meyer", "", tr("Bugfixes") }, + { "Sebastien Fricker", "", tr("Audio backend improvements") }, + { "", "sfionov", tr("Russian translation"), "", QLocale::Russian }, + { "Simon Philips", "", tr("Dutch translation"), "", QLocale::Dutch }, + { "Sjors Gielen", "dazjorz", tr("Bugfixes") }, + { "Stefanos Sofroniou", "", tr("Greek translation"), "", QLocale::Greek }, + { "Stella Rouzi", "differentreality", tr("Greek translation"), "", QLocale::Greek }, + { "Rafael Belmonte", "EagleScreen", tr("Spanish translation"), "", QLocale::Spanish }, + { "Sergiu Bivol", "", tr("Romanian translation"), "", QLocale::Romanian }, + { "Tae-Hoon Kwon", "", tr("Korean translation"), "", QLocale::Korean }, + { "Terje Andersen", "tan", tr("Norwegian translation, documentation") }, + { "Theo Chatzimichos", "tampakrap", tr("Greek translation"), "", QLocale::Greek }, + { "Theofilos Intzoglou", "", tr("Greek translation"), "", QLocale::Greek }, + { "Thomas Hogh", "Datafreak", tr("Former Windows builder") }, + { "Thomas Müller", "", tr("Fixes, Debian packaging") }, + { "Tim Schumacher", "xAFFE", tr("Fixes and feedback") }, + { "", "ToBeFree", tr("German translation"), "", QLocale::German }, + { "Tomáš Chvátal", "scarabeus", tr("Czech translation"), "", QLocale::Czech }, + { "Vit Pelcak", "", tr("Czech translation"), "", QLocale::Czech }, + { "Volkan Gezer", "", tr("Turkish translation"), "", QLocale::Turkish }, + { "Yuri Chornoivan", "", tr("Ukrainian translation"), "", QLocale::Ukrainian }, + { "Zé", "", tr("Portuguese translation"), "", QLocale::Portuguese }, + { "", "zeugma", tr("Turkish translation"), "", QLocale::Turkish } + }); +} diff --git a/src/uisupport/aboutdata.h b/src/uisupport/aboutdata.h new file mode 100644 index 00000000..6c306be9 --- /dev/null +++ b/src/uisupport/aboutdata.h @@ -0,0 +1,194 @@ +/*************************************************************************** + * Copyright (C) 2005-2015 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#pragma once + +#include + +#ifdef HAVE_KF5 +# include +#endif + + +/** + * Represents a contributor or author for Quassel. + * + * This is used to show a list of contributors in the About Quassel dialog. + */ +class AboutPerson +{ +public: + /** + * Constructor. + * + * @param[in] name The person's name (in the form "Firstname Surname") + * @param[in] nick The person's nickname, if applicable + * @param[in] task Things the person does or has done for the project + * @param[in] emailAddress The person's email address, if applicable + * @param[in] translatedLanguage The language the person helped translate (only applicable for translators) + */ + AboutPerson(const QString &name, const QString &nick, const QString &task, const QString &emailAddress = QString(), QLocale::Language translatedLanguage = QLocale::C); + + /** + * Gets the person's name. + * + * @returns The person's name + */ + QString name() const; + + /** + * Gets the person's nick. + * + * @returns The person's nick + */ + QString nick() const; + + /** + * Gets the person's task. + * + * @returns The person's task + */ + QString task() const; + + /** + * Gets the person's e-mail address. + * + * @returns The person's e-mail address + */ + QString emailAddress() const; + + /** + * Gets the language this person helped translate. + * + * @returns The language this person helped translate + */ + QLocale::Language translatedLanguage() const; + + /** + * Gets the person's formatted name and nick. + * + * @returns The person's name and nick formatted for combined output + */ + QString prettyName() const; + +private: + QString _name; ///< The person's name + QString _nick; ///< The person's nick + QString _task; ///< The person's task + QString _emailAddress; ///< The person's email address + QLocale::Language _language; ///< The language the person helps translate +}; + + +/** + * Holds a list of authors, contributors and translators. + * + * This class is meant to hold the list of people who contributed to Quassel, used for displaying + * the About Quassel dialog. Additionally, this class can provide a KAboutData object to be shown + * if KDE integration is enabled. + */ +class AboutData : public QObject +{ + Q_OBJECT +public: + /** + * Default constructor. + * + * @param[in] parent The parent object, if applicable + */ + AboutData(QObject *parent = nullptr); + + /** + * Adds an author to the list of contributors. + * + * Authors are people who contributed a significant amount of code to Quassel. + * + * @param[in] author The author to add + * @returns A reference to this AboutData instance + */ + AboutData &addAuthor(const AboutPerson &author); + + /** + * Adds a list of authors to the list of contributors. + * + * This method allows the use of a brace initializer in order to easily add a long list of + * people. + * + * @param[in] authors A list of authors to add + * @returns A reference to this AboutData instance + */ + AboutData &addAuthors(std::initializer_list authors); + + /** + * Adds a contributor. + * + * @param[in] author The contributor to add + * @returns A reference to this AboutData instance + */ + AboutData &addCredit(const AboutPerson &credit); + + /** + * Adds a list of contributors. + * + * This method allows the use of brace initializers in order to easily add a long list of + * people. + * + * @param[in] authors A list of contributors to add + * @returns A reference to this AboutData instance + */ + AboutData &addCredits(std::initializer_list credits); + + /** + * Gets the list of authors stored in this AboutData instance. + * + * @returns A list of authors + */ + QList authors() const; + + /** + * Gets the list of non-author contributors stored in this AboutData instance. + * + * @returns A list of contributors + */ + QList credits() const; + +#ifdef HAVE_KF5 + /** + * Creates a KAboutData instance based on the contents of this AboutData instance. + * + * @returns A KAboutData instance holding the list of contributors as well as any additional + * data required for KAboutDialog and friends + */ + KAboutData kAboutData() const; +#endif + + /** + * Fills the given AboutData instance with data relevant for Quassel itself. + * + * This method adds a (hardcoded) list of contributors to the given AboutData instance. + * + * @param[in,out] aboutData An existing AboutData instance to add Quassel's contributors to + */ + static void setQuasselPersons(AboutData *aboutData); + +private: + QList _authors; ///< The list of authors + QList _credits; ///< The list of other contributors +};