diff options
| author | George Hazan <ghazan@miranda.im> | 2018-12-13 19:55:02 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2018-12-13 20:46:01 +0300 |
| commit | 887544273011d56a796e9507199ea8d6484d31c6 (patch) | |
| tree | c203b7f58e69abad45de75ed5e3e75f99057a17d /plugins/NewStory/src/opt_passwords.cpp | |
| parent | cd99f666712ff1227e33d8891897c4f4409dd572 (diff) | |
NewStory: code cleaning
Diffstat (limited to 'plugins/NewStory/src/opt_passwords.cpp')
| -rw-r--r-- | plugins/NewStory/src/opt_passwords.cpp | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/plugins/NewStory/src/opt_passwords.cpp b/plugins/NewStory/src/opt_passwords.cpp index eb9be44eaa..3427def74d 100644 --- a/plugins/NewStory/src/opt_passwords.cpp +++ b/plugins/NewStory/src/opt_passwords.cpp @@ -25,10 +25,8 @@ static void ResetListOptions(HWND hwndList) INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) { HTREEITEM hitmGlobal, hitmMaster; - switch (msg) - { + switch (msg) { case WM_INITDIALOG: - { HIMAGELIST himg; himg = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3); icoidNoPassword = ImageList_AddIcon(himg, GetIcon(ICO_NOPASSWORD)); @@ -36,19 +34,19 @@ INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himg); SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 1, 0); + { + CLCINFOITEM cii = { 0 }; + cii.cbSize = sizeof(cii); + cii.flags = CLCIIF_GROUPFONT; - CLCINFOITEM cii = { 0 }; - cii.cbSize = sizeof(cii); - cii.flags = CLCIIF_GROUPFONT; - - cii.pszText = TranslateT("** Global **"); - hitmGlobal = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); - SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmGlobal, MAKELPARAM(0, icoidNoPassword)); - - cii.pszText = TranslateT("** Master **"); - hitmMaster = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); - SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmMaster, MAKELPARAM(0, icoidNoPassword)); + cii.pszText = TranslateT("** Global **"); + hitmGlobal = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); + SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmGlobal, MAKELPARAM(0, icoidNoPassword)); + cii.pszText = TranslateT("** Master **"); + hitmMaster = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); + SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmMaster, MAKELPARAM(0, icoidNoPassword)); + } SetAllContactIcons(GetDlgItem(hwnd, IDC_LIST)); ResetListOptions(GetDlgItem(hwnd, IDC_LIST)); @@ -59,40 +57,31 @@ INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BUTTONADDTOOLTIP, (WPARAM)Translate("Save Password"), 0); SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_SAVEPASS)); return TRUE; - } case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) - { + switch (((LPNMHDR)lParam)->idFrom) { case 0: - { - switch (((LPNMHDR)lParam)->code) - { + switch (((LPNMHDR)lParam)->code) { case PSN_RESET: - { return TRUE; - } case PSN_APPLY: - { return TRUE; } - } break; - } case IDC_LIST: - { - switch (((LPNMHDR)lParam)->code) - { + switch (((LPNMHDR)lParam)->code) { case CLN_NEWCONTACT: case CLN_LISTREBUILT: SetAllContactIcons(GetDlgItem(hwnd, IDC_LIST)); + break; //fall through // case CLN_CONTACTMOVED: // SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL); // break; -// case CLN_OPTIONSCHANGED: + + case CLN_OPTIONSCHANGED: ResetListOptions(GetDlgItem(hwnd, IDC_LIST)); break; /* @@ -155,7 +144,6 @@ INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) } return TRUE; } - } break; } return FALSE; |
