Merge pull request #8035 from lat9nq/disable-web-applet

yuzu qt: Disable the web applet by default
This commit is contained in:
bunnei 2022-03-23 21:08:20 -07:00 committed by GitHub
commit c50f2bd4f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 50 deletions

View file

@ -775,6 +775,7 @@ void Config::ReadUIValues() {
ReadBasicSetting(UISettings::values.pause_when_in_background); ReadBasicSetting(UISettings::values.pause_when_in_background);
ReadBasicSetting(UISettings::values.mute_when_in_background); ReadBasicSetting(UISettings::values.mute_when_in_background);
ReadBasicSetting(UISettings::values.hide_mouse); ReadBasicSetting(UISettings::values.hide_mouse);
ReadBasicSetting(UISettings::values.disable_web_applet);
qt_config->endGroup(); qt_config->endGroup();
} }
@ -1308,6 +1309,7 @@ void Config::SaveUIValues() {
WriteBasicSetting(UISettings::values.pause_when_in_background); WriteBasicSetting(UISettings::values.pause_when_in_background);
WriteBasicSetting(UISettings::values.mute_when_in_background); WriteBasicSetting(UISettings::values.mute_when_in_background);
WriteBasicSetting(UISettings::values.hide_mouse); WriteBasicSetting(UISettings::values.hide_mouse);
WriteBasicSetting(UISettings::values.disable_web_applet);
qt_config->endGroup(); qt_config->endGroup();
} }

View file

@ -59,6 +59,13 @@ void ConfigureDebug::SetConfiguration() {
ui->disable_loop_safety_checks->setChecked( ui->disable_loop_safety_checks->setChecked(
Settings::values.disable_shader_loop_safety_checks.GetValue()); Settings::values.disable_shader_loop_safety_checks.GetValue());
ui->extended_logging->setChecked(Settings::values.extended_logging.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.GetValue());
#else
ui->disable_web_applet->setEnabled(false);
ui->disable_web_applet->setText(QString::fromUtf8("Web applet not compiled"));
#endif
} }
void ConfigureDebug::ApplyConfiguration() { void ConfigureDebug::ApplyConfiguration() {
@ -80,6 +87,7 @@ void ConfigureDebug::ApplyConfiguration() {
ui->disable_loop_safety_checks->isChecked(); ui->disable_loop_safety_checks->isChecked();
Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked();
Settings::values.extended_logging = ui->extended_logging->isChecked(); Settings::values.extended_logging = ui->extended_logging->isChecked();
UISettings::values.disable_web_applet = ui->disable_web_applet->isChecked();
Debugger::ToggleConsole(); Debugger::ToggleConsole();
Common::Log::Filter filter; Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue()); filter.ParseFilterString(Settings::values.log_filter.GetValue());

View file

@ -183,7 +183,7 @@
<string>Advanced</string> <string>Advanced</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item> row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="quest_flag"> <widget class="QCheckBox" name="quest_flag">
<property name="text"> <property name="text">
<string>Kiosk (Quest) Mode</string> <string>Kiosk (Quest) Mode</string>
@ -218,6 +218,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="QCheckBox" name="disable_web_applet">
<property name="text">
<string>Disable Web Applet**</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View file

@ -582,7 +582,7 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url,
#ifdef YUZU_USE_QT_WEB_ENGINE #ifdef YUZU_USE_QT_WEB_ENGINE
// Raw input breaks with the web applet, Disable web applets if enabled // 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, emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed,
"http://localhost/"); "http://localhost/");
return; return;
@ -647,12 +647,12 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url,
connect(exit_action, &QAction::triggered, this, [this, &web_browser_view] { connect(exit_action, &QAction::triggered, this, [this, &web_browser_view] {
const auto result = QMessageBox::warning( const auto result = QMessageBox::warning(
this, tr("Disable Web Applet"), this, tr("Disable Web Applet"),
tr("Disabling the web applet will cause it to not be shown again for the rest of the " tr("Disabling the web applet can lead to undefined behavior and should only be used "
"emulated session. This can lead to undefined behavior and should only be used with " "with Super Mario 3D All-Stars. Are you sure you want to disable the web "
"Super Mario 3D All-Stars. Are you sure you want to disable the web applet?"), "applet?\n(This can be re-enabled in the Debug settings.)"),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) { if (result == QMessageBox::Yes) {
disable_web_applet = true; UISettings::values.disable_web_applet = true;
web_browser_view.SetFinished(true); web_browser_view.SetFinished(true);
} }
}); });

View file

@ -398,9 +398,6 @@ private:
// Last game booted, used for multi-process apps // Last game booted, used for multi-process apps
QString last_filename_booted; QString last_filename_booted;
// Disables the web applet for the rest of the emulated session
bool disable_web_applet{};
// Applets // Applets
QtSoftwareKeyboardDialog* software_keyboard = nullptr; QtSoftwareKeyboardDialog* software_keyboard = nullptr;

View file

@ -114,6 +114,7 @@ struct Values {
bool configuration_applied; bool configuration_applied;
bool reset_to_defaults; bool reset_to_defaults;
Settings::BasicSetting<bool> disable_web_applet{true, "disable_web_applet"};
}; };
extern Values values; extern Values values;