Bump copyright year
[qBittorrent.git] / src / gui / aboutdialog.cpp
blob3409850a4007567e20641ed33f31797011fcfd78
1 /*
2 * Bittorrent Client using Qt and libtorrent.
3 * Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * In addition, as a special exception, the copyright holders give permission to
20 * link this program with the OpenSSL project's "OpenSSL" library (or with
21 * modified versions of it that use the same license as the "OpenSSL" library),
22 * and distribute the linked executables. You must obey the GNU General Public
23 * License in all respects for all of the code used other than "OpenSSL". If you
24 * modify file(s), you may extend this exception to your version of the file(s),
25 * but you are not obligated to do so. If you do not wish to do so, delete this
26 * exception statement from your version.
29 #include "aboutdialog.h"
31 #include <QFile>
33 #include "base/unicodestrings.h"
34 #include "base/utils/misc.h"
35 #include "ui_aboutdialog.h"
36 #include "uithememanager.h"
37 #include "utils.h"
39 AboutDialog::AboutDialog(QWidget *parent)
40 : QDialog(parent)
41 , m_ui(new Ui::AboutDialog)
43 m_ui->setupUi(this);
44 setAttribute(Qt::WA_DeleteOnClose);
46 // Title
47 m_ui->labelName->setText(QString::fromLatin1("<b><h2>qBittorrent " QBT_VERSION " (%1-bit)</h2></b>").arg(QT_POINTER_SIZE * 8));
49 m_ui->logo->setPixmap(Utils::Gui::scaledPixmapSvg(UIThemeManager::instance()->getIconPath(QLatin1String("qbittorrent-tray")), this, 32));
51 // About
52 const QString aboutText = QString(
53 "<p style=\"white-space: pre-wrap;\">"
54 "%1\n\n"
55 "%2\n\n"
56 "<table>"
57 "<tr><td>%3</td><td><a href=\"https://www.qbittorrent.org\">https://www.qbittorrent.org</a></td></tr>"
58 "<tr><td>%4</td><td><a href=\"http://forum.qbittorrent.org\">http://forum.qbittorrent.org</a></td></tr>"
59 "<tr><td>%5</td><td><a href=\"http://bugs.qbittorrent.org\">http://bugs.qbittorrent.org</a></td></tr>"
60 "</table>"
61 "</p>")
62 .arg(tr("An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.")
63 , tr("Copyright %1 2006-2021 The qBittorrent project").arg(QString::fromUtf8(C_COPYRIGHT))
64 , tr("Home Page:")
65 , tr("Forum:")
66 , tr("Bug Tracker:"));
67 m_ui->labelAbout->setText(aboutText);
69 m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(":/icons/mascot.png", this));
71 // Thanks
72 QFile thanksfile(":/thanks.html");
73 if (thanksfile.open(QIODevice::ReadOnly | QIODevice::Text))
75 m_ui->textBrowserThanks->setHtml(QString::fromUtf8(thanksfile.readAll().constData()));
76 thanksfile.close();
79 // Translation
80 QFile translatorsfile(":/translators.html");
81 if (translatorsfile.open(QIODevice::ReadOnly | QIODevice::Text))
83 m_ui->textBrowserTranslation->setHtml(QString::fromUtf8(translatorsfile.readAll().constData()));
84 translatorsfile.close();
87 // License
88 QFile licensefile(":/gpl.html");
89 if (licensefile.open(QIODevice::ReadOnly | QIODevice::Text))
91 m_ui->textBrowserLicense->setHtml(QString::fromUtf8(licensefile.readAll().constData()));
92 licensefile.close();
95 // Software Used
96 m_ui->labelQtVer->setText(QT_VERSION_STR);
97 m_ui->labelLibtVer->setText(Utils::Misc::libtorrentVersionString());
98 m_ui->labelBoostVer->setText(Utils::Misc::boostVersionString());
99 m_ui->labelOpensslVer->setText(Utils::Misc::opensslVersionString());
100 m_ui->labelZlibVer->setText(Utils::Misc::zlibVersionString());
102 const QString DBIPText = QString(
103 "<html><head/><body><p>"
104 "%1"
105 " (<a href=\"https://db-ip.com/\">https://db-ip.com/</a>)</p></body></html>")
106 .arg(tr("The free IP to Country Lite database by DB-IP is used for resolving the countries of peers. "
107 "The database is licensed under the Creative Commons Attribution 4.0 International License"));
108 m_ui->labelDBIP->setText(DBIPText);
110 Utils::Gui::resize(this);
111 show();
114 AboutDialog::~AboutDialog()
116 delete m_ui;