2016-02-11 04:59:44 -07:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-02-11 04:59:44 -07:00
|
|
|
|
2021-12-09 19:22:16 -07:00
|
|
|
#include "DolphinQt/AboutDialog.h"
|
|
|
|
|
2016-02-11 04:59:44 -07:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QTextEdit>
|
|
|
|
#include <QVBoxLayout>
|
2019-10-13 08:04:13 -06:00
|
|
|
#include <QtGlobal>
|
2016-02-11 04:59:44 -07:00
|
|
|
|
2017-09-09 13:52:35 -06:00
|
|
|
#include "Common/Version.h"
|
2018-05-27 19:48:04 -06:00
|
|
|
|
2018-07-06 16:40:15 -06:00
|
|
|
#include "DolphinQt/Resources.h"
|
2016-02-11 04:59:44 -07:00
|
|
|
|
|
|
|
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
|
|
|
{
|
|
|
|
setWindowTitle(tr("About Dolphin"));
|
2017-06-29 18:52:53 -06:00
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
2016-02-11 04:59:44 -07:00
|
|
|
|
2024-03-22 23:18:56 -06:00
|
|
|
QString branch_str = QString::fromStdString(Common::GetScmBranchStr());
|
|
|
|
const int commits_ahead = Common::GetScmCommitsAheadMaster();
|
|
|
|
if (commits_ahead > 0)
|
|
|
|
{
|
|
|
|
branch_str = tr("%1 (%2)").arg(
|
|
|
|
branch_str,
|
|
|
|
// i18n: A positive number of version control commits made compared to some named branch
|
|
|
|
tr("%1 commit(s) ahead of %2").arg(commits_ahead).arg(QStringLiteral("master")));
|
|
|
|
}
|
|
|
|
|
2019-10-13 08:04:13 -06:00
|
|
|
const QString text =
|
|
|
|
QStringLiteral(R"(
|
|
|
|
<p style='font-size:38pt; font-weight:400;'>Dolphin</p>
|
|
|
|
|
|
|
|
<p style='font-size:18pt;'>%VERSION_STRING%</p>
|
|
|
|
|
|
|
|
<p style='font-size: small;'>
|
2021-04-26 16:23:30 -06:00
|
|
|
%BRANCH%<br>
|
2019-10-13 08:04:13 -06:00
|
|
|
%REVISION%<br><br>
|
|
|
|
%QT_VERSION%
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
%CHECK_FOR_UPDATES%: <a href='https://dolphin-emu.org/download'>dolphin-emu.org/download</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
%ABOUT_DOLPHIN%
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
%GAMES_YOU_OWN%
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2021-08-17 20:34:53 -06:00
|
|
|
<a href='https://github.com/dolphin-emu/dolphin/blob/master/COPYING'>%LICENSE%</a> |
|
2019-10-13 08:04:13 -06:00
|
|
|
<a href='https://github.com/dolphin-emu/dolphin/graphs/contributors'>%AUTHORS%</a> |
|
|
|
|
<a href='https://forums.dolphin-emu.org/'>%SUPPORT%</a>
|
|
|
|
)")
|
|
|
|
.replace(QStringLiteral("%VERSION_STRING%"),
|
2022-01-13 16:04:22 -07:00
|
|
|
QString::fromUtf8(Common::GetScmDescStr().c_str()))
|
2019-10-13 08:04:13 -06:00
|
|
|
.replace(QStringLiteral("%BRANCH%"),
|
|
|
|
// i18n: "Branch" means the version control term, not a literal tree branch.
|
2024-03-22 23:18:56 -06:00
|
|
|
tr("Branch: %1").arg(branch_str))
|
2019-10-13 08:04:13 -06:00
|
|
|
.replace(QStringLiteral("%REVISION%"),
|
2022-01-13 16:04:22 -07:00
|
|
|
tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str())))
|
2019-10-13 08:04:13 -06:00
|
|
|
.replace(QStringLiteral("%QT_VERSION%"),
|
|
|
|
tr("Using Qt %1").arg(QStringLiteral(QT_VERSION_STR)))
|
|
|
|
.replace(QStringLiteral("%CHECK_FOR_UPDATES%"), tr("Check for updates"))
|
|
|
|
.replace(QStringLiteral("%ABOUT_DOLPHIN%"),
|
|
|
|
// i18n: The word "free" in the standard phrase "free and open source"
|
|
|
|
// is "free" as in "freedom" - it refers to certain properties of the
|
|
|
|
// software's license, not the software's price. (It is true that Dolphin
|
|
|
|
// can be downloaded at no cost, but that's not what this message says.)
|
|
|
|
tr("Dolphin is a free and open-source GameCube and Wii emulator."))
|
|
|
|
.replace(QStringLiteral("%GAMES_YOU_OWN%"),
|
|
|
|
tr("This software should not be used to play games you do not legally own."))
|
|
|
|
.replace(QStringLiteral("%LICENSE%"), tr("License"))
|
|
|
|
.replace(QStringLiteral("%AUTHORS%"), tr("Authors"))
|
|
|
|
.replace(QStringLiteral("%SUPPORT%"), tr("Support"));
|
2016-02-11 04:59:44 -07:00
|
|
|
|
|
|
|
QLabel* text_label = new QLabel(text);
|
|
|
|
text_label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
|
|
|
text_label->setOpenExternalLinks(true);
|
|
|
|
|
2019-10-13 08:04:13 -06:00
|
|
|
QLabel* copyright = new QLabel(
|
|
|
|
QStringLiteral("<small>%1</small>")
|
|
|
|
.arg(
|
|
|
|
// i18n: This message uses curly quotes in English. If you want to use curly quotes
|
|
|
|
// in your translation, please use the type of curly quotes that's appropriate for
|
|
|
|
// your language. If you aren't sure which type is appropriate, see
|
|
|
|
// https://en.wikipedia.org/wiki/Quotation_mark#Specific_language_features
|
|
|
|
tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
|
|
|
|
"trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.")));
|
2016-02-11 04:59:44 -07:00
|
|
|
|
|
|
|
QLabel* logo = new QLabel();
|
2023-04-23 04:43:49 -06:00
|
|
|
logo->setPixmap(Resources::GetAppIcon().pixmap(200, 200));
|
2016-02-11 04:59:44 -07:00
|
|
|
logo->setContentsMargins(30, 0, 30, 0);
|
|
|
|
|
|
|
|
QVBoxLayout* main_layout = new QVBoxLayout;
|
|
|
|
QHBoxLayout* h_layout = new QHBoxLayout;
|
|
|
|
|
|
|
|
setLayout(main_layout);
|
|
|
|
main_layout->addLayout(h_layout);
|
|
|
|
main_layout->addWidget(copyright);
|
|
|
|
copyright->setAlignment(Qt::AlignCenter);
|
|
|
|
copyright->setContentsMargins(0, 15, 0, 0);
|
|
|
|
|
|
|
|
h_layout->setAlignment(Qt::AlignLeft);
|
|
|
|
h_layout->addWidget(logo);
|
|
|
|
h_layout->addWidget(text_label);
|
|
|
|
}
|