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: 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 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 270cccc77..ecafbfb00 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; -- cgit v1.2.3 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: Fix typo --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ecafbfb00..e454347d9 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); -- cgit v1.2.3 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: Use QUrl (2/2) --- src/yuzu/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e454347d9..a2f637b96 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() { -- cgit v1.2.3 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: Fix typo 2: electric boogaloo --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a2f637b96..b78f81095 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) { -- cgit v1.2.3 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: Remove unnecessary newline --- src/yuzu/main.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4810b161a..9f552e3d2 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"), -- cgit v1.2.3 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: Clang-format --- src/yuzu/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9f552e3d2..3d8f8e534 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); -- cgit v1.2.3 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: Clang-format again --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3d8f8e534..267b0e75d 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)); }); -- cgit v1.2.3 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: Update function name (2/2) --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 267b0e75d..d12f7c074 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/"))); } -- cgit v1.2.3 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: Update function name again --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d12f7c074..e597f9733 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); -- cgit v1.2.3 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: Update FAQ function name (2/2) --- src/yuzu/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e597f9733..e83843a03 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/"))); } -- cgit v1.2.3