summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/opt_gen.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-06 16:15:45 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-06 16:15:55 +0300
commitf580be3d9dcccb14831d6bed9e7dfca600f5b6f8 (patch)
tree468913d477b9d2a9fb430df9a886d24a8cf41887 /plugins/Popup/src/opt_gen.cpp
parent827dbce0a554ccc313fd0b14b45bd57dffeead95 (diff)
popups:
- internal implementation details & all service declarations moved to m_popup_int.h; - all service calls removed and replaced with function calls; - direct access to popup serttings replaced with Popup_Enable / Popup_Enabled;
Diffstat (limited to 'plugins/Popup/src/opt_gen.cpp')
-rw-r--r--plugins/Popup/src/opt_gen.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 80620f84dd..ebe0c4d6e0 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -121,7 +121,6 @@ void LoadOption_General()
PopupOptions.ReorderPopupsWarning = g_plugin.getByte("ReorderPopupsWarning", TRUE);
// disable When
- PopupOptions.ModuleIsEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", TRUE);
PopupOptions.DisableWhenFullscreen = g_plugin.getByte("DisableWhenFullscreen", TRUE);
}
@@ -195,10 +194,13 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups ? BST_CHECKED : BST_UNCHECKED);
// Popup enabled
- CheckDlgButton(hwnd, IDC_POPUPENABLED, PopupOptions.ModuleIsEnabled ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
- EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
+ {
+ bool bEnabled = Popup_Enabled();
+ CheckDlgButton(hwnd, IDC_POPUPENABLED, bEnabled ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), bEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), bEnabled);
+ }
// new status options
{
@@ -341,11 +343,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_POPUPENABLED:
{
+ bool bEnabled = Popup_Enabled();
int chk = IsDlgButtonChecked(hwnd, IDC_POPUPENABLED);
- if (PopupOptions.ModuleIsEnabled&&chk || !PopupOptions.ModuleIsEnabled && !chk)
+ if (bEnabled && chk || !bEnabled && !chk)
svcEnableDisableMenuCommand(0, 0);
- EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
- EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), bEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), bEnabled);
}
break;