Qt: Fix safe mode not resetting on gamesettings clear

This commit is contained in:
Stenzek 2024-10-21 00:09:11 +10:00
parent 05c285f760
commit be268d8bf1
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -190,6 +190,9 @@ void SettingsWindow::addPages()
connect(m_advanced_settings, &AdvancedSettingsWidget::onShowDebugOptionsChanged, m_graphics_settings, connect(m_advanced_settings, &AdvancedSettingsWidget::onShowDebugOptionsChanged, m_graphics_settings,
&GraphicsSettingsWidget::onShowDebugSettingsChanged); &GraphicsSettingsWidget::onShowDebugSettingsChanged);
if (isPerGameSettings())
SettingWidgetBinder::BindWidgetToBoolSetting(m_sif.get(), m_ui.safeMode, "Main", "DisableAllEnhancements", false);
} }
void SettingsWindow::reloadPages() void SettingsWindow::reloadPages()
@ -206,6 +209,8 @@ void SettingsWindow::reloadPages()
delete widget; delete widget;
} }
m_ui.safeMode->disconnect();
addPages(); addPages();
} }
@ -241,7 +246,6 @@ void SettingsWindow::connectUi()
if (m_ui.clearGameSettings) if (m_ui.clearGameSettings)
connect(m_ui.clearGameSettings, &QPushButton::clicked, this, &SettingsWindow::onClearSettingsClicked); connect(m_ui.clearGameSettings, &QPushButton::clicked, this, &SettingsWindow::onClearSettingsClicked);
SettingWidgetBinder::BindWidgetToBoolSetting(m_sif.get(), m_ui.safeMode, "Main", "DisableAllEnhancements", false);
registerWidgetHelp(m_ui.safeMode, tr("Safe Mode"), tr("Unchecked"), registerWidgetHelp(m_ui.safeMode, tr("Safe Mode"), tr("Unchecked"),
tr("Disables all enhancement options, simulating the system as accurately as possible. Use to " tr("Disables all enhancement options, simulating the system as accurately as possible. Use to "
"quickly determine whether an enhancement is responsible for game bugs.")); "quickly determine whether an enhancement is responsible for game bugs."));