diff options
| author | 2020-06-21 06:09:28 +0200 | |
|---|---|---|
| committer | 2020-06-21 06:09:28 +0200 | |
| commit | b81af6ae9bdbf7edcdc6c1ec4f68d5e29ad18c5f (patch) | |
| tree | 2fe0998ee58277079101d53c2dd38bdbf5c72e18 /src | |
| parent | Merge pull request #3982 from ReinUsesLisp/membar-cts (diff) | |
| download | yuzu-b81af6ae9bdbf7edcdc6c1ec4f68d5e29ad18c5f.tar.gz yuzu-b81af6ae9bdbf7edcdc6c1ec4f68d5e29ad18c5f.tar.xz yuzu-b81af6ae9bdbf7edcdc6c1ec4f68d5e29ad18c5f.zip | |
Add a "Open Mods Page" button to the GUI
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 270cccc77..826f8903b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -57,6 +57,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual | |||
| 57 | #include <QStatusBar> | 57 | #include <QStatusBar> |
| 58 | #include <QSysInfo> | 58 | #include <QSysInfo> |
| 59 | #include <QtConcurrent/QtConcurrent> | 59 | #include <QtConcurrent/QtConcurrent> |
| 60 | #include <QUrl> | ||
| 60 | 61 | ||
| 61 | #include <fmt/format.h> | 62 | #include <fmt/format.h> |
| 62 | #include "common/common_paths.h" | 63 | #include "common/common_paths.h" |
| @@ -826,6 +827,7 @@ 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::OnSwitchModsPage); | ||
| 829 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); | 831 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); |
| 830 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); | 832 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); |
| 831 | 833 | ||
| @@ -1797,6 +1799,17 @@ void GMainWindow::OnMenuReportCompatibility() { | |||
| 1797 | } | 1799 | } |
| 1798 | } | 1800 | } |
| 1799 | 1801 | ||
| 1802 | void GMainWindow::OnSwitchModsPage() { | ||
| 1803 | const std::string mods_page_url = "https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods"; | ||
| 1804 | const QString mods_page_url_qs = QString::fromStdString(mods_page_url); | ||
| 1805 | const QUrl mods_page(mods_page_url_qs); | ||
| 1806 | const bool open = QDesktopServices::openUrl(mods_page); | ||
| 1807 | if (!open) { | ||
| 1808 | QMessageBox::warning(this, tr("Error opening URL"), | ||
| 1809 | tr("Unable to open the URL \"%1\".").arg(mods_page_url_qs)); | ||
| 1810 | } | ||
| 1811 | } | ||
| 1812 | |||
| 1800 | void GMainWindow::ToggleFullscreen() { | 1813 | void GMainWindow::ToggleFullscreen() { |
| 1801 | if (!emulation_running) { | 1814 | if (!emulation_running) { |
| 1802 | return; | 1815 | return; |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 4f4c8ddbe..7d9910608 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -181,6 +181,7 @@ private slots: | |||
| 181 | void OnPauseGame(); | 181 | void OnPauseGame(); |
| 182 | void OnStopGame(); | 182 | void OnStopGame(); |
| 183 | void OnMenuReportCompatibility(); | 183 | void OnMenuReportCompatibility(); |
| 184 | void OnSwitchModsPage(); | ||
| 184 | /// Called whenever a user selects a game in the game list widget. | 185 | /// Called whenever a user selects a game in the game list widget. |
| 185 | void OnGameListLoadFile(QString game_path); | 186 | void OnGameListLoadFile(QString game_path); |
| 186 | void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); | 187 | void OnGameListOpenFolder(GameListOpenTarget target, const std::string& game_path); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 97c90f50b..b5745dfd5 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -113,6 +113,7 @@ | |||
| 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"/> | ||
| 116 | <addaction name="separator"/> | 117 | <addaction name="separator"/> |
| 117 | <addaction name="action_About"/> | 118 | <addaction name="action_About"/> |
| 118 | </widget> | 119 | </widget> |
| @@ -256,6 +257,11 @@ | |||
| 256 | <bool>false</bool> | 257 | <bool>false</bool> |
| 257 | </property> | 258 | </property> |
| 258 | </action> | 259 | </action> |
| 260 | <action name="action_Open_Mods_Page"> | ||
| 261 | <property name="text"> | ||
| 262 | <string>Open Mods Page</string> | ||
| 263 | </property> | ||
| 264 | </action> | ||
| 259 | <action name="action_Open_yuzu_Folder"> | 265 | <action name="action_Open_yuzu_Folder"> |
| 260 | <property name="text"> | 266 | <property name="text"> |
| 261 | <string>Open yuzu Folder</string> | 267 | <string>Open yuzu Folder</string> |