23 #include "aboutdialog.h"
24 #include "ui_aboutdialog.h"
26 #include "gui/commongui.h"
27 #include "gui/copytextdlg.h"
28 #include "ip2c/ip2c.h"
29 #include "plugins/engineplugin.h"
30 #include "plugins/pluginloader.h"
31 #include "localization.h"
32 #include "strings.hpp"
34 #include <wadseeker/wadseekerversioninfo.h>
39 DClass<AboutDialog> :
public Ui::AboutDialog
50 connect(d->buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(close()));
55 d->versionAbi->setText(QString(
"(ABI: %1)").arg(DOOMSEEKER_ABI_VERSION));
56 d->lblRevision->setText(QString::number(Version::revisionNumber()));
57 d->logo->setPixmap(QPixmap(
":/logo.png"));
58 d->pteCopyrightNotice->setPlainText(copyrightVerboseNotice());
62 QString url = IP2C::instance()->urlDatabase();
63 static const int REASONABLE_URL_LENGTH = 10240;
64 static const int REASONABLE_URL_DISPLAY_LENGTH = 120;
65 if (url.length() > REASONABLE_URL_LENGTH || url.trimmed().isEmpty() || !
Strings::isUrlSafe(url)) {
66 d->linkIP2Cdatabase->setText(AboutDialog::tr(
"<i>No URL available</i>"));
68 url = url.toHtmlEscaped();
70 REASONABLE_URL_DISPLAY_LENGTH / 2 + (REASONABLE_URL_DISPLAY_LENGTH % 2),
71 REASONABLE_URL_DISPLAY_LENGTH / 2);
72 d->linkIP2Cdatabase->setText(QString(
"<a href=\"").append(url).append(
"\">").append(displayUrl).append(
"</a>"));
76 d->wadseekerAuthor->setText(WadseekerVersionInfo::author());
77 d->wadseekerDescription->setText(WadseekerVersionInfo::description());
78 d->wadseekerVersion->setText(WadseekerVersionInfo::version());
79 d->wadseekerYearSpan->setText(WadseekerVersionInfo::yearSpan());
82 for (
unsigned i = 0; i < gPlugins->numPlugins(); ++i)
83 d->pluginBox->addItem( gPlugins->plugin(i)->info()->data()->name);
84 connect(d->pluginBox, SIGNAL(currentIndexChanged(
int)), SLOT(changePlugin(
int)));
90 AboutDialog::~AboutDialog()
94 void AboutDialog::changePlugin(
int pluginIndex)
96 if (static_cast<unsigned>(pluginIndex) >= gPlugins->numPlugins())
99 const EnginePlugin *plug = gPlugins->plugin(pluginIndex)->info();
102 d->pluginDescription->setPlainText(
"");
104 d->pluginDescription->setPlainText(plug->data()->
aboutProvider->provide());
105 d->pluginAuthor->setText(plug->data()->author);
106 d->pluginVersion->setText(QString(
"Version: %1").arg(plug->data()->version));
107 d->pluginAbiVersion->setText(QString(
"(ABI: %1)").arg(plug->data()->abiVersion));
110 QString AboutDialog::copyrightVerboseNotice()
const
115 QStringList paragraphs;
118 QChar copyrightChar(0x00a9);
119 QChar smallAGraveChar(0x00e0);
122 paragraphs << tr(
"Copyright %1 %2 The Doomseeker Team")
123 .arg(copyrightChar).arg(Version::yearSpan());
124 paragraphs << tr(
"This program is distributed under the terms of the LGPL v2.1 or later.");
127 paragraphs << tr(
"Doomseeker translations contributed by:\n")
128 + tr(
"- Polish: Zalewa") +
"\n"
129 + tr(
"- Spanish: Pol Marcet Sard%1").arg(smallAGraveChar) +
"\n"
130 + tr(
"- Catalan: Pol Marcet Sard%1").arg(smallAGraveChar);
133 const auto &licences = IP2C::instance()->licenceNotice();
134 auto it = licences.find(Localization::get()->currentLocalization().localeName);
135 if (it == licences.end())
136 it = licences.find(
"");
137 if (it != licences.end())
138 paragraphs << it.value();
142 icons << tr(
"- Aha-Soft");
143 icons << tr(
"- Crystal Clear by Everaldo Coelho");
144 icons << tr(
"- Fugue Icons (C) 2013 Yusuke Kamiyamane. All rights reserved.");
145 icons << tr(
"- Nuvola 1.0 (KDE 3.x icon set)");
146 icons << tr(
"- Oxygen Icons 4.3.1 (KDE)");
147 icons << tr(
"- Silk Icon Set (C) Mark James (famfamfam.com)");
148 icons << tr(
"- Tango Icon Library / Tango Desktop Project");
149 paragraphs << tr(
"This program uses icons (or derivates of) from following sources:\n") + icons.join(
"\n");
151 return paragraphs.join(
"\n\n");