From 1cbe23ed7b0d527a4ae2595ee7810a5c4579ed0a Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 17 Mar 2022 16:55:30 -0400 Subject: [PATCH 1/4] yuzu: Move disable_web_applet to UISettings --- src/yuzu/main.cpp | 4 ++-- src/yuzu/main.h | 3 --- src/yuzu/uisettings.h | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 06774768d9..a3ec822a6b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -587,7 +587,7 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, #ifdef YUZU_USE_QT_WEB_ENGINE // Raw input breaks with the web applet, Disable web applets if enabled - if (disable_web_applet || Settings::values.enable_raw_input) { + if (UISettings::values.disable_web_applet || Settings::values.enable_raw_input) { emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, "http://localhost/"); return; @@ -657,7 +657,7 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, "Super Mario 3D All-Stars. Are you sure you want to disable the web applet?"), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { - disable_web_applet = true; + UISettings::values.disable_web_applet = true; web_browser_view.SetFinished(true); } }); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 6a35b9e3d9..f8ff345578 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -400,9 +400,6 @@ private: // Last game booted, used for multi-process apps QString last_filename_booted; - // Disables the web applet for the rest of the emulated session - bool disable_web_applet{}; - // Applets QtSoftwareKeyboardDialog* software_keyboard = nullptr; diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 06e8b46daf..c952843fe0 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -114,6 +114,7 @@ struct Values { bool configuration_applied; bool reset_to_defaults; + bool disable_web_applet{}; }; extern Values values; From fa46fb90fb9ff34c7208983e1395ca60d43190fc Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 17 Mar 2022 18:03:13 -0400 Subject: [PATCH 2/4] configure_debug: Add option to set disable_web_applet Allow the user to configure the web applet usage ahead of booting the application. --- src/yuzu/configuration/configure_debug.cpp | 8 ++ src/yuzu/configuration/configure_debug.ui | 91 ++++++++++++---------- 2 files changed, 57 insertions(+), 42 deletions(-) diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index c1cf4050c1..c2e6bf8d1a 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -59,6 +59,13 @@ void ConfigureDebug::SetConfiguration() { ui->disable_loop_safety_checks->setChecked( Settings::values.disable_shader_loop_safety_checks.GetValue()); ui->extended_logging->setChecked(Settings::values.extended_logging.GetValue()); + +#ifdef YUZU_USE_QT_WEB_ENGINE + ui->disable_web_applet->setChecked(UISettings::values.disable_web_applet); +#else + ui->disable_web_applet->setEnabled(false); + ui->disable_web_applet->setText(QString::fromUtf8("Web applet not compiled")); +#endif } void ConfigureDebug::ApplyConfiguration() { @@ -80,6 +87,7 @@ void ConfigureDebug::ApplyConfiguration() { ui->disable_loop_safety_checks->isChecked(); Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); Settings::values.extended_logging = ui->extended_logging->isChecked(); + UISettings::values.disable_web_applet = ui->disable_web_applet->isChecked(); Debugger::ToggleConsole(); Common::Log::Filter filter; filter.ParseFilterString(Settings::values.log_filter.GetValue()); diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index 4dd870855d..edb525e82c 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui @@ -8,49 +8,49 @@ Logging - - - - - - - Global Log Filter - - - - - - - - - - - - Show Log in Console - - - - - - - Open Log Location - - - - - - - true - - - When checked, the max size of the log increases from 100 MB to 1 GB - + + + + + - Enable Extended Logging** + Global Log Filter - - - + + + + + + + + + + + Show Log in Console + + + + + + + Open Log Location + + + + + + + true + + + When checked, the max size of the log increases from 100 MB to 1 GB + + + Enable Extended Logging** + + + + @@ -183,7 +183,7 @@ Advanced - row="0" column="0"> + Kiosk (Quest) Mode @@ -218,6 +218,13 @@ + + + + Disable Web Applet** + + + From 7760777c06ba227eba2f985765e07d8f4829a8c6 Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 17 Mar 2022 18:14:27 -0400 Subject: [PATCH 3/4] main: Update Disable Web Applet warning --- src/yuzu/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a3ec822a6b..b137d5e38d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -652,9 +652,8 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, connect(exit_action, &QAction::triggered, this, [this, &web_browser_view] { const auto result = QMessageBox::warning( this, tr("Disable Web Applet"), - tr("Disabling the web applet will cause it to not be shown again for the rest of the " - "emulated session. This can lead to undefined behavior and should only be used with " - "Super Mario 3D All-Stars. Are you sure you want to disable the web applet?"), + tr("Disabling the web applet can lead to undefined behavior and should only be used " + "with Super Mario 3D All-Stars. Are you sure you want to disable the web applet?"), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { UISettings::values.disable_web_applet = true; From db637b5a4c02772eb827ed01a6ecb430e4b65daa Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 17 Mar 2022 19:20:15 -0400 Subject: [PATCH 4/4] yuzu qt: Save disable_web_applet setting The web applet causes multiple issues with the rest of the application. Disable it by default and add a debug option to re-enable it until a proper solution can be found. --- src/yuzu/configuration/config.cpp | 2 ++ src/yuzu/configuration/configure_debug.cpp | 2 +- src/yuzu/main.cpp | 3 ++- src/yuzu/uisettings.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 4b943c6baf..d2e735f480 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -775,6 +775,7 @@ void Config::ReadUIValues() { ReadBasicSetting(UISettings::values.pause_when_in_background); ReadBasicSetting(UISettings::values.mute_when_in_background); ReadBasicSetting(UISettings::values.hide_mouse); + ReadBasicSetting(UISettings::values.disable_web_applet); qt_config->endGroup(); } @@ -1308,6 +1309,7 @@ void Config::SaveUIValues() { WriteBasicSetting(UISettings::values.pause_when_in_background); WriteBasicSetting(UISettings::values.mute_when_in_background); WriteBasicSetting(UISettings::values.hide_mouse); + WriteBasicSetting(UISettings::values.disable_web_applet); qt_config->endGroup(); } diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index c2e6bf8d1a..bd50f7a682 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -61,7 +61,7 @@ void ConfigureDebug::SetConfiguration() { ui->extended_logging->setChecked(Settings::values.extended_logging.GetValue()); #ifdef YUZU_USE_QT_WEB_ENGINE - ui->disable_web_applet->setChecked(UISettings::values.disable_web_applet); + ui->disable_web_applet->setChecked(UISettings::values.disable_web_applet.GetValue()); #else ui->disable_web_applet->setEnabled(false); ui->disable_web_applet->setText(QString::fromUtf8("Web applet not compiled")); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index b137d5e38d..617c42734d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -653,7 +653,8 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, const auto result = QMessageBox::warning( this, tr("Disable Web Applet"), tr("Disabling the web applet can lead to undefined behavior and should only be used " - "with Super Mario 3D All-Stars. Are you sure you want to disable the web applet?"), + "with Super Mario 3D All-Stars. Are you sure you want to disable the web " + "applet?\n(This can be re-enabled in the Debug settings.)"), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { UISettings::values.disable_web_applet = true; diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index c952843fe0..cc5aee3823 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -114,7 +114,7 @@ struct Values { bool configuration_applied; bool reset_to_defaults; - bool disable_web_applet{}; + Settings::BasicSetting disable_web_applet{true, "disable_web_applet"}; }; extern Values values;