diff options
author | aunsane <aunsane@gmail.com> | 2017-01-06 20:12:37 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-01-06 20:12:37 +0300 |
commit | 36a18b725e67bbc0286f4d550a368cc3400fc7ff (patch) | |
tree | aab063191ea8941792929dde23d9b47cb7c3d9c7 /plugins/StatusManager/src/options.cpp | |
parent | b7336b2fc97092442ce643532f67466868a87812 (diff) |
StatusManager: #662
- ability to disable subplugins
- project cleaning
Diffstat (limited to 'plugins/StatusManager/src/options.cpp')
-rw-r--r-- | plugins/StatusManager/src/options.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp new file mode 100644 index 0000000000..b80679a06b --- /dev/null +++ b/plugins/StatusManager/src/options.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" + +CSubPluginsOptionsDlg::CSubPluginsOptionsDlg() + : CPluginDlgBase(hInst, IDD_OPT_SUBPLUGINS, MODULENAME), + m_enableKeepStatus(this, IDC_ENABLE_KEEPSTATUS), + m_enableStartupStatus(this, IDC_ENABLE_STARTUPSTATUS), + m_enableAdvancedAutoAway(this, IDC_ENABLE_ADVANCEDAUTOAWAY) +{ +} + +void CSubPluginsOptionsDlg::OnInitDialog() +{ + CDlgBase::OnInitDialog(); + + wchar_t text[128]; + mir_snwprintf(text, L"Enable \"%s\" *", L"Keep status"); + m_enableKeepStatus.SetText(text); + m_enableKeepStatus.SetState(IsSubPluginEnabled(KSMODULENAME)); + mir_snwprintf(text, L"Enable \"%s\" *", L"Startup status"); + m_enableStartupStatus.SetText(text); + m_enableStartupStatus.SetState(IsSubPluginEnabled(SSMODULENAME)); + mir_snwprintf(text, L"Enable \"%s\" *", L"Advanced auto away"); + m_enableAdvancedAutoAway.SetText(text); + m_enableAdvancedAutoAway.SetState(IsSubPluginEnabled(AAAMODULENAME)); +} + +void CSubPluginsOptionsDlg::OnApply() +{ + char setting[128]; + mir_snprintf(setting, "%s_enabled", KSMODULENAME); + db_set_b(NULL, MODULENAME, setting, m_enableKeepStatus.GetState()); + mir_snprintf(setting, "%s_enabled", SSMODULENAME); + db_set_b(NULL, MODULENAME, setting, m_enableStartupStatus.GetState()); + mir_snprintf(setting, "%s_enabled", AAAMODULENAME); + db_set_b(NULL, MODULENAME, setting, m_enableAdvancedAutoAway.GetState()); +} + +int CSubPluginsOptionsDlg::OnOptionsInit(WPARAM wParam, LPARAM) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.hInstance = hInst; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; + odp.szTitle.w = LPGENW("Status"); + odp.szTab.w = LPGENW("Status manager"); + odp.pDialog = CSubPluginsOptionsDlg::CreateOptionsPage(); + Options_AddPage(wParam, &odp); + + return 0; +}
\ No newline at end of file |