diff options
21 files changed, 183 insertions, 170 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index e6344fd41..662171138 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -180,20 +180,20 @@ std::wstring UTF8ToUTF16W(const std::string& input) { | |||
| 180 | 180 | ||
| 181 | #endif | 181 | #endif |
| 182 | 182 | ||
| 183 | std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t max_len) { | 183 | std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len) { |
| 184 | std::size_t len = 0; | 184 | std::size_t len = 0; |
| 185 | while (len < max_len && buffer[len] != '\0') | 185 | while (len < buffer.length() && len < max_len && buffer[len] != '\0') { |
| 186 | ++len; | 186 | ++len; |
| 187 | 187 | } | |
| 188 | return std::string(buffer, len); | 188 | return std::string(buffer.begin(), buffer.begin() + len); |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer, | 191 | std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buffer, |
| 192 | std::size_t max_len) { | 192 | std::size_t max_len) { |
| 193 | std::size_t len = 0; | 193 | std::size_t len = 0; |
| 194 | while (len < max_len && buffer[len] != '\0') | 194 | while (len < buffer.length() && len < max_len && buffer[len] != '\0') { |
| 195 | ++len; | 195 | ++len; |
| 196 | 196 | } | |
| 197 | return std::u16string(buffer.begin(), buffer.begin() + len); | 197 | return std::u16string(buffer.begin(), buffer.begin() + len); |
| 198 | } | 198 | } |
| 199 | 199 | ||
diff --git a/src/common/string_util.h b/src/common/string_util.h index 7e90a9ca5..f0dd632ee 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h | |||
| @@ -63,7 +63,7 @@ template <typename InIt> | |||
| 63 | * Creates a std::string from a fixed-size NUL-terminated char buffer. If the buffer isn't | 63 | * Creates a std::string from a fixed-size NUL-terminated char buffer. If the buffer isn't |
| 64 | * NUL-terminated then the string ends at max_len characters. | 64 | * NUL-terminated then the string ends at max_len characters. |
| 65 | */ | 65 | */ |
| 66 | [[nodiscard]] std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, | 66 | [[nodiscard]] std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, |
| 67 | std::size_t max_len); | 67 | std::size_t max_len); |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp index 6b0155a78..04ab4ae21 100644 --- a/src/yuzu/about_dialog.cpp +++ b/src/yuzu/about_dialog.cpp | |||
| @@ -8,7 +8,8 @@ | |||
| 8 | #include "ui_aboutdialog.h" | 8 | #include "ui_aboutdialog.h" |
| 9 | #include "yuzu/about_dialog.h" | 9 | #include "yuzu/about_dialog.h" |
| 10 | 10 | ||
| 11 | AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { | 11 | AboutDialog::AboutDialog(QWidget* parent) |
| 12 | : QDialog(parent), ui{std::make_unique<Ui::AboutDialog>()} { | ||
| 12 | const auto branch_name = std::string(Common::g_scm_branch); | 13 | const auto branch_name = std::string(Common::g_scm_branch); |
| 13 | const auto description = std::string(Common::g_scm_desc); | 14 | const auto description = std::string(Common::g_scm_desc); |
| 14 | const auto build_id = std::string(Common::g_build_id); | 15 | const auto build_id = std::string(Common::g_build_id); |
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index 27fabef38..f66cab5d4 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "yuzu/configuration/configure_cpu.h" | 14 | #include "yuzu/configuration/configure_cpu.h" |
| 15 | 15 | ||
| 16 | ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent) | 16 | ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent) |
| 17 | : QWidget(parent), ui(new Ui::ConfigureCpu), system{system_} { | 17 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_} { |
| 18 | ui->setupUi(this); | 18 | ui->setupUi(this); |
| 19 | 19 | ||
| 20 | SetupPerGameUI(); | 20 | SetupPerGameUI(); |
diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp index 6e910e33e..05a90963d 100644 --- a/src/yuzu/configuration/configure_cpu_debug.cpp +++ b/src/yuzu/configuration/configure_cpu_debug.cpp | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "yuzu/configuration/configure_cpu_debug.h" | 12 | #include "yuzu/configuration/configure_cpu_debug.h" |
| 13 | 13 | ||
| 14 | ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* parent) | 14 | ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* parent) |
| 15 | : QWidget(parent), ui(new Ui::ConfigureCpuDebug), system{system_} { | 15 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureCpuDebug>()}, system{system_} { |
| 16 | ui->setupUi(this); | 16 | ui->setupUi(this); |
| 17 | 17 | ||
| 18 | SetConfiguration(); | 18 | SetConfiguration(); |
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 40447093e..07bfa0360 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "yuzu/uisettings.h" | 15 | #include "yuzu/uisettings.h" |
| 16 | 16 | ||
| 17 | ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent) | 17 | ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent) |
| 18 | : QWidget(parent), ui(new Ui::ConfigureDebug), system{system_} { | 18 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureDebug>()}, system{system_} { |
| 19 | ui->setupUi(this); | 19 | ui->setupUi(this); |
| 20 | SetConfiguration(); | 20 | SetConfiguration(); |
| 21 | 21 | ||
diff --git a/src/yuzu/configuration/configure_debug_tab.cpp b/src/yuzu/configuration/configure_debug_tab.cpp index e126eeea9..e69cca1ef 100644 --- a/src/yuzu/configuration/configure_debug_tab.cpp +++ b/src/yuzu/configuration/configure_debug_tab.cpp | |||
| @@ -9,8 +9,8 @@ | |||
| 9 | #include "yuzu/configuration/configure_debug_tab.h" | 9 | #include "yuzu/configuration/configure_debug_tab.h" |
| 10 | 10 | ||
| 11 | ConfigureDebugTab::ConfigureDebugTab(const Core::System& system_, QWidget* parent) | 11 | ConfigureDebugTab::ConfigureDebugTab(const Core::System& system_, QWidget* parent) |
| 12 | : QWidget(parent), | 12 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureDebugTab>()}, |
| 13 | ui(new Ui::ConfigureDebugTab), debug_tab{std::make_unique<ConfigureDebug>(system_, this)}, | 13 | debug_tab{std::make_unique<ConfigureDebug>(system_, this)}, |
| 14 | cpu_debug_tab{std::make_unique<ConfigureCpuDebug>(system_, this)} { | 14 | cpu_debug_tab{std::make_unique<ConfigureCpuDebug>(system_, this)} { |
| 15 | ui->setupUi(this); | 15 | ui->setupUi(this); |
| 16 | 16 | ||
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 759625ef7..4fa0c4a43 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, | 36 | ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, |
| 37 | InputCommon::InputSubsystem* input_subsystem, | 37 | InputCommon::InputSubsystem* input_subsystem, |
| 38 | Core::System& system_) | 38 | Core::System& system_) |
| 39 | : QDialog(parent), ui(new Ui::ConfigureDialog), | 39 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, |
| 40 | registry(registry), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, | 40 | registry(registry), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, |
| 41 | this)}, | 41 | this)}, |
| 42 | cpu_tab{std::make_unique<ConfigureCpu>(system_, this)}, | 42 | cpu_tab{std::make_unique<ConfigureCpu>(system_, this)}, |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index e562e89e5..7af3ea97e 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include "yuzu/uisettings.h" | 16 | #include "yuzu/uisettings.h" |
| 17 | 17 | ||
| 18 | ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) | 18 | ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) |
| 19 | : QWidget(parent), ui(new Ui::ConfigureGeneral), system{system_} { | 19 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_} { |
| 20 | ui->setupUi(this); | 20 | ui->setupUi(this); |
| 21 | 21 | ||
| 22 | SetupPerGameUI(); | 22 | SetupPerGameUI(); |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index be4e7997b..8e20cc6f3 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | #include "yuzu/configuration/configure_graphics.h" | 20 | #include "yuzu/configuration/configure_graphics.h" |
| 21 | 21 | ||
| 22 | ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* parent) | 22 | ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* parent) |
| 23 | : QWidget(parent), ui(new Ui::ConfigureGraphics), system{system_} { | 23 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, system{system_} { |
| 24 | vulkan_device = Settings::values.vulkan_device.GetValue(); | 24 | vulkan_device = Settings::values.vulkan_device.GetValue(); |
| 25 | RetrieveVulkanDevices(); | 25 | RetrieveVulkanDevices(); |
| 26 | 26 | ||
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 451d86859..beae74344 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -203,17 +203,17 @@ | |||
| 203 | <widget class="QComboBox" name="nvdec_emulation"> | 203 | <widget class="QComboBox" name="nvdec_emulation"> |
| 204 | <item> | 204 | <item> |
| 205 | <property name="text"> | 205 | <property name="text"> |
| 206 | <string>Disabled</string> | 206 | <string>No Video Output</string> |
| 207 | </property> | 207 | </property> |
| 208 | </item> | 208 | </item> |
| 209 | <item> | 209 | <item> |
| 210 | <property name="text"> | 210 | <property name="text"> |
| 211 | <string>CPU Decoding</string> | 211 | <string>CPU Video Decoding</string> |
| 212 | </property> | 212 | </property> |
| 213 | </item> | 213 | </item> |
| 214 | <item> | 214 | <item> |
| 215 | <property name="text"> | 215 | <property name="text"> |
| 216 | <string>GPU Decoding</string> | 216 | <string>GPU Video Decoding (Default)</string> |
| 217 | </property> | 217 | </property> |
| 218 | </item> | 218 | </item> |
| 219 | </widget> | 219 | </widget> |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 4407e65d3..30c5a3595 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "yuzu/configuration/configure_graphics_advanced.h" | 9 | #include "yuzu/configuration/configure_graphics_advanced.h" |
| 10 | 10 | ||
| 11 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent) | 11 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent) |
| 12 | : QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced), system{system_} { | 12 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} { |
| 13 | 13 | ||
| 14 | ui->setupUi(this); | 14 | ui->setupUi(this); |
| 15 | 15 | ||
diff --git a/src/yuzu/configuration/configure_per_game_addons.cpp b/src/yuzu/configuration/configure_per_game_addons.cpp index c8de8e2ff..65e615963 100644 --- a/src/yuzu/configuration/configure_per_game_addons.cpp +++ b/src/yuzu/configuration/configure_per_game_addons.cpp | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | #include "yuzu/util/util.h" | 27 | #include "yuzu/util/util.h" |
| 28 | 28 | ||
| 29 | ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* parent) | 29 | ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* parent) |
| 30 | : QWidget(parent), ui(new Ui::ConfigurePerGameAddons), system{system_} { | 30 | : QWidget(parent), ui{std::make_unique<Ui::ConfigurePerGameAddons>()}, system{system_} { |
| 31 | ui->setupUi(this); | 31 | ui->setupUi(this); |
| 32 | 32 | ||
| 33 | layout = new QVBoxLayout; | 33 | layout = new QVBoxLayout; |
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 9feec37ff..99d5f4686 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp | |||
| @@ -77,7 +77,7 @@ QString GetProfileUsernameFromUser(QWidget* parent, const QString& description_t | |||
| 77 | } // Anonymous namespace | 77 | } // Anonymous namespace |
| 78 | 78 | ||
| 79 | ConfigureProfileManager::ConfigureProfileManager(const Core::System& system_, QWidget* parent) | 79 | ConfigureProfileManager::ConfigureProfileManager(const Core::System& system_, QWidget* parent) |
| 80 | : QWidget(parent), ui(new Ui::ConfigureProfileManager), | 80 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureProfileManager>()}, |
| 81 | profile_manager(std::make_unique<Service::Account::ProfileManager>()), system{system_} { | 81 | profile_manager(std::make_unique<Service::Account::ProfileManager>()), system{system_} { |
| 82 | ui->setupUi(this); | 82 | ui->setupUi(this); |
| 83 | 83 | ||
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 33eb059a3..eea45f8ea 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #include "yuzu/configuration/configure_system.h" | 18 | #include "yuzu/configuration/configure_system.h" |
| 19 | 19 | ||
| 20 | ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) | 20 | ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) |
| 21 | : QWidget(parent), ui(new Ui::ConfigureSystem), system{system_} { | 21 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { |
| 22 | ui->setupUi(this); | 22 | ui->setupUi(this); |
| 23 | connect(ui->button_regenerate_console_id, &QPushButton::clicked, this, | 23 | connect(ui->button_regenerate_console_id, &QPushButton::clicked, this, |
| 24 | &ConfigureSystem::RefreshConsoleID); | 24 | &ConfigureSystem::RefreshConsoleID); |
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index d01895bf2..46e5409db 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp | |||
| @@ -55,7 +55,7 @@ QString GetTranslatedRowTextName(size_t index) { | |||
| 55 | } // Anonymous namespace | 55 | } // Anonymous namespace |
| 56 | 56 | ||
| 57 | ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent) | 57 | ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent) |
| 58 | : QWidget(parent), ui(new Ui::ConfigureUi), system{system_} { | 58 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureUi>()}, system{system_} { |
| 59 | ui->setupUi(this); | 59 | ui->setupUi(this); |
| 60 | 60 | ||
| 61 | InitializeLanguageComboBox(); | 61 | InitializeLanguageComboBox(); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9f80a245c..00e649fd2 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -104,6 +104,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual | |||
| 104 | #include "core/telemetry_session.h" | 104 | #include "core/telemetry_session.h" |
| 105 | #include "input_common/main.h" | 105 | #include "input_common/main.h" |
| 106 | #include "input_common/tas/tas_input.h" | 106 | #include "input_common/tas/tas_input.h" |
| 107 | #include "ui_main.h" | ||
| 107 | #include "util/overlay_dialog.h" | 108 | #include "util/overlay_dialog.h" |
| 108 | #include "video_core/gpu.h" | 109 | #include "video_core/gpu.h" |
| 109 | #include "video_core/renderer_base.h" | 110 | #include "video_core/renderer_base.h" |
| @@ -199,7 +200,7 @@ GMainWindow::GMainWindow(Core::System& system_) | |||
| 199 | LoadTranslation(); | 200 | LoadTranslation(); |
| 200 | 201 | ||
| 201 | setAcceptDrops(true); | 202 | setAcceptDrops(true); |
| 202 | ui.setupUi(this); | 203 | ui->setupUi(this); |
| 203 | statusBar()->hide(); | 204 | statusBar()->hide(); |
| 204 | 205 | ||
| 205 | default_theme_paths = QIcon::themeSearchPaths(); | 206 | default_theme_paths = QIcon::themeSearchPaths(); |
| @@ -274,16 +275,16 @@ GMainWindow::GMainWindow(Core::System& system_) | |||
| 274 | ShowTelemetryCallout(); | 275 | ShowTelemetryCallout(); |
| 275 | 276 | ||
| 276 | // make sure menubar has the arrow cursor instead of inheriting from this | 277 | // make sure menubar has the arrow cursor instead of inheriting from this |
| 277 | ui.menubar->setCursor(QCursor()); | 278 | ui->menubar->setCursor(QCursor()); |
| 278 | statusBar()->setCursor(QCursor()); | 279 | statusBar()->setCursor(QCursor()); |
| 279 | 280 | ||
| 280 | mouse_hide_timer.setInterval(default_mouse_timeout); | 281 | mouse_hide_timer.setInterval(default_mouse_timeout); |
| 281 | connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor); | 282 | connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor); |
| 282 | connect(ui.menubar, &QMenuBar::hovered, this, &GMainWindow::ShowMouseCursor); | 283 | connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::ShowMouseCursor); |
| 283 | 284 | ||
| 284 | MigrateConfigFiles(); | 285 | MigrateConfigFiles(); |
| 285 | 286 | ||
| 286 | ui.action_Fullscreen->setChecked(false); | 287 | ui->action_Fullscreen->setChecked(false); |
| 287 | 288 | ||
| 288 | QStringList args = QApplication::arguments(); | 289 | QStringList args = QApplication::arguments(); |
| 289 | 290 | ||
| @@ -302,7 +303,7 @@ GMainWindow::GMainWindow(Core::System& system_) | |||
| 302 | 303 | ||
| 303 | // Launch game in fullscreen mode | 304 | // Launch game in fullscreen mode |
| 304 | if (args[i] == QStringLiteral("-f")) { | 305 | if (args[i] == QStringLiteral("-f")) { |
| 305 | ui.action_Fullscreen->setChecked(true); | 306 | ui->action_Fullscreen->setChecked(true); |
| 306 | continue; | 307 | continue; |
| 307 | } | 308 | } |
| 308 | 309 | ||
| @@ -568,9 +569,9 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, | |||
| 568 | 569 | ||
| 569 | QtNXWebEngineView web_browser_view(this, system, input_subsystem.get()); | 570 | QtNXWebEngineView web_browser_view(this, system, input_subsystem.get()); |
| 570 | 571 | ||
| 571 | ui.action_Pause->setEnabled(false); | 572 | ui->action_Pause->setEnabled(false); |
| 572 | ui.action_Restart->setEnabled(false); | 573 | ui->action_Restart->setEnabled(false); |
| 573 | ui.action_Stop->setEnabled(false); | 574 | ui->action_Stop->setEnabled(false); |
| 574 | 575 | ||
| 575 | { | 576 | { |
| 576 | QProgressDialog loading_progress(this); | 577 | QProgressDialog loading_progress(this); |
| @@ -634,7 +635,7 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, | |||
| 634 | web_browser_view.SetFinished(true); | 635 | web_browser_view.SetFinished(true); |
| 635 | } | 636 | } |
| 636 | }); | 637 | }); |
| 637 | ui.menubar->addAction(exit_action); | 638 | ui->menubar->addAction(exit_action); |
| 638 | 639 | ||
| 639 | while (!web_browser_view.IsFinished()) { | 640 | while (!web_browser_view.IsFinished()) { |
| 640 | QCoreApplication::processEvents(); | 641 | QCoreApplication::processEvents(); |
| @@ -676,11 +677,11 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, | |||
| 676 | render_window->show(); | 677 | render_window->show(); |
| 677 | } | 678 | } |
| 678 | 679 | ||
| 679 | ui.action_Pause->setEnabled(true); | 680 | ui->action_Pause->setEnabled(true); |
| 680 | ui.action_Restart->setEnabled(true); | 681 | ui->action_Restart->setEnabled(true); |
| 681 | ui.action_Stop->setEnabled(true); | 682 | ui->action_Stop->setEnabled(true); |
| 682 | 683 | ||
| 683 | ui.menubar->removeAction(exit_action); | 684 | ui->menubar->removeAction(exit_action); |
| 684 | 685 | ||
| 685 | QCoreApplication::processEvents(); | 686 | QCoreApplication::processEvents(); |
| 686 | 687 | ||
| @@ -696,21 +697,21 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, | |||
| 696 | 697 | ||
| 697 | void GMainWindow::InitializeWidgets() { | 698 | void GMainWindow::InitializeWidgets() { |
| 698 | #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING | 699 | #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING |
| 699 | ui.action_Report_Compatibility->setVisible(true); | 700 | ui->action_Report_Compatibility->setVisible(true); |
| 700 | #endif | 701 | #endif |
| 701 | render_window = new GRenderWindow(this, emu_thread.get(), input_subsystem, system); | 702 | render_window = new GRenderWindow(this, emu_thread.get(), input_subsystem, system); |
| 702 | render_window->hide(); | 703 | render_window->hide(); |
| 703 | 704 | ||
| 704 | game_list = new GameList(vfs, provider.get(), system, this); | 705 | game_list = new GameList(vfs, provider.get(), system, this); |
| 705 | ui.horizontalLayout->addWidget(game_list); | 706 | ui->horizontalLayout->addWidget(game_list); |
| 706 | 707 | ||
| 707 | game_list_placeholder = new GameListPlaceholder(this); | 708 | game_list_placeholder = new GameListPlaceholder(this); |
| 708 | ui.horizontalLayout->addWidget(game_list_placeholder); | 709 | ui->horizontalLayout->addWidget(game_list_placeholder); |
| 709 | game_list_placeholder->setVisible(false); | 710 | game_list_placeholder->setVisible(false); |
| 710 | 711 | ||
| 711 | loading_screen = new LoadingScreen(this); | 712 | loading_screen = new LoadingScreen(this); |
| 712 | loading_screen->hide(); | 713 | loading_screen->hide(); |
| 713 | ui.horizontalLayout->addWidget(loading_screen); | 714 | ui->horizontalLayout->addWidget(loading_screen); |
| 714 | connect(loading_screen, &LoadingScreen::Hidden, [&] { | 715 | connect(loading_screen, &LoadingScreen::Hidden, [&] { |
| 715 | loading_screen->Clear(); | 716 | loading_screen->Clear(); |
| 716 | if (emulation_running) { | 717 | if (emulation_running) { |
| @@ -835,7 +836,7 @@ void GMainWindow::InitializeWidgets() { | |||
| 835 | } | 836 | } |
| 836 | 837 | ||
| 837 | void GMainWindow::InitializeDebugWidgets() { | 838 | void GMainWindow::InitializeDebugWidgets() { |
| 838 | QMenu* debug_menu = ui.menu_View_Debugging; | 839 | QMenu* debug_menu = ui->menu_View_Debugging; |
| 839 | 840 | ||
| 840 | #if MICROPROFILE_ENABLED | 841 | #if MICROPROFILE_ENABLED |
| 841 | microProfileDialog = new MicroProfileDialog(this); | 842 | microProfileDialog = new MicroProfileDialog(this); |
| @@ -864,16 +865,16 @@ void GMainWindow::InitializeRecentFileMenuActions() { | |||
| 864 | actions_recent_files[i]->setVisible(false); | 865 | actions_recent_files[i]->setVisible(false); |
| 865 | connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile); | 866 | connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile); |
| 866 | 867 | ||
| 867 | ui.menu_recent_files->addAction(actions_recent_files[i]); | 868 | ui->menu_recent_files->addAction(actions_recent_files[i]); |
| 868 | } | 869 | } |
| 869 | ui.menu_recent_files->addSeparator(); | 870 | ui->menu_recent_files->addSeparator(); |
| 870 | QAction* action_clear_recent_files = new QAction(this); | 871 | QAction* action_clear_recent_files = new QAction(this); |
| 871 | action_clear_recent_files->setText(tr("&Clear Recent Files")); | 872 | action_clear_recent_files->setText(tr("&Clear Recent Files")); |
| 872 | connect(action_clear_recent_files, &QAction::triggered, this, [this] { | 873 | connect(action_clear_recent_files, &QAction::triggered, this, [this] { |
| 873 | UISettings::values.recent_files.clear(); | 874 | UISettings::values.recent_files.clear(); |
| 874 | UpdateRecentFiles(); | 875 | UpdateRecentFiles(); |
| 875 | }); | 876 | }); |
| 876 | ui.menu_recent_files->addAction(action_clear_recent_files); | 877 | ui->menu_recent_files->addAction(action_clear_recent_files); |
| 877 | 878 | ||
| 878 | UpdateRecentFiles(); | 879 | UpdateRecentFiles(); |
| 879 | } | 880 | } |
| @@ -892,43 +893,43 @@ void GMainWindow::InitializeHotkeys() { | |||
| 892 | const QString fullscreen = QStringLiteral("Fullscreen"); | 893 | const QString fullscreen = QStringLiteral("Fullscreen"); |
| 893 | const QString capture_screenshot = QStringLiteral("Capture Screenshot"); | 894 | const QString capture_screenshot = QStringLiteral("Capture Screenshot"); |
| 894 | 895 | ||
| 895 | ui.action_Load_File->setShortcut(hotkey_registry.GetKeySequence(main_window, load_file)); | 896 | ui->action_Load_File->setShortcut(hotkey_registry.GetKeySequence(main_window, load_file)); |
| 896 | ui.action_Load_File->setShortcutContext( | 897 | ui->action_Load_File->setShortcutContext( |
| 897 | hotkey_registry.GetShortcutContext(main_window, load_file)); | 898 | hotkey_registry.GetShortcutContext(main_window, load_file)); |
| 898 | 899 | ||
| 899 | ui.action_Load_Amiibo->setShortcut(hotkey_registry.GetKeySequence(main_window, load_amiibo)); | 900 | ui->action_Load_Amiibo->setShortcut(hotkey_registry.GetKeySequence(main_window, load_amiibo)); |
| 900 | ui.action_Load_Amiibo->setShortcutContext( | 901 | ui->action_Load_Amiibo->setShortcutContext( |
| 901 | hotkey_registry.GetShortcutContext(main_window, load_amiibo)); | 902 | hotkey_registry.GetShortcutContext(main_window, load_amiibo)); |
| 902 | 903 | ||
| 903 | ui.action_Exit->setShortcut(hotkey_registry.GetKeySequence(main_window, exit_yuzu)); | 904 | ui->action_Exit->setShortcut(hotkey_registry.GetKeySequence(main_window, exit_yuzu)); |
| 904 | ui.action_Exit->setShortcutContext(hotkey_registry.GetShortcutContext(main_window, exit_yuzu)); | 905 | ui->action_Exit->setShortcutContext(hotkey_registry.GetShortcutContext(main_window, exit_yuzu)); |
| 905 | 906 | ||
| 906 | ui.action_Restart->setShortcut(hotkey_registry.GetKeySequence(main_window, restart_emulation)); | 907 | ui->action_Restart->setShortcut(hotkey_registry.GetKeySequence(main_window, restart_emulation)); |
| 907 | ui.action_Restart->setShortcutContext( | 908 | ui->action_Restart->setShortcutContext( |
| 908 | hotkey_registry.GetShortcutContext(main_window, restart_emulation)); | 909 | hotkey_registry.GetShortcutContext(main_window, restart_emulation)); |
| 909 | 910 | ||
| 910 | ui.action_Stop->setShortcut(hotkey_registry.GetKeySequence(main_window, stop_emulation)); | 911 | ui->action_Stop->setShortcut(hotkey_registry.GetKeySequence(main_window, stop_emulation)); |
| 911 | ui.action_Stop->setShortcutContext( | 912 | ui->action_Stop->setShortcutContext( |
| 912 | hotkey_registry.GetShortcutContext(main_window, stop_emulation)); | 913 | hotkey_registry.GetShortcutContext(main_window, stop_emulation)); |
| 913 | 914 | ||
| 914 | ui.action_Show_Filter_Bar->setShortcut( | 915 | ui->action_Show_Filter_Bar->setShortcut( |
| 915 | hotkey_registry.GetKeySequence(main_window, toggle_filter_bar)); | 916 | hotkey_registry.GetKeySequence(main_window, toggle_filter_bar)); |
| 916 | ui.action_Show_Filter_Bar->setShortcutContext( | 917 | ui->action_Show_Filter_Bar->setShortcutContext( |
| 917 | hotkey_registry.GetShortcutContext(main_window, toggle_filter_bar)); | 918 | hotkey_registry.GetShortcutContext(main_window, toggle_filter_bar)); |
| 918 | 919 | ||
| 919 | ui.action_Show_Status_Bar->setShortcut( | 920 | ui->action_Show_Status_Bar->setShortcut( |
| 920 | hotkey_registry.GetKeySequence(main_window, toggle_status_bar)); | 921 | hotkey_registry.GetKeySequence(main_window, toggle_status_bar)); |
| 921 | ui.action_Show_Status_Bar->setShortcutContext( | 922 | ui->action_Show_Status_Bar->setShortcutContext( |
| 922 | hotkey_registry.GetShortcutContext(main_window, toggle_status_bar)); | 923 | hotkey_registry.GetShortcutContext(main_window, toggle_status_bar)); |
| 923 | 924 | ||
| 924 | ui.action_Capture_Screenshot->setShortcut( | 925 | ui->action_Capture_Screenshot->setShortcut( |
| 925 | hotkey_registry.GetKeySequence(main_window, capture_screenshot)); | 926 | hotkey_registry.GetKeySequence(main_window, capture_screenshot)); |
| 926 | ui.action_Capture_Screenshot->setShortcutContext( | 927 | ui->action_Capture_Screenshot->setShortcutContext( |
| 927 | hotkey_registry.GetShortcutContext(main_window, capture_screenshot)); | 928 | hotkey_registry.GetShortcutContext(main_window, capture_screenshot)); |
| 928 | 929 | ||
| 929 | ui.action_Fullscreen->setShortcut( | 930 | ui->action_Fullscreen->setShortcut( |
| 930 | hotkey_registry.GetHotkey(main_window, fullscreen, this)->key()); | 931 | hotkey_registry.GetHotkey(main_window, fullscreen, this)->key()); |
| 931 | ui.action_Fullscreen->setShortcutContext( | 932 | ui->action_Fullscreen->setShortcutContext( |
| 932 | hotkey_registry.GetShortcutContext(main_window, fullscreen)); | 933 | hotkey_registry.GetShortcutContext(main_window, fullscreen)); |
| 933 | 934 | ||
| 934 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load File"), this), | 935 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load File"), this), |
| @@ -952,13 +953,13 @@ void GMainWindow::InitializeHotkeys() { | |||
| 952 | BootGame(game_path); | 953 | BootGame(game_path); |
| 953 | }); | 954 | }); |
| 954 | connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), | 955 | connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), |
| 955 | &QShortcut::activated, ui.action_Fullscreen, &QAction::trigger); | 956 | &QShortcut::activated, ui->action_Fullscreen, &QAction::trigger); |
| 956 | connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), | 957 | connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), |
| 957 | &QShortcut::activatedAmbiguously, ui.action_Fullscreen, &QAction::trigger); | 958 | &QShortcut::activatedAmbiguously, ui->action_Fullscreen, &QAction::trigger); |
| 958 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this), | 959 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this), |
| 959 | &QShortcut::activated, this, [&] { | 960 | &QShortcut::activated, this, [&] { |
| 960 | if (emulation_running) { | 961 | if (emulation_running) { |
| 961 | ui.action_Fullscreen->setChecked(false); | 962 | ui->action_Fullscreen->setChecked(false); |
| 962 | ToggleFullscreen(); | 963 | ToggleFullscreen(); |
| 963 | } | 964 | } |
| 964 | }); | 965 | }); |
| @@ -987,7 +988,7 @@ void GMainWindow::InitializeHotkeys() { | |||
| 987 | }); | 988 | }); |
| 988 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load Amiibo"), this), | 989 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load Amiibo"), this), |
| 989 | &QShortcut::activated, this, [&] { | 990 | &QShortcut::activated, this, [&] { |
| 990 | if (ui.action_Load_Amiibo->isEnabled()) { | 991 | if (ui->action_Load_Amiibo->isEnabled()) { |
| 991 | OnLoadAmiibo(); | 992 | OnLoadAmiibo(); |
| 992 | } | 993 | } |
| 993 | }); | 994 | }); |
| @@ -1068,20 +1069,20 @@ void GMainWindow::RestoreUIState() { | |||
| 1068 | 1069 | ||
| 1069 | game_list->LoadInterfaceLayout(); | 1070 | game_list->LoadInterfaceLayout(); |
| 1070 | 1071 | ||
| 1071 | ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode.GetValue()); | 1072 | ui->action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode.GetValue()); |
| 1072 | ToggleWindowMode(); | 1073 | ToggleWindowMode(); |
| 1073 | 1074 | ||
| 1074 | ui.action_Fullscreen->setChecked(UISettings::values.fullscreen.GetValue()); | 1075 | ui->action_Fullscreen->setChecked(UISettings::values.fullscreen.GetValue()); |
| 1075 | 1076 | ||
| 1076 | ui.action_Display_Dock_Widget_Headers->setChecked( | 1077 | ui->action_Display_Dock_Widget_Headers->setChecked( |
| 1077 | UISettings::values.display_titlebar.GetValue()); | 1078 | UISettings::values.display_titlebar.GetValue()); |
| 1078 | OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); | 1079 | OnDisplayTitleBars(ui->action_Display_Dock_Widget_Headers->isChecked()); |
| 1079 | 1080 | ||
| 1080 | ui.action_Show_Filter_Bar->setChecked(UISettings::values.show_filter_bar.GetValue()); | 1081 | ui->action_Show_Filter_Bar->setChecked(UISettings::values.show_filter_bar.GetValue()); |
| 1081 | game_list->SetFilterVisible(ui.action_Show_Filter_Bar->isChecked()); | 1082 | game_list->SetFilterVisible(ui->action_Show_Filter_Bar->isChecked()); |
| 1082 | 1083 | ||
| 1083 | ui.action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar.GetValue()); | 1084 | ui->action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar.GetValue()); |
| 1084 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | 1085 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); |
| 1085 | Debugger::ToggleConsole(); | 1086 | Debugger::ToggleConsole(); |
| 1086 | } | 1087 | } |
| 1087 | 1088 | ||
| @@ -1093,11 +1094,11 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { | |||
| 1093 | state != Qt::ApplicationActive) { | 1094 | state != Qt::ApplicationActive) { |
| 1094 | LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); | 1095 | LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); |
| 1095 | } | 1096 | } |
| 1096 | if (ui.action_Pause->isEnabled() && | 1097 | if (ui->action_Pause->isEnabled() && |
| 1097 | (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { | 1098 | (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { |
| 1098 | auto_paused = true; | 1099 | auto_paused = true; |
| 1099 | OnPauseGame(); | 1100 | OnPauseGame(); |
| 1100 | } else if (ui.action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) { | 1101 | } else if (ui->action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) { |
| 1101 | auto_paused = false; | 1102 | auto_paused = false; |
| 1102 | OnStartGame(); | 1103 | OnStartGame(); |
| 1103 | } | 1104 | } |
| @@ -1142,59 +1143,60 @@ void GMainWindow::ConnectWidgetEvents() { | |||
| 1142 | 1143 | ||
| 1143 | void GMainWindow::ConnectMenuEvents() { | 1144 | void GMainWindow::ConnectMenuEvents() { |
| 1144 | // File | 1145 | // File |
| 1145 | connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); | 1146 | connect(ui->action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); |
| 1146 | connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); | 1147 | connect(ui->action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); |
| 1147 | connect(ui.action_Install_File_NAND, &QAction::triggered, this, | 1148 | connect(ui->action_Install_File_NAND, &QAction::triggered, this, |
| 1148 | &GMainWindow::OnMenuInstallToNAND); | 1149 | &GMainWindow::OnMenuInstallToNAND); |
| 1149 | connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); | 1150 | connect(ui->action_Exit, &QAction::triggered, this, &QMainWindow::close); |
| 1150 | connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); | 1151 | connect(ui->action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); |
| 1151 | 1152 | ||
| 1152 | // Emulation | 1153 | // Emulation |
| 1153 | connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); | 1154 | connect(ui->action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); |
| 1154 | connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); | 1155 | connect(ui->action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); |
| 1155 | connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); | 1156 | connect(ui->action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); |
| 1156 | connect(ui.action_Report_Compatibility, &QAction::triggered, this, | 1157 | connect(ui->action_Report_Compatibility, &QAction::triggered, this, |
| 1157 | &GMainWindow::OnMenuReportCompatibility); | 1158 | &GMainWindow::OnMenuReportCompatibility); |
| 1158 | connect(ui.action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); | 1159 | connect(ui->action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); |
| 1159 | connect(ui.action_Open_Quickstart_Guide, &QAction::triggered, this, | 1160 | connect(ui->action_Open_Quickstart_Guide, &QAction::triggered, this, |
| 1160 | &GMainWindow::OnOpenQuickstartGuide); | 1161 | &GMainWindow::OnOpenQuickstartGuide); |
| 1161 | connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); | 1162 | connect(ui->action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); |
| 1162 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); | 1163 | connect(ui->action_Restart, &QAction::triggered, this, |
| 1163 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); | 1164 | [this] { BootGame(QString(game_path)); }); |
| 1164 | connect(ui.action_Configure_Tas, &QAction::triggered, this, &GMainWindow::OnConfigureTas); | 1165 | connect(ui->action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); |
| 1165 | connect(ui.action_Configure_Current_Game, &QAction::triggered, this, | 1166 | connect(ui->action_Configure_Tas, &QAction::triggered, this, &GMainWindow::OnConfigureTas); |
| 1167 | connect(ui->action_Configure_Current_Game, &QAction::triggered, this, | ||
| 1166 | &GMainWindow::OnConfigurePerGame); | 1168 | &GMainWindow::OnConfigurePerGame); |
| 1167 | 1169 | ||
| 1168 | // View | 1170 | // View |
| 1169 | connect(ui.action_Single_Window_Mode, &QAction::triggered, this, | 1171 | connect(ui->action_Single_Window_Mode, &QAction::triggered, this, |
| 1170 | &GMainWindow::ToggleWindowMode); | 1172 | &GMainWindow::ToggleWindowMode); |
| 1171 | connect(ui.action_Display_Dock_Widget_Headers, &QAction::triggered, this, | 1173 | connect(ui->action_Display_Dock_Widget_Headers, &QAction::triggered, this, |
| 1172 | &GMainWindow::OnDisplayTitleBars); | 1174 | &GMainWindow::OnDisplayTitleBars); |
| 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 1175 | connect(ui->action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 1176 | connect(ui->action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 1175 | 1177 | ||
| 1176 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, | 1178 | connect(ui->action_Reset_Window_Size_720, &QAction::triggered, this, |
| 1177 | &GMainWindow::ResetWindowSize720); | 1179 | &GMainWindow::ResetWindowSize720); |
| 1178 | connect(ui.action_Reset_Window_Size_900, &QAction::triggered, this, | 1180 | connect(ui->action_Reset_Window_Size_900, &QAction::triggered, this, |
| 1179 | &GMainWindow::ResetWindowSize900); | 1181 | &GMainWindow::ResetWindowSize900); |
| 1180 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, | 1182 | connect(ui->action_Reset_Window_Size_1080, &QAction::triggered, this, |
| 1181 | &GMainWindow::ResetWindowSize1080); | 1183 | &GMainWindow::ResetWindowSize1080); |
| 1182 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_720); | 1184 | ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_720); |
| 1183 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_900); | 1185 | ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_900); |
| 1184 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_1080); | 1186 | ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_1080); |
| 1185 | 1187 | ||
| 1186 | // Fullscreen | 1188 | // Fullscreen |
| 1187 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); | 1189 | connect(ui->action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); |
| 1188 | 1190 | ||
| 1189 | // Movie | 1191 | // Movie |
| 1190 | connect(ui.action_Capture_Screenshot, &QAction::triggered, this, | 1192 | connect(ui->action_Capture_Screenshot, &QAction::triggered, this, |
| 1191 | &GMainWindow::OnCaptureScreenshot); | 1193 | &GMainWindow::OnCaptureScreenshot); |
| 1192 | 1194 | ||
| 1193 | // Help | 1195 | // Help |
| 1194 | connect(ui.action_Open_yuzu_Folder, &QAction::triggered, this, &GMainWindow::OnOpenYuzuFolder); | 1196 | connect(ui->action_Open_yuzu_Folder, &QAction::triggered, this, &GMainWindow::OnOpenYuzuFolder); |
| 1195 | connect(ui.action_Rederive, &QAction::triggered, this, | 1197 | connect(ui->action_Rederive, &QAction::triggered, this, |
| 1196 | std::bind(&GMainWindow::OnReinitializeKeys, this, ReinitializeKeyBehavior::Warning)); | 1198 | std::bind(&GMainWindow::OnReinitializeKeys, this, ReinitializeKeyBehavior::Warning)); |
| 1197 | connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout); | 1199 | connect(ui->action_About, &QAction::triggered, this, &GMainWindow::OnAbout); |
| 1198 | } | 1200 | } |
| 1199 | 1201 | ||
| 1200 | void GMainWindow::OnDisplayTitleBars(bool show) { | 1202 | void GMainWindow::OnDisplayTitleBars(bool show) { |
| @@ -1405,7 +1407,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1405 | 1407 | ||
| 1406 | // Update the GUI | 1408 | // Update the GUI |
| 1407 | UpdateStatusButtons(); | 1409 | UpdateStatusButtons(); |
| 1408 | if (ui.action_Single_Window_Mode->isChecked()) { | 1410 | if (ui->action_Single_Window_Mode->isChecked()) { |
| 1409 | game_list->hide(); | 1411 | game_list->hide(); |
| 1410 | game_list_placeholder->hide(); | 1412 | game_list_placeholder->hide(); |
| 1411 | } | 1413 | } |
| @@ -1451,7 +1453,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1451 | loading_screen->show(); | 1453 | loading_screen->show(); |
| 1452 | 1454 | ||
| 1453 | emulation_running = true; | 1455 | emulation_running = true; |
| 1454 | if (ui.action_Fullscreen->isChecked()) { | 1456 | if (ui->action_Fullscreen->isChecked()) { |
| 1455 | ShowFullscreen(); | 1457 | ShowFullscreen(); |
| 1456 | } | 1458 | } |
| 1457 | OnStartGame(); | 1459 | OnStartGame(); |
| @@ -1462,7 +1464,7 @@ void GMainWindow::ShutdownGame() { | |||
| 1462 | return; | 1464 | return; |
| 1463 | } | 1465 | } |
| 1464 | 1466 | ||
| 1465 | if (ui.action_Fullscreen->isChecked()) { | 1467 | if (ui->action_Fullscreen->isChecked()) { |
| 1466 | HideFullscreen(); | 1468 | HideFullscreen(); |
| 1467 | } | 1469 | } |
| 1468 | 1470 | ||
| @@ -1483,15 +1485,15 @@ void GMainWindow::ShutdownGame() { | |||
| 1483 | disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame); | 1485 | disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame); |
| 1484 | 1486 | ||
| 1485 | // Update the GUI | 1487 | // Update the GUI |
| 1486 | ui.action_Start->setEnabled(false); | 1488 | ui->action_Start->setEnabled(false); |
| 1487 | ui.action_Start->setText(tr("Start")); | 1489 | ui->action_Start->setText(tr("Start")); |
| 1488 | ui.action_Pause->setEnabled(false); | 1490 | ui->action_Pause->setEnabled(false); |
| 1489 | ui.action_Stop->setEnabled(false); | 1491 | ui->action_Stop->setEnabled(false); |
| 1490 | ui.action_Restart->setEnabled(false); | 1492 | ui->action_Restart->setEnabled(false); |
| 1491 | ui.action_Configure_Current_Game->setEnabled(false); | 1493 | ui->action_Configure_Current_Game->setEnabled(false); |
| 1492 | ui.action_Report_Compatibility->setEnabled(false); | 1494 | ui->action_Report_Compatibility->setEnabled(false); |
| 1493 | ui.action_Load_Amiibo->setEnabled(false); | 1495 | ui->action_Load_Amiibo->setEnabled(false); |
| 1494 | ui.action_Capture_Screenshot->setEnabled(false); | 1496 | ui->action_Capture_Screenshot->setEnabled(false); |
| 1495 | render_window->hide(); | 1497 | render_window->hide(); |
| 1496 | loading_screen->hide(); | 1498 | loading_screen->hide(); |
| 1497 | loading_screen->Clear(); | 1499 | loading_screen->Clear(); |
| @@ -1553,7 +1555,7 @@ void GMainWindow::UpdateRecentFiles() { | |||
| 1553 | } | 1555 | } |
| 1554 | 1556 | ||
| 1555 | // Enable the recent files menu if the list isn't empty | 1557 | // Enable the recent files menu if the list isn't empty |
| 1556 | ui.menu_recent_files->setEnabled(num_recent_files != 0); | 1558 | ui->menu_recent_files->setEnabled(num_recent_files != 0); |
| 1557 | } | 1559 | } |
| 1558 | 1560 | ||
| 1559 | void GMainWindow::OnGameListLoadFile(QString game_path, u64 program_id) { | 1561 | void GMainWindow::OnGameListLoadFile(QString game_path, u64 program_id) { |
| @@ -2079,7 +2081,7 @@ void GMainWindow::OnGameListAddDirectory() { | |||
| 2079 | } | 2081 | } |
| 2080 | 2082 | ||
| 2081 | void GMainWindow::OnGameListShowList(bool show) { | 2083 | void GMainWindow::OnGameListShowList(bool show) { |
| 2082 | if (emulation_running && ui.action_Single_Window_Mode->isChecked()) | 2084 | if (emulation_running && ui->action_Single_Window_Mode->isChecked()) |
| 2083 | return; | 2085 | return; |
| 2084 | game_list->setVisible(show); | 2086 | game_list->setVisible(show); |
| 2085 | game_list_placeholder->setVisible(!show); | 2087 | game_list_placeholder->setVisible(!show); |
| @@ -2181,7 +2183,7 @@ void GMainWindow::OnMenuInstallToNAND() { | |||
| 2181 | QStringList failed_files{}; // Files that failed to install due to errors | 2183 | QStringList failed_files{}; // Files that failed to install due to errors |
| 2182 | bool detected_base_install{}; // Whether a base game was attempted to be installed | 2184 | bool detected_base_install{}; // Whether a base game was attempted to be installed |
| 2183 | 2185 | ||
| 2184 | ui.action_Install_File_NAND->setEnabled(false); | 2186 | ui->action_Install_File_NAND->setEnabled(false); |
| 2185 | 2187 | ||
| 2186 | install_progress = new QProgressDialog(QString{}, tr("Cancel"), 0, total_size, this); | 2188 | install_progress = new QProgressDialog(QString{}, tr("Cancel"), 0, total_size, this); |
| 2187 | install_progress->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint & | 2189 | install_progress->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint & |
| @@ -2257,7 +2259,7 @@ void GMainWindow::OnMenuInstallToNAND() { | |||
| 2257 | Common::FS::RemoveDirRecursively(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / | 2259 | Common::FS::RemoveDirRecursively(Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / |
| 2258 | "game_list"); | 2260 | "game_list"); |
| 2259 | game_list->PopulateAsync(UISettings::values.game_dirs); | 2261 | game_list->PopulateAsync(UISettings::values.game_dirs); |
| 2260 | ui.action_Install_File_NAND->setEnabled(true); | 2262 | ui->action_Install_File_NAND->setEnabled(true); |
| 2261 | } | 2263 | } |
| 2262 | 2264 | ||
| 2263 | InstallResult GMainWindow::InstallNSPXCI(const QString& filename) { | 2265 | InstallResult GMainWindow::InstallNSPXCI(const QString& filename) { |
| @@ -2381,15 +2383,13 @@ InstallResult GMainWindow::InstallNCA(const QString& filename) { | |||
| 2381 | static_cast<size_t>(FileSys::TitleType::FirmwarePackageB); | 2383 | static_cast<size_t>(FileSys::TitleType::FirmwarePackageB); |
| 2382 | } | 2384 | } |
| 2383 | 2385 | ||
| 2384 | FileSys::InstallResult res; | 2386 | const bool is_application = index >= static_cast<s32>(FileSys::TitleType::Application); |
| 2385 | if (index >= static_cast<s32>(FileSys::TitleType::Application)) { | 2387 | const auto& fs_controller = system.GetFileSystemController(); |
| 2386 | res = system.GetFileSystemController().GetUserNANDContents()->InstallEntry( | 2388 | auto* registered_cache = is_application ? fs_controller.GetUserNANDContents() |
| 2387 | *nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy); | 2389 | : fs_controller.GetSystemNANDContents(); |
| 2388 | } else { | ||
| 2389 | res = system.GetFileSystemController().GetSystemNANDContents()->InstallEntry( | ||
| 2390 | *nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy); | ||
| 2391 | } | ||
| 2392 | 2390 | ||
| 2391 | const auto res = registered_cache->InstallEntry(*nca, static_cast<FileSys::TitleType>(index), | ||
| 2392 | true, qt_raw_copy); | ||
| 2393 | if (res == FileSys::InstallResult::Success) { | 2393 | if (res == FileSys::InstallResult::Success) { |
| 2394 | return InstallResult::Success; | 2394 | return InstallResult::Success; |
| 2395 | } else if (res == FileSys::InstallResult::OverwriteExisting) { | 2395 | } else if (res == FileSys::InstallResult::OverwriteExisting) { |
| @@ -2423,27 +2423,27 @@ void GMainWindow::OnStartGame() { | |||
| 2423 | 2423 | ||
| 2424 | connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); | 2424 | connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); |
| 2425 | 2425 | ||
| 2426 | ui.action_Start->setEnabled(false); | 2426 | ui->action_Start->setEnabled(false); |
| 2427 | ui.action_Start->setText(tr("&Continue")); | 2427 | ui->action_Start->setText(tr("&Continue")); |
| 2428 | 2428 | ||
| 2429 | ui.action_Pause->setEnabled(true); | 2429 | ui->action_Pause->setEnabled(true); |
| 2430 | ui.action_Stop->setEnabled(true); | 2430 | ui->action_Stop->setEnabled(true); |
| 2431 | ui.action_Restart->setEnabled(true); | 2431 | ui->action_Restart->setEnabled(true); |
| 2432 | ui.action_Configure_Current_Game->setEnabled(true); | 2432 | ui->action_Configure_Current_Game->setEnabled(true); |
| 2433 | ui.action_Report_Compatibility->setEnabled(true); | 2433 | ui->action_Report_Compatibility->setEnabled(true); |
| 2434 | 2434 | ||
| 2435 | discord_rpc->Update(); | 2435 | discord_rpc->Update(); |
| 2436 | ui.action_Load_Amiibo->setEnabled(true); | 2436 | ui->action_Load_Amiibo->setEnabled(true); |
| 2437 | ui.action_Capture_Screenshot->setEnabled(true); | 2437 | ui->action_Capture_Screenshot->setEnabled(true); |
| 2438 | } | 2438 | } |
| 2439 | 2439 | ||
| 2440 | void GMainWindow::OnPauseGame() { | 2440 | void GMainWindow::OnPauseGame() { |
| 2441 | emu_thread->SetRunning(false); | 2441 | emu_thread->SetRunning(false); |
| 2442 | 2442 | ||
| 2443 | ui.action_Start->setEnabled(true); | 2443 | ui->action_Start->setEnabled(true); |
| 2444 | ui.action_Pause->setEnabled(false); | 2444 | ui->action_Pause->setEnabled(false); |
| 2445 | ui.action_Stop->setEnabled(true); | 2445 | ui->action_Stop->setEnabled(true); |
| 2446 | ui.action_Capture_Screenshot->setEnabled(false); | 2446 | ui->action_Capture_Screenshot->setEnabled(false); |
| 2447 | 2447 | ||
| 2448 | AllowOSSleep(); | 2448 | AllowOSSleep(); |
| 2449 | } | 2449 | } |
| @@ -2519,7 +2519,7 @@ void GMainWindow::ToggleFullscreen() { | |||
| 2519 | if (!emulation_running) { | 2519 | if (!emulation_running) { |
| 2520 | return; | 2520 | return; |
| 2521 | } | 2521 | } |
| 2522 | if (ui.action_Fullscreen->isChecked()) { | 2522 | if (ui->action_Fullscreen->isChecked()) { |
| 2523 | ShowFullscreen(); | 2523 | ShowFullscreen(); |
| 2524 | } else { | 2524 | } else { |
| 2525 | HideFullscreen(); | 2525 | HideFullscreen(); |
| @@ -2527,10 +2527,10 @@ void GMainWindow::ToggleFullscreen() { | |||
| 2527 | } | 2527 | } |
| 2528 | 2528 | ||
| 2529 | void GMainWindow::ShowFullscreen() { | 2529 | void GMainWindow::ShowFullscreen() { |
| 2530 | if (ui.action_Single_Window_Mode->isChecked()) { | 2530 | if (ui->action_Single_Window_Mode->isChecked()) { |
| 2531 | UISettings::values.geometry = saveGeometry(); | 2531 | UISettings::values.geometry = saveGeometry(); |
| 2532 | 2532 | ||
| 2533 | ui.menubar->hide(); | 2533 | ui->menubar->hide(); |
| 2534 | statusBar()->hide(); | 2534 | statusBar()->hide(); |
| 2535 | 2535 | ||
| 2536 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2536 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { |
| @@ -2564,7 +2564,7 @@ void GMainWindow::ShowFullscreen() { | |||
| 2564 | } | 2564 | } |
| 2565 | 2565 | ||
| 2566 | void GMainWindow::HideFullscreen() { | 2566 | void GMainWindow::HideFullscreen() { |
| 2567 | if (ui.action_Single_Window_Mode->isChecked()) { | 2567 | if (ui->action_Single_Window_Mode->isChecked()) { |
| 2568 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2568 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { |
| 2569 | showNormal(); | 2569 | showNormal(); |
| 2570 | restoreGeometry(UISettings::values.geometry); | 2570 | restoreGeometry(UISettings::values.geometry); |
| @@ -2576,8 +2576,8 @@ void GMainWindow::HideFullscreen() { | |||
| 2576 | show(); | 2576 | show(); |
| 2577 | } | 2577 | } |
| 2578 | 2578 | ||
| 2579 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | 2579 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); |
| 2580 | ui.menubar->show(); | 2580 | ui->menubar->show(); |
| 2581 | } else { | 2581 | } else { |
| 2582 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { | 2582 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) { |
| 2583 | render_window->showNormal(); | 2583 | render_window->showNormal(); |
| @@ -2593,10 +2593,10 @@ void GMainWindow::HideFullscreen() { | |||
| 2593 | } | 2593 | } |
| 2594 | 2594 | ||
| 2595 | void GMainWindow::ToggleWindowMode() { | 2595 | void GMainWindow::ToggleWindowMode() { |
| 2596 | if (ui.action_Single_Window_Mode->isChecked()) { | 2596 | if (ui->action_Single_Window_Mode->isChecked()) { |
| 2597 | // Render in the main window... | 2597 | // Render in the main window... |
| 2598 | render_window->BackupGeometry(); | 2598 | render_window->BackupGeometry(); |
| 2599 | ui.horizontalLayout->addWidget(render_window); | 2599 | ui->horizontalLayout->addWidget(render_window); |
| 2600 | render_window->setFocusPolicy(Qt::StrongFocus); | 2600 | render_window->setFocusPolicy(Qt::StrongFocus); |
| 2601 | if (emulation_running) { | 2601 | if (emulation_running) { |
| 2602 | render_window->setVisible(true); | 2602 | render_window->setVisible(true); |
| @@ -2606,7 +2606,7 @@ void GMainWindow::ToggleWindowMode() { | |||
| 2606 | 2606 | ||
| 2607 | } else { | 2607 | } else { |
| 2608 | // Render in a separate window... | 2608 | // Render in a separate window... |
| 2609 | ui.horizontalLayout->removeWidget(render_window); | 2609 | ui->horizontalLayout->removeWidget(render_window); |
| 2610 | render_window->setParent(nullptr); | 2610 | render_window->setParent(nullptr); |
| 2611 | render_window->setFocusPolicy(Qt::NoFocus); | 2611 | render_window->setFocusPolicy(Qt::NoFocus); |
| 2612 | if (emulation_running) { | 2612 | if (emulation_running) { |
| @@ -2621,10 +2621,10 @@ void GMainWindow::ResetWindowSize(u32 width, u32 height) { | |||
| 2621 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2621 | const auto aspect_ratio = Layout::EmulationAspectRatio( |
| 2622 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | 2622 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), |
| 2623 | static_cast<float>(height) / width); | 2623 | static_cast<float>(height) / width); |
| 2624 | if (!ui.action_Single_Window_Mode->isChecked()) { | 2624 | if (!ui->action_Single_Window_Mode->isChecked()) { |
| 2625 | render_window->resize(height / aspect_ratio, height); | 2625 | render_window->resize(height / aspect_ratio, height); |
| 2626 | } else { | 2626 | } else { |
| 2627 | const bool show_status_bar = ui.action_Show_Status_Bar->isChecked(); | 2627 | const bool show_status_bar = ui->action_Show_Status_Bar->isChecked(); |
| 2628 | const auto status_bar_height = show_status_bar ? statusBar()->height() : 0; | 2628 | const auto status_bar_height = show_status_bar ? statusBar()->height() : 0; |
| 2629 | resize(height / aspect_ratio, height + menuBar()->height() + status_bar_height); | 2629 | resize(height / aspect_ratio, height + menuBar()->height() + status_bar_height); |
| 2630 | } | 2630 | } |
| @@ -2835,8 +2835,8 @@ void GMainWindow::OnAbout() { | |||
| 2835 | } | 2835 | } |
| 2836 | 2836 | ||
| 2837 | void GMainWindow::OnToggleFilterBar() { | 2837 | void GMainWindow::OnToggleFilterBar() { |
| 2838 | game_list->SetFilterVisible(ui.action_Show_Filter_Bar->isChecked()); | 2838 | game_list->SetFilterVisible(ui->action_Show_Filter_Bar->isChecked()); |
| 2839 | if (ui.action_Show_Filter_Bar->isChecked()) { | 2839 | if (ui->action_Show_Filter_Bar->isChecked()) { |
| 2840 | game_list->SetFilterFocus(); | 2840 | game_list->SetFilterFocus(); |
| 2841 | } else { | 2841 | } else { |
| 2842 | game_list->ClearFilter(); | 2842 | game_list->ClearFilter(); |
| @@ -3013,7 +3013,7 @@ void GMainWindow::UpdateStatusButtons() { | |||
| 3013 | } | 3013 | } |
| 3014 | 3014 | ||
| 3015 | void GMainWindow::UpdateUISettings() { | 3015 | void GMainWindow::UpdateUISettings() { |
| 3016 | if (!ui.action_Fullscreen->isChecked()) { | 3016 | if (!ui->action_Fullscreen->isChecked()) { |
| 3017 | UISettings::values.geometry = saveGeometry(); | 3017 | UISettings::values.geometry = saveGeometry(); |
| 3018 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | 3018 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); |
| 3019 | } | 3019 | } |
| @@ -3022,11 +3022,11 @@ void GMainWindow::UpdateUISettings() { | |||
| 3022 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); | 3022 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); |
| 3023 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); | 3023 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); |
| 3024 | #endif | 3024 | #endif |
| 3025 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); | 3025 | UISettings::values.single_window_mode = ui->action_Single_Window_Mode->isChecked(); |
| 3026 | UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); | 3026 | UISettings::values.fullscreen = ui->action_Fullscreen->isChecked(); |
| 3027 | UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); | 3027 | UISettings::values.display_titlebar = ui->action_Display_Dock_Widget_Headers->isChecked(); |
| 3028 | UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); | 3028 | UISettings::values.show_filter_bar = ui->action_Show_Filter_Bar->isChecked(); |
| 3029 | UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); | 3029 | UISettings::values.show_status_bar = ui->action_Show_Status_Bar->isChecked(); |
| 3030 | UISettings::values.first_start = false; | 3030 | UISettings::values.first_start = false; |
| 3031 | } | 3031 | } |
| 3032 | 3032 | ||
| @@ -3356,7 +3356,7 @@ void GMainWindow::RequestGameExit() { | |||
| 3356 | } | 3356 | } |
| 3357 | 3357 | ||
| 3358 | void GMainWindow::filterBarSetChecked(bool state) { | 3358 | void GMainWindow::filterBarSetChecked(bool state) { |
| 3359 | ui.action_Show_Filter_Bar->setChecked(state); | 3359 | ui->action_Show_Filter_Bar->setChecked(state); |
| 3360 | emit(OnToggleFilterBar()); | 3360 | emit(OnToggleFilterBar()); |
| 3361 | } | 3361 | } |
| 3362 | 3362 | ||
| @@ -3424,11 +3424,11 @@ void GMainWindow::OnLanguageChanged(const QString& locale) { | |||
| 3424 | 3424 | ||
| 3425 | UISettings::values.language = locale; | 3425 | UISettings::values.language = locale; |
| 3426 | LoadTranslation(); | 3426 | LoadTranslation(); |
| 3427 | ui.retranslateUi(this); | 3427 | ui->retranslateUi(this); |
| 3428 | UpdateWindowTitle(); | 3428 | UpdateWindowTitle(); |
| 3429 | 3429 | ||
| 3430 | if (emulation_running) | 3430 | if (emulation_running) |
| 3431 | ui.action_Start->setText(tr("&Continue")); | 3431 | ui->action_Start->setText(tr("&Continue")); |
| 3432 | } | 3432 | } |
| 3433 | 3433 | ||
| 3434 | void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { | 3434 | void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index e31b3d06b..f501cf400 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | #include "core/core.h" | 16 | #include "core/core.h" |
| 17 | #include "core/hle/service/acc/profile_manager.h" | 17 | #include "core/hle/service/acc/profile_manager.h" |
| 18 | #include "ui_main.h" | ||
| 19 | #include "yuzu/compatibility_list.h" | 18 | #include "yuzu/compatibility_list.h" |
| 20 | #include "yuzu/hotkeys.h" | 19 | #include "yuzu/hotkeys.h" |
| 21 | 20 | ||
| @@ -73,6 +72,10 @@ enum class SwkbdReplyType : u32; | |||
| 73 | enum class WebExitReason : u32; | 72 | enum class WebExitReason : u32; |
| 74 | } // namespace Service::AM::Applets | 73 | } // namespace Service::AM::Applets |
| 75 | 74 | ||
| 75 | namespace Ui { | ||
| 76 | class MainWindow; | ||
| 77 | } | ||
| 78 | |||
| 76 | enum class EmulatedDirectoryTarget { | 79 | enum class EmulatedDirectoryTarget { |
| 77 | NAND, | 80 | NAND, |
| 78 | SDMC, | 81 | SDMC, |
| @@ -306,7 +309,7 @@ private: | |||
| 306 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); | 309 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); |
| 307 | QString GetTasStateDescription() const; | 310 | QString GetTasStateDescription() const; |
| 308 | 311 | ||
| 309 | Ui::MainWindow ui; | 312 | std::unique_ptr<Ui::MainWindow> ui; |
| 310 | 313 | ||
| 311 | std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; | 314 | std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; |
| 312 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem; | 315 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem; |
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 81f741f20..cac19452f 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -60,7 +60,7 @@ struct Values { | |||
| 60 | Settings::BasicSetting<bool> confirm_before_closing{true, "confirmClose"}; | 60 | Settings::BasicSetting<bool> confirm_before_closing{true, "confirmClose"}; |
| 61 | Settings::BasicSetting<bool> first_start{true, "firstStart"}; | 61 | Settings::BasicSetting<bool> first_start{true, "firstStart"}; |
| 62 | Settings::BasicSetting<bool> pause_when_in_background{false, "pauseWhenInBackground"}; | 62 | Settings::BasicSetting<bool> pause_when_in_background{false, "pauseWhenInBackground"}; |
| 63 | Settings::BasicSetting<bool> hide_mouse{false, "hideInactiveMouse"}; | 63 | Settings::BasicSetting<bool> hide_mouse{true, "hideInactiveMouse"}; |
| 64 | 64 | ||
| 65 | Settings::BasicSetting<bool> select_user_on_boot{false, "select_user_on_boot"}; | 65 | Settings::BasicSetting<bool> select_user_on_boot{false, "select_user_on_boot"}; |
| 66 | 66 | ||
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 434518d53..8ca20679a 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -518,6 +518,9 @@ void Config::ReadValues() { | |||
| 518 | ReadSetting("WebService", Settings::values.web_api_url); | 518 | ReadSetting("WebService", Settings::values.web_api_url); |
| 519 | ReadSetting("WebService", Settings::values.yuzu_username); | 519 | ReadSetting("WebService", Settings::values.yuzu_username); |
| 520 | ReadSetting("WebService", Settings::values.yuzu_token); | 520 | ReadSetting("WebService", Settings::values.yuzu_token); |
| 521 | |||
| 522 | // Network | ||
| 523 | ReadSetting("Network", Settings::values.network_interface); | ||
| 521 | } | 524 | } |
| 522 | 525 | ||
| 523 | void Config::Reload() { | 526 | void Config::Reload() { |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 8119a50d8..339dca766 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -428,6 +428,12 @@ web_api_url = https://api.yuzu-emu.org | |||
| 428 | yuzu_username = | 428 | yuzu_username = |
| 429 | yuzu_token = | 429 | yuzu_token = |
| 430 | 430 | ||
| 431 | [Network] | ||
| 432 | # Name of the network interface device to use with yuzu LAN play. | ||
| 433 | # e.g. On *nix: 'enp7s0', 'wlp6s0u1u3u3', 'lo' | ||
| 434 | # e.g. On Windows: 'Ethernet', 'Wi-Fi' | ||
| 435 | network_interface = | ||
| 436 | |||
| 431 | [AddOns] | 437 | [AddOns] |
| 432 | # Used to disable add-ons | 438 | # Used to disable add-ons |
| 433 | # List of title IDs of games that will have add-ons disabled (separated by '|'): | 439 | # List of title IDs of games that will have add-ons disabled (separated by '|'): |