2023-11-06 11:39:25 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
2020-06-11 04:36:48 +00:00
|
|
|
#include "aboutdialog.h"
|
|
|
|
#include "qtutils.h"
|
2023-11-06 11:39:25 +00:00
|
|
|
|
|
|
|
#include "core/settings.h"
|
|
|
|
|
|
|
|
#include "common/file_system.h"
|
|
|
|
#include "common/path.h"
|
|
|
|
|
2020-06-11 04:36:48 +00:00
|
|
|
#include "scmversion/scmversion.h"
|
2023-11-06 11:39:25 +00:00
|
|
|
|
2020-06-11 04:36:48 +00:00
|
|
|
#include <QtCore/QString>
|
|
|
|
#include <QtWidgets/QDialog>
|
2023-11-06 11:39:25 +00:00
|
|
|
#include <QtWidgets/QDialogButtonBox>
|
|
|
|
#include <QtWidgets/QPushButton>
|
|
|
|
#include <QtWidgets/QTextBrowser>
|
2020-06-11 04:36:48 +00:00
|
|
|
|
|
|
|
AboutDialog::AboutDialog(QWidget* parent /* = nullptr */) : QDialog(parent)
|
|
|
|
{
|
|
|
|
m_ui.setupUi(this);
|
|
|
|
|
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
|
|
setFixedSize(geometry().width(), geometry().height());
|
|
|
|
|
2021-02-27 23:07:05 +00:00
|
|
|
m_ui.scmversion->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
2023-10-02 03:05:43 +00:00
|
|
|
m_ui.scmversion->setText(
|
|
|
|
tr("%1 (%2)").arg(QLatin1StringView(g_scm_tag_str)).arg(QLatin1StringView(g_scm_branch_str)));
|
2020-06-11 16:36:14 +00:00
|
|
|
|
|
|
|
m_ui.description->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
|
|
|
m_ui.description->setOpenExternalLinks(true);
|
2020-07-28 16:35:24 +00:00
|
|
|
m_ui.description->setText(QStringLiteral(R"(
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
|
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
|
|
p, li { white-space: pre-wrap; }
|
|
|
|
</style></head><body style=" font-size:10pt; font-weight:400; font-style:normal;">
|
|
|
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%1</p>
|
2020-10-04 14:23:30 +00:00
|
|
|
<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">%2</span>:</p>
|
|
|
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Connor McLaughlin <stenzek@gmail.com></p>
|
|
|
|
<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and other <a href="https://github.com/stenzek/duckstation/blob/master/CONTRIBUTORS.md">contributors</a></p>
|
2020-07-28 16:35:24 +00:00
|
|
|
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%3 <a href="https://icons8.com/icon/74847/platforms.undefined.short-title"><span style=" text-decoration: underline; color:#0057ae;">icons8</span></a></p>
|
|
|
|
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/stenzek/duckstation/blob/master/LICENSE"><span style=" text-decoration: underline; color:#0057ae;">%4</span></a> | <a href="https://github.com/stenzek/duckstation"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a> | <a href="https://discord.gg/Buktv3t"><span style=" text-decoration: underline; color:#0057ae;">Discord</span></a></p></body></html>
|
|
|
|
)")
|
|
|
|
.arg(tr("DuckStation is a free and open-source simulator/emulator of the Sony "
|
|
|
|
"PlayStation<span style=\"vertical-align:super;\">TM</span> console, focusing on "
|
|
|
|
"playability, speed, and long-term maintainability."))
|
|
|
|
.arg(tr("Authors"))
|
|
|
|
.arg(tr("Icon by"))
|
|
|
|
.arg(tr("License")));
|
2020-06-11 04:36:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog::~AboutDialog() = default;
|
2023-11-06 11:39:25 +00:00
|
|
|
|
|
|
|
void AboutDialog::showThirdPartyNotices(QWidget* parent)
|
|
|
|
{
|
|
|
|
QDialog dialog(parent);
|
|
|
|
dialog.setMinimumSize(700, 400);
|
|
|
|
dialog.setWindowTitle(tr("DuckStation Third-Party Notices"));
|
|
|
|
|
|
|
|
QIcon icon;
|
|
|
|
icon.addFile(QString::fromUtf8(":/icons/duck.png"), QSize(), QIcon::Normal, QIcon::Off);
|
|
|
|
dialog.setWindowIcon(icon);
|
|
|
|
|
|
|
|
QVBoxLayout* layout = new QVBoxLayout(&dialog);
|
|
|
|
|
|
|
|
QTextBrowser* tb = new QTextBrowser(&dialog);
|
|
|
|
tb->setAcceptRichText(true);
|
|
|
|
tb->setReadOnly(true);
|
|
|
|
tb->setOpenExternalLinks(true);
|
|
|
|
if (std::optional<std::string> notice =
|
|
|
|
FileSystem::ReadFileToString(Path::Combine(EmuFolders::Resources, "thirdparty.html").c_str());
|
|
|
|
notice.has_value())
|
|
|
|
{
|
|
|
|
tb->setText(QString::fromStdString(notice.value()));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tb->setText(tr("Missing thirdparty.html file. You should request it from where-ever you obtained DuckStation."));
|
|
|
|
}
|
|
|
|
layout->addWidget(tb, 1);
|
|
|
|
|
|
|
|
QDialogButtonBox* bb = new QDialogButtonBox(QDialogButtonBox::Close, &dialog);
|
|
|
|
connect(bb->button(QDialogButtonBox::Close), &QPushButton::clicked, &dialog, &QDialog::done);
|
|
|
|
layout->addWidget(bb, 0);
|
|
|
|
|
|
|
|
dialog.exec();
|
|
|
|
}
|