diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-06 20:06:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-06 20:06:44 +0300 |
commit | 09bce81d5eae2a46dd039e9fa14290c77685d637 (patch) | |
tree | 00d3a8332aff9d667d385eaaeb078de4edc441b4 /plugins/StatusManager/src/options.cpp | |
parent | 5a16d189158c71db28c481a44706c73c83fd6e76 (diff) |
fixes #1054 (StatusManager cannot enable/disable modules "on the fly")
Diffstat (limited to 'plugins/StatusManager/src/options.cpp')
-rw-r--r-- | plugins/StatusManager/src/options.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp index 3c5a33799c..dcb6739741 100644 --- a/plugins/StatusManager/src/options.cpp +++ b/plugins/StatusManager/src/options.cpp @@ -35,13 +35,41 @@ void CSubPluginsOptionsDlg::OnApply() { char setting[128]; mir_snprintf(setting, "%s_enabled", KSMODULENAME); - db_set_b(0, MODULENAME, setting, m_enableKeepStatus.GetState()); + int bEnabled = m_enableKeepStatus.GetState(); + if (bEnabled != db_get_b(0, MODULENAME, setting)) { + db_set_b(0, MODULENAME, setting, m_enableKeepStatus.GetState()); + + if (bEnabled) + KeepStatusLoad(); + else + KeepStatusUnload(); + } + mir_snprintf(setting, "%s_enabled", SSMODULENAME); - db_set_b(0, MODULENAME, setting, m_enableStartupStatus.GetState()); + bEnabled = m_enableStartupStatus.GetState(); + if (bEnabled != db_get_b(0, MODULENAME, setting)) { + db_set_b(0, MODULENAME, setting, m_enableStartupStatus.GetState()); + + if (bEnabled) + StartupStatusLoad(); + else + StartupStatusUnload(); + } + mir_snprintf(setting, "%s_enabled", AAAMODULENAME); - db_set_b(0, MODULENAME, setting, m_enableAdvancedAutoAway.GetState()); + bEnabled = m_enableAdvancedAutoAway.GetState(); + if (bEnabled != db_get_b(0, MODULENAME, setting)) { + db_set_b(0, MODULENAME, setting, m_enableAdvancedAutoAway.GetState()); + + if (bEnabled) + AdvancedAutoAwayLoad(); + else + AdvancedAutoAwayUnload(); + } } +///////////////////////////////////////////////////////////////////////////////////////// + int CSubPluginsOptionsDlg::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; |