diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index d5a1916a37..1997f6d68d 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -309,8 +309,6 @@ void InterfacePane::OnSaveConfig() Config::SetBase(Config::MAIN_SHOW_ACTIVE_TITLE, m_checkbox_show_active_title->isChecked()); Config::SetBase(Config::MAIN_PAUSE_ON_FOCUS_LOST, m_checkbox_pause_on_focus_lost->isChecked()); - Common::SetEnableAlert(Config::Get(Config::MAIN_USE_PANIC_HANDLERS)); - auto new_language = m_combobox_language->currentData().toString().toStdString(); if (new_language != Config::Get(Config::MAIN_INTERFACE_LANGUAGE)) { diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 8d9dc2abb8..8e4bbbfdc5 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -57,6 +57,8 @@ namespace UICommon { +static size_t s_config_changed_callback_id; + static void CreateDumpPath(std::string path) { if (!path.empty()) @@ -108,6 +110,12 @@ static void InitCustomPaths() #endif } +static void RefreshConfig() +{ + Common::SetEnableAlert(Config::Get(Config::MAIN_USE_PANIC_HANDLERS)); + Common::SetAbortOnPanicAlert(Config::Get(Config::MAIN_ABORT_ON_PANIC_ALERT)); +} + void Init() { Core::RestoreWiiSettings(Core::RestoreReason::CrashRecovery); @@ -120,12 +128,14 @@ void Init() Common::Log::LogManager::Init(); VideoBackendBase::ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND)); - Common::SetEnableAlert(Config::Get(Config::MAIN_USE_PANIC_HANDLERS)); - Common::SetAbortOnPanicAlert(Config::Get(Config::MAIN_ABORT_ON_PANIC_ALERT)); + s_config_changed_callback_id = Config::AddConfigChangedCallback(RefreshConfig); + RefreshConfig(); } void Shutdown() { + Config::RemoveConfigChangedCallback(s_config_changed_callback_id); + GCAdapter::Shutdown(); WiimoteReal::Shutdown(); Common::Log::LogManager::Shutdown();