diff options
| author | 2020-06-25 23:02:33 +0200 | |
|---|---|---|
| committer | 2020-06-25 23:02:33 +0200 | |
| commit | 57b93395a87fae470ef489aa89f1f38633028c4b (patch) | |
| tree | a8c9c49fad1a56e73a07a47966e3039c3b666372 /src | |
| parent | Merge pull request #3982 from ReinUsesLisp/membar-cts (diff) | |
| download | yuzu-57b93395a87fae470ef489aa89f1f38633028c4b.tar.gz yuzu-57b93395a87fae470ef489aa89f1f38633028c4b.tar.xz yuzu-57b93395a87fae470ef489aa89f1f38633028c4b.zip | |
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')
| -rw-r--r-- | src/yuzu/main.cpp | 26 | ||||
| -rw-r--r-- | src/yuzu/main.h | 4 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 18 |
3 files changed, 48 insertions, 0 deletions
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 | |||
| 56 | #include <QShortcut> | 56 | #include <QShortcut> |
| 57 | #include <QStatusBar> | 57 | #include <QStatusBar> |
| 58 | #include <QSysInfo> | 58 | #include <QSysInfo> |
| 59 | #include <QUrl> | ||
| 59 | #include <QtConcurrent/QtConcurrent> | 60 | #include <QtConcurrent/QtConcurrent> |
| 60 | 61 | ||
| 61 | #include <fmt/format.h> | 62 | #include <fmt/format.h> |
| @@ -826,6 +827,9 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 826 | connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); | 827 | connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); |
| 827 | connect(ui.action_Report_Compatibility, &QAction::triggered, this, | 828 | connect(ui.action_Report_Compatibility, &QAction::triggered, this, |
| 828 | &GMainWindow::OnMenuReportCompatibility); | 829 | &GMainWindow::OnMenuReportCompatibility); |
| 830 | connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); | ||
| 831 | connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, &GMainWindow::OnQuickstartGuide); | ||
| 832 | connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnFAQ); | ||
| 829 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); | 833 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); |
| 830 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); | 834 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); |
| 831 | 835 | ||
| @@ -1797,6 +1801,28 @@ void GMainWindow::OnMenuReportCompatibility() { | |||
| 1797 | } | 1801 | } |
| 1798 | } | 1802 | } |
| 1799 | 1803 | ||
| 1804 | void GMainWindow::OpenURL(QString const& url_str) { | ||
| 1805 | |||
| 1806 | const QUrl url{url_str}; | ||
| 1807 | const bool open = QDesktopServices::openUrl(url); | ||
| 1808 | if (!open) { | ||
| 1809 | QMessageBox::warning(this, tr("Error opening URL"), | ||
| 1810 | tr("Unable to open the URL \"%1\".").arg(url_str)); | ||
| 1811 | } | ||
| 1812 | } | ||
| 1813 | |||
| 1814 | void GMainWindow::OnOpenModsPage() { | ||
| 1815 | this->OpenURL(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods")); | ||
| 1816 | } | ||
| 1817 | |||
| 1818 | void GMainWindow::OnQuickstartGuide() { | ||
| 1819 | this->OpenURL(QStringLiteral("https://yuzu-emu.org/help/quickstart/")); | ||
| 1820 | } | ||
| 1821 | |||
| 1822 | void GMainWindow::OnFAQ() { | ||
| 1823 | this->OpenURL(QStringLiteral("https://yuzu-emu.org/wiki/faq/")); | ||
| 1824 | } | ||
| 1825 | |||
| 1800 | void GMainWindow::ToggleFullscreen() { | 1826 | void GMainWindow::ToggleFullscreen() { |
| 1801 | if (!emulation_running) { | 1827 | if (!emulation_running) { |
| 1802 | return; | 1828 | return; |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 4f4c8ddbe..9500bdbba 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -181,6 +181,9 @@ private slots: | |||
| 181 | void OnPauseGame(); | 181 | void OnPauseGame(); |
| 182 | void OnStopGame(); | 182 | void OnStopGame(); |
| 183 | void OnMenuReportCompatibility(); | 183 | void OnMenuReportCompatibility(); |
| 184 | void OnOpenModsPage(); | ||
| 185 | void OnQuickstartGuide(); | ||
| 186 | void OnFAQ(); | ||
| 184 | /// Called whenever a user selects a game in the game list widget. | 187 | /// Called whenever a user selects a game in the game list widget. |
| 185 | void OnGameListLoadFile(QString game_path); | 188 | void OnGameListLoadFile(QString game_path); |
| 186 | void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); | 189 | void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); |
| @@ -219,6 +222,7 @@ private: | |||
| 219 | void UpdateStatusBar(); | 222 | void UpdateStatusBar(); |
| 220 | void HideMouseCursor(); | 223 | void HideMouseCursor(); |
| 221 | void ShowMouseCursor(); | 224 | void ShowMouseCursor(); |
| 225 | void OpenURL(const QString& url_str); | ||
| 222 | 226 | ||
| 223 | Ui::MainWindow ui; | 227 | Ui::MainWindow ui; |
| 224 | 228 | ||
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 97c90f50b..248a805d9 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -113,6 +113,9 @@ | |||
| 113 | <string>&Help</string> | 113 | <string>&Help</string> |
| 114 | </property> | 114 | </property> |
| 115 | <addaction name="action_Report_Compatibility"/> | 115 | <addaction name="action_Report_Compatibility"/> |
| 116 | <addaction name="action_Open_Mods_Page"/> | ||
| 117 | <addaction name="action_Open_Quickstart_Guide"/> | ||
| 118 | <addaction name="action_Open_FAQ"/> | ||
| 116 | <addaction name="separator"/> | 119 | <addaction name="separator"/> |
| 117 | <addaction name="action_About"/> | 120 | <addaction name="action_About"/> |
| 118 | </widget> | 121 | </widget> |
| @@ -256,6 +259,21 @@ | |||
| 256 | <bool>false</bool> | 259 | <bool>false</bool> |
| 257 | </property> | 260 | </property> |
| 258 | </action> | 261 | </action> |
| 262 | <action name="action_Open_Mods_Page"> | ||
| 263 | <property name="text"> | ||
| 264 | <string>Open Mods Page</string> | ||
| 265 | </property> | ||
| 266 | </action> | ||
| 267 | <action name="action_Open_Quickstart_Guide"> | ||
| 268 | <property name="text"> | ||
| 269 | <string>Open Quickstart Guide</string> | ||
| 270 | </property> | ||
| 271 | </action> | ||
| 272 | <action name="action_Open_FAQ"> | ||
| 273 | <property name="text"> | ||
| 274 | <string>FAQ</string> | ||
| 275 | </property> | ||
| 276 | </action> | ||
| 259 | <action name="action_Open_yuzu_Folder"> | 277 | <action name="action_Open_yuzu_Folder"> |
| 260 | <property name="text"> | 278 | <property name="text"> |
| 261 | <string>Open yuzu Folder</string> | 279 | <string>Open yuzu Folder</string> |