From a6150263c9be4ecbdd983ffce896a2bafbf622a7 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:02:33 +0200 Subject: [PATCH 01/14] Add "Open Quickstart Guide" and "FAQ" buttons to the Help menu While we're at it, also refactor the function used by OnOpenModsPage to be compatible with other URLs --- src/yuzu/main.cpp | 26 ++++++++++++++++++++++++++ src/yuzu/main.h | 4 ++++ src/yuzu/main.ui | 18 ++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 270cccc772..ecafbfb009 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -56,6 +56,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include #include #include +#include #include #include @@ -826,6 +827,9 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); connect(ui.action_Report_Compatibility, &QAction::triggered, this, &GMainWindow::OnMenuReportCompatibility); + connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); + connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, &GMainWindow::OnQuickstartGuide); + connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); @@ -1797,6 +1801,28 @@ void GMainWindow::OnMenuReportCompatibility() { } } +void GMainWindow::OpenURL(QString const& url_str) { + + const QUrl url{url_str}; + const bool open = QDesktopServices::openUrl(url); + if (!open) { + QMessageBox::warning(this, tr("Error opening URL"), + tr("Unable to open the URL \"%1\".").arg(url_str)); + } +} + +void GMainWindow::OnOpenModsPage() { + this->OpenURL(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods")); +} + +void GMainWindow::OnQuickstartGuide() { + this->OpenURL(QStringLiteral("https://yuzu-emu.org/help/quickstart/")); +} + +void GMainWindow::OnFAQ() { + this->OpenURL(QStringLiteral("https://yuzu-emu.org/wiki/faq/")); +} + void GMainWindow::ToggleFullscreen() { if (!emulation_running) { return; diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 4f4c8ddbee..9500bdbba7 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -181,6 +181,9 @@ private slots: void OnPauseGame(); void OnStopGame(); void OnMenuReportCompatibility(); + void OnOpenModsPage(); + void OnQuickstartGuide(); + void OnFAQ(); /// Called whenever a user selects a game in the game list widget. void OnGameListLoadFile(QString game_path); void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); @@ -219,6 +222,7 @@ private: void UpdateStatusBar(); void HideMouseCursor(); void ShowMouseCursor(); + void OpenURL(const QString& url_str); Ui::MainWindow ui; diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 97c90f50bb..248a805d9e 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -113,6 +113,9 @@ &Help + + + @@ -256,6 +259,21 @@ false + + + Open Mods Page + + + + + Open Quickstart Guide + + + + + FAQ + + Open yuzu Folder From 5590f4775e7ac6913650e0ca549bbf7a5bfcdbec Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:07:58 +0200 Subject: [PATCH 02/14] Fix typo --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ecafbfb009..e454347d97 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1801,7 +1801,7 @@ void GMainWindow::OnMenuReportCompatibility() { } } -void GMainWindow::OpenURL(QString const& url_str) { +void GMainWindow::OpenURL(const QString& url_str) { const QUrl url{url_str}; const bool open = QDesktopServices::openUrl(url); From 002d762b7834735878c1f4a4ded99e99dd555cfd Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:18:54 +0200 Subject: [PATCH 03/14] Fix formatting --- src/yuzu/main.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 248a805d9e..bee6e107eb 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -114,8 +114,8 @@ - - + + From d82f550d12e6daa3e501203c4bfe41a32088100c Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:28:38 +0200 Subject: [PATCH 04/14] Use QUrl (1/2) --- src/yuzu/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 9500bdbba7..94d3dd7f62 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -222,7 +222,7 @@ private: void UpdateStatusBar(); void HideMouseCursor(); void ShowMouseCursor(); - void OpenURL(const QString& url_str); + void OpenURL(const QUrl& url); Ui::MainWindow ui; From c8d6e50b0528205021998cefb932867200f79085 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:31:01 +0200 Subject: [PATCH 05/14] Use QUrl (2/2) --- src/yuzu/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e454347d97..a2f637b96c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1801,26 +1801,25 @@ void GMainWindow::OnMenuReportCompatibility() { } } -void GMainWindow::OpenURL(const QString& url_str) { +void GMainWindow::OpenURL(QUrl const& url) { - const QUrl url{url_str}; const bool open = QDesktopServices::openUrl(url); if (!open) { QMessageBox::warning(this, tr("Error opening URL"), - tr("Unable to open the URL \"%1\".").arg(url_str)); + tr("Unable to open the URL \"%1\".").arg(url.toString())); } } void GMainWindow::OnOpenModsPage() { - this->OpenURL(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods")); + OpenURL(QUrl(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods"))); } void GMainWindow::OnQuickstartGuide() { - this->OpenURL(QStringLiteral("https://yuzu-emu.org/help/quickstart/")); + OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/"))); } void GMainWindow::OnFAQ() { - this->OpenURL(QStringLiteral("https://yuzu-emu.org/wiki/faq/")); + OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/wiki/faq/"))); } void GMainWindow::ToggleFullscreen() { From d0647a7ae9f58e0ddc6fd0f618cf07bc9f4cc987 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:32:43 +0200 Subject: [PATCH 06/14] Fix typo 2: electric boogaloo --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a2f637b96c..b78f810955 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1801,7 +1801,7 @@ void GMainWindow::OnMenuReportCompatibility() { } } -void GMainWindow::OpenURL(QUrl const& url) { +void GMainWindow::OpenURL(const QUrl& url) { const bool open = QDesktopServices::openUrl(url); if (!open) { From f9233dc92284acf53cb5c5cf332ec8f9db43eaf6 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:38:38 +0200 Subject: [PATCH 07/14] Remove unnecessary newline --- src/yuzu/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4810b161a2..9f552e3d21 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1812,7 +1812,6 @@ void GMainWindow::OnMenuReportCompatibility() { } void GMainWindow::OpenURL(const QUrl& url) { - const bool open = QDesktopServices::openUrl(url); if (!open) { QMessageBox::warning(this, tr("Error opening URL"), From b16bfe629d31fbc45316a2125c4d33e00a3e1f58 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:40:53 +0200 Subject: [PATCH 08/14] Clang-format --- src/yuzu/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9f552e3d21..3d8f8e534f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -838,7 +838,8 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Report_Compatibility, &QAction::triggered, this, &GMainWindow::OnMenuReportCompatibility); connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); - connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, &GMainWindow::OnQuickstartGuide); + connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, + &GMainWindow::OnQuickstartGuide); connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); From 9d72389b35b58930b023ff7a1292e0fc639f5cf2 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 25 Jun 2020 23:44:41 +0200 Subject: [PATCH 09/14] Clang-format again --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3d8f8e534f..267b0e75dc 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -838,7 +838,7 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Report_Compatibility, &QAction::triggered, this, &GMainWindow::OnMenuReportCompatibility); connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); - connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, + connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, &GMainWindow::OnQuickstartGuide); connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); From 032cf4330ed13827e8a79ff4a4d1f9d980fc3813 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Fri, 26 Jun 2020 18:49:57 +0200 Subject: [PATCH 10/14] Update function name (1/2) --- src/yuzu/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 94d3dd7f62..8b09619329 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -182,7 +182,7 @@ private slots: void OnStopGame(); void OnMenuReportCompatibility(); void OnOpenModsPage(); - void OnQuickstartGuide(); + void OnOpenQuickstartGuide(); void OnFAQ(); /// Called whenever a user selects a game in the game list widget. void OnGameListLoadFile(QString game_path); From c50c165d3c23daffd0a383686f3e55f9446e3c7e Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Fri, 26 Jun 2020 18:50:28 +0200 Subject: [PATCH 11/14] Update function name (2/2) --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 267b0e75dc..d12f7c0747 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1824,7 +1824,7 @@ void GMainWindow::OnOpenModsPage() { OpenURL(QUrl(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods"))); } -void GMainWindow::OnQuickstartGuide() { +void GMainWindow::OnOpenQuickstartGuide() { OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/"))); } From cfd829e6ac187535d9d45facd773204fc8274715 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Fri, 26 Jun 2020 18:51:12 +0200 Subject: [PATCH 12/14] Update function name again --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d12f7c0747..e597f97333 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -839,7 +839,7 @@ void GMainWindow::ConnectMenuEvents() { &GMainWindow::OnMenuReportCompatibility); connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, - &GMainWindow::OnQuickstartGuide); + &GMainWindow::OnOpenQuickstartGuide); connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); From 873e6fc7391e5c7d44fc9902121185352defd5df Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Sat, 27 Jun 2020 02:13:34 +0200 Subject: [PATCH 13/14] Update FAQ function name (1/2) --- src/yuzu/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 8b09619329..79c1f82195 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -183,7 +183,7 @@ private slots: void OnMenuReportCompatibility(); void OnOpenModsPage(); void OnOpenQuickstartGuide(); - void OnFAQ(); + void OnOpenFAQ(); /// Called whenever a user selects a game in the game list widget. void OnGameListLoadFile(QString game_path); void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); From c6e7f72cb10d9a3885df64a46eafc14c586a04c1 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Sat, 27 Jun 2020 02:14:29 +0200 Subject: [PATCH 14/14] Update FAQ function name (2/2) --- src/yuzu/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e597f97333..e83843a03f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -840,7 +840,7 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, &GMainWindow::OnOpenQuickstartGuide); - connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); + connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); @@ -1828,7 +1828,7 @@ void GMainWindow::OnOpenQuickstartGuide() { OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/"))); } -void GMainWindow::OnFAQ() { +void GMainWindow::OnOpenFAQ() { OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/wiki/faq/"))); }