diff options
author | George Hazan <ghazan@miranda.im> | 2017-11-21 23:05:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-11-21 23:05:26 +0300 |
commit | 284b47a0f5bf7f17af98fd1b978132d5817c84c0 (patch) | |
tree | b5f0fdec551ad0ebd62b28928c80a72950a50b23 /plugins/ZeroNotification | |
parent | 81d4a61fb79687dc23fb0def97365577acc70117 (diff) |
minor code cleaning
Diffstat (limited to 'plugins/ZeroNotification')
-rw-r--r-- | plugins/ZeroNotification/src/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 646fff1d3c..11983be572 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -58,12 +58,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
{
TVINSERTSTRUCT tvis;
- int i;
-
tvis.hParent = nullptr;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
- for (i = 0; i < nValues; i++) {
+ for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -98,10 +96,8 @@ static void UpdateMenuItem() static int SoundSettingChanged(WPARAM, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if (strcmp(cws->szModule, "Skin") || strcmp(cws->szSetting, "UseSound"))
- return 0;
-
- UpdateMenuItem();
+ if (!strcmp(cws->szModule, "Skin") && !strcmp(cws->szSetting, "UseSound"))
+ UpdateMenuItem();
return 0;
}
@@ -151,9 +147,11 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoBlink", DEFAULT_NOBLINK));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoCLCBlink", DEFAULT_NOCLCBLINK));
return TRUE;
+
case WM_COMMAND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_NOSOUND:
@@ -165,7 +163,7 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti)) {
- if (hti.flags&TVHT_ONITEMSTATEICON) {
+ if (hti.flags & TVHT_ONITEMSTATEICON) {
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.hItem = hti.hItem;
|