From 57b93395a87fae470ef489aa89f1f38633028c4b 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 5f6e44552a65421f88dc79133aa8fa1d202ab7ff 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 04497d9e4adcfbfdcfe912b90d1ffcf805443cea 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 5c6adea222fca7aeab8b0e418b0afc8fa2cab042 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 9e7ac6a009002aacba48f9c167efc58cfe34241d 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 a46df409397855812812e83ae3ed6ce6261b72cb 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 6582857356445d515aa70fb93c72c03c7c3d7928 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 b9f0b9dd06f7bdbbc701261ffa8cb2688569fc40 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 7d08d548a94377e4794acb770bc9b5bb2dac9130 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 f8247826faf47b4ac5d917ddac3acd7ba89a88fd 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 0b86c7eb6a22528f41e94500bb7eba55cd3c3217 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 9e1975a166c686980420672bbfe1da9aee3fa57f 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 db96b5ee3bd8820fcf310ffc283447985755c678 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 b1f4de78741108d0df3a03ae5ba0482e1d2d531e 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/"))); }