Skip to content
Snippets Groups Projects
Unverified Commit 57b93395 authored by VolcaEM's avatar VolcaEM Committed by GitHub
Browse files

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
parent 058ec227
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual ...@@ -56,6 +56,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include <QShortcut> #include <QShortcut>
#include <QStatusBar> #include <QStatusBar>
#include <QSysInfo> #include <QSysInfo>
#include <QUrl>
#include <QtConcurrent/QtConcurrent> #include <QtConcurrent/QtConcurrent>
#include <fmt/format.h> #include <fmt/format.h>
...@@ -826,6 +827,9 @@ void GMainWindow::ConnectMenuEvents() { ...@@ -826,6 +827,9 @@ void GMainWindow::ConnectMenuEvents() {
connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame);
connect(ui.action_Report_Compatibility, &QAction::triggered, this, connect(ui.action_Report_Compatibility, &QAction::triggered, this,
&GMainWindow::OnMenuReportCompatibility); &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_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
...@@ -1797,6 +1801,28 @@ void GMainWindow::OnMenuReportCompatibility() { ...@@ -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() { void GMainWindow::ToggleFullscreen() {
if (!emulation_running) { if (!emulation_running) {
return; return;
......
...@@ -181,6 +181,9 @@ private slots: ...@@ -181,6 +181,9 @@ private slots:
void OnPauseGame(); void OnPauseGame();
void OnStopGame(); void OnStopGame();
void OnMenuReportCompatibility(); void OnMenuReportCompatibility();
void OnOpenModsPage();
void OnQuickstartGuide();
void OnFAQ();
/// Called whenever a user selects a game in the game list widget. /// Called whenever a user selects a game in the game list widget.
void OnGameListLoadFile(QString game_path); void OnGameListLoadFile(QString game_path);
void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path);
...@@ -219,6 +222,7 @@ private: ...@@ -219,6 +222,7 @@ private:
void UpdateStatusBar(); void UpdateStatusBar();
void HideMouseCursor(); void HideMouseCursor();
void ShowMouseCursor(); void ShowMouseCursor();
void OpenURL(const QString& url_str);
Ui::MainWindow ui; Ui::MainWindow ui;
......
...@@ -113,6 +113,9 @@ ...@@ -113,6 +113,9 @@
<string>&amp;Help</string> <string>&amp;Help</string>
</property> </property>
<addaction name="action_Report_Compatibility"/> <addaction name="action_Report_Compatibility"/>
<addaction name="action_Open_Mods_Page"/>
<addaction name="action_Open_Quickstart_Guide"/>
<addaction name="action_Open_FAQ"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_About"/> <addaction name="action_About"/>
</widget> </widget>
...@@ -256,6 +259,21 @@ ...@@ -256,6 +259,21 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</action> </action>
<action name="action_Open_Mods_Page">
<property name="text">
<string>Open Mods Page</string>
</property>
</action>
<action name="action_Open_Quickstart_Guide">
<property name="text">
<string>Open Quickstart Guide</string>
</property>
</action>
<action name="action_Open_FAQ">
<property name="text">
<string>FAQ</string>
</property>
</action>
<action name="action_Open_yuzu_Folder"> <action name="action_Open_yuzu_Folder">
<property name="text"> <property name="text">
<string>Open yuzu Folder</string> <string>Open yuzu Folder</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment