summaryrefslogtreecommitdiff
path: root/plugins/AuthState/src/options.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-03-19 14:25:05 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-03-19 14:25:05 +0000
commit49ef96492c4a5a65ca234eaebcfa9846be527975 (patch)
treeb4ac82ecb0c7203b72a9cdfeaf2025a83af49269 /plugins/AuthState/src/options.cpp
parent8b99a8b3a16763267cb2339bb822c2595b659935 (diff)
AuthState: fix extraicon 'corruption'; code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16510 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AuthState/src/options.cpp')
-rw-r--r--plugins/AuthState/src/options.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp
index 2374c8592e..de4b90fedc 100644
--- a/plugins/AuthState/src/options.cpp
+++ b/plugins/AuthState/src/options.cpp
@@ -27,10 +27,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TranslateDialogDefault(hwndDlg);
bInitializing = 1;
- CheckDlgButton(hwndDlg, IDC_AUTHICON, bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_GRANTICON, bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, bContactMenuItem ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTHICON, Options.bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_GRANTICON, Options.bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, Options.bContactMenuItem ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, Options.bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED);
bInitializing = 0;
return TRUE;
@@ -50,19 +50,15 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (((LPNMHDR)lParam)->idFrom == 0)
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON);
- bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON);
- bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM);
- bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT);
+ Options.bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON);
+ Options.bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON);
+ Options.bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM);
+ Options.bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
onExtraImageApplying((WPARAM)hContact, 0);
- //Store options values to DB
- db_set_b(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon);
- db_set_b(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon);
- db_set_b(NULL, MODULENAME, "MenuItem", bContactMenuItem);
- db_set_b(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts);
+ Options.Save();
return TRUE;
}
}