aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorVolcaEM <63682805+VolcaEM@users.noreply.github.com>2020-06-25 23:02:33 +0200
committerGitHub <noreply@github.com>2020-06-25 23:02:33 +0200
commit57b93395a87fae470ef489aa89f1f38633028c4b (patch)
treea8c9c49fad1a56e73a07a47966e3039c3b666372 /src/yuzu/main.cpp
parent058ec22787a6d3e41c3dfabd2060a1b723594374 (diff)
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
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp26
1 files changed, 26 insertions, 0 deletions
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 <QShortcut>
#include <QStatusBar>
#include <QSysInfo>
+#include <QUrl>
#include <QtConcurrent/QtConcurrent>
#include <fmt/format.h>
@@ -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;