Qt: Add third-party license notices
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
||||
// 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 <QtCore/QString>
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QtWidgets/QDialogButtonBox>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QTextBrowser>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget* parent /* = nullptr */) : QDialog(parent)
|
||||
{
|
||||
@@ -41,3 +51,38 @@ p, li { white-space: pre-wrap; }
|
||||
}
|
||||
|
||||
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<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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user