From 4c29b6f30c3fcbeca8706f10a2c13b43ccffa19f Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Wed, 10 Jun 2020 21:36:48 -0700 Subject: [PATCH 1/4] Qt: Add about dialog --- src/duckstation-qt/CMakeLists.txt | 2 + src/duckstation-qt/aboutdialog.cpp | 17 ++++ src/duckstation-qt/aboutdialog.h | 17 ++++ src/duckstation-qt/aboutdialog.ui | 138 +++++++++++++++++++++++++++++ src/duckstation-qt/mainwindow.cpp | 7 +- 5 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 src/duckstation-qt/aboutdialog.cpp create mode 100644 src/duckstation-qt/aboutdialog.h create mode 100644 src/duckstation-qt/aboutdialog.ui diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt index 02105ba4a..6dc18d695 100644 --- a/src/duckstation-qt/CMakeLists.txt +++ b/src/duckstation-qt/CMakeLists.txt @@ -4,6 +4,8 @@ set(CMAKE_AUTOUIC ON) add_executable(duckstation-qt resources/icons.qrc + aboutdialog.cpp + aboutdialog.h advancedsettingswidget.cpp advancedsettingswidget.h advancedsettingswidget.ui diff --git a/src/duckstation-qt/aboutdialog.cpp b/src/duckstation-qt/aboutdialog.cpp new file mode 100644 index 000000000..afb0a211e --- /dev/null +++ b/src/duckstation-qt/aboutdialog.cpp @@ -0,0 +1,17 @@ +#include "aboutdialog.h" +#include "qtutils.h" +#include "scmversion/scmversion.h" +#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->setText(tr("%1 (%2)").arg(QString(g_scm_tag_str)).arg(QString(g_scm_branch_str))); +} + +AboutDialog::~AboutDialog() = default; diff --git a/src/duckstation-qt/aboutdialog.h b/src/duckstation-qt/aboutdialog.h new file mode 100644 index 000000000..bc27484b2 --- /dev/null +++ b/src/duckstation-qt/aboutdialog.h @@ -0,0 +1,17 @@ +#pragma once + +#include "ui_aboutdialog.h" +#include + +class AboutDialog final : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget* parent = nullptr); + ~AboutDialog(); + +private: + Ui::AboutDialog m_ui; + +}; diff --git a/src/duckstation-qt/aboutdialog.ui b/src/duckstation-qt/aboutdialog.ui new file mode 100644 index 000000000..949fa9994 --- /dev/null +++ b/src/duckstation-qt/aboutdialog.ui @@ -0,0 +1,138 @@ + + + AboutDialog + + + + 0 + 0 + 600 + 300 + + + + About DuckStation + + + + :/icons/duck.png:/icons/duck.png + + + + + + + QLayout::SetDefaultConstraint + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 260 + 260 + + + + + + + :/icons/duck.png + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 17 + 156 + + + + + + + + + + + 9 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + + 14 + 50 + false + + + + DuckStation + + + + + + + + + + + + + + <!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-family:'Cantarell'; 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;">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.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Authors</span>:</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Connor McLaughlin &lt;stenzek@gmail.com&gt;</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Duck icon by <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;">License</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> + + + true + + + + + + + + + + + + diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 8a6d306a9..ea2f2bee6 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -3,6 +3,7 @@ #include "core/game_list.h" #include "core/settings.h" #include "core/system.h" +#include "aboutdialog.h" #include "gamelistsettingswidget.h" #include "gamelistwidget.h" #include "gamepropertiesdialog.h" @@ -296,7 +297,11 @@ void MainWindow::onDiscordServerActionTriggered() QtUtils::OpenURL(this, "https://discord.gg/Buktv3t"); } -void MainWindow::onAboutActionTriggered() {} +void MainWindow::onAboutActionTriggered() +{ + AboutDialog about(this); + about.exec(); +} void MainWindow::onGameListEntrySelected(const GameListEntry* entry) { From da9188a771d31ce5dbda3ace111066f73da7dade Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 11 Jun 2020 09:36:14 -0700 Subject: [PATCH 2/4] Qt: Fix broken links in about dialog --- src/duckstation-qt/aboutdialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/duckstation-qt/aboutdialog.cpp b/src/duckstation-qt/aboutdialog.cpp index afb0a211e..2ab7b5538 100644 --- a/src/duckstation-qt/aboutdialog.cpp +++ b/src/duckstation-qt/aboutdialog.cpp @@ -12,6 +12,9 @@ AboutDialog::AboutDialog(QWidget* parent /* = nullptr */) : QDialog(parent) setFixedSize(geometry().width(), geometry().height()); m_ui.scmversion->setText(tr("%1 (%2)").arg(QString(g_scm_tag_str)).arg(QString(g_scm_branch_str))); + + m_ui.description->setTextInteractionFlags(Qt::TextBrowserInteraction); + m_ui.description->setOpenExternalLinks(true); } AboutDialog::~AboutDialog() = default; From aeead1b0a6b92d523b74192dc463cec91d1becf8 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 11 Jun 2020 10:09:02 -0700 Subject: [PATCH 3/4] Fix MSVC build --- src/duckstation-qt/duckstation-qt.vcxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/duckstation-qt/duckstation-qt.vcxproj b/src/duckstation-qt/duckstation-qt.vcxproj index 0491e02e6..58664bb5f 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj +++ b/src/duckstation-qt/duckstation-qt.vcxproj @@ -35,6 +35,7 @@ + @@ -60,6 +61,7 @@ + @@ -108,6 +110,9 @@ + + Document + Document @@ -142,6 +147,7 @@ + From 4f07e30dc0b670e71cec9bff11e35fbaa67ee88a Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 11 Jun 2020 10:14:27 -0700 Subject: [PATCH 4/4] Qt: Fix broken font in about dialog on Windows --- src/duckstation-qt/aboutdialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/duckstation-qt/aboutdialog.ui b/src/duckstation-qt/aboutdialog.ui index 949fa9994..d71b856be 100644 --- a/src/duckstation-qt/aboutdialog.ui +++ b/src/duckstation-qt/aboutdialog.ui @@ -115,7 +115,7 @@ <!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-family:'Cantarell'; font-size:10pt; font-weight:400; font-style:normal;"> +</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;">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.</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Authors</span>:</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Connor McLaughlin &lt;stenzek@gmail.com&gt;</p>