// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) #include "aboutdialog.h" #include "qtutils.h" #include "core/settings.h" #include "common/file_system.h" #include "common/path.h" #include "scmversion/scmversion.h" #include #include #include #include #include AboutDialog::AboutDialog(QWidget* parent /* = nullptr */) : QDialog(parent) { m_ui.setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setFixedSize(geometry().width(), geometry().height()); m_ui.scmversion->setTextInteractionFlags(Qt::TextSelectableByMouse); m_ui.scmversion->setText( tr("%1 (%2)").arg(QLatin1StringView(g_scm_tag_str)).arg(QLatin1StringView(g_scm_branch_str))); m_ui.description->setTextInteractionFlags(Qt::TextBrowserInteraction); m_ui.description->setOpenExternalLinks(true); m_ui.description->setText(QStringLiteral(R"(

%1

%2:

Connor McLaughlin <stenzek@gmail.com>

and other contributors

%3 icons8

%4 | GitHub | Discord

)") .arg(tr("DuckStation is a free and open-source simulator/emulator of the Sony " "PlayStationTM console, focusing on " "playability, speed, and long-term maintainability.")) .arg(tr("Authors")) .arg(tr("Icon by")) .arg(tr("License"))); } AboutDialog::~AboutDialog() = default; 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 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(); }