summaryrefslogtreecommitdiff
path: root/plugins/Mwclist
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-13 13:00:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-13 13:00:12 +0000
commitd89dd2fe88191ce9b8ff0f68b93b45d00cff64b4 (patch)
treeb8541b46c88ec3c2902fa99e047cee717cdcaf73 /plugins/Mwclist
parentde5eb083cd53451b14991b6c61474bad3b9a5249 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@392 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Mwclist')
-rw-r--r--plugins/Mwclist/BkgrCfg.cpp20
-rw-r--r--plugins/Mwclist/CLUIFrames/cluiframes.cpp62
-rw-r--r--plugins/Mwclist/clc.cpp4
-rw-r--r--plugins/Mwclist/clcidents.cpp28
-rw-r--r--plugins/Mwclist/clcitems.cpp101
-rw-r--r--plugins/Mwclist/clcopts.cpp243
-rw-r--r--plugins/Mwclist/clcutils.cpp26
-rw-r--r--plugins/Mwclist/clisttray.cpp27
-rw-r--r--plugins/Mwclist/cluiopts.cpp13
-rw-r--r--plugins/Mwclist/cluiservices.cpp7
-rw-r--r--plugins/Mwclist/commonheaders.h8
-rw-r--r--plugins/Mwclist/groupmenu.cpp28
12 files changed, 266 insertions, 301 deletions
diff --git a/plugins/Mwclist/BkgrCfg.cpp b/plugins/Mwclist/BkgrCfg.cpp
index c8c565bd0e..c24974ccc7 100644
--- a/plugins/Mwclist/BkgrCfg.cpp
+++ b/plugins/Mwclist/BkgrCfg.cpp
@@ -159,8 +159,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
}
case WM_COMMAND:
- if (LOWORD(wParam) == IDC_BROWSE)
- {
+ if (LOWORD(wParam) == IDC_BROWSE) {
char str[MAX_PATH];
OPENFILENAMEA ofn = {0};
char filter[512];
@@ -179,16 +178,15 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
- else
- if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
+ else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE)
+ break;
+
if (LOWORD(wParam) == IDC_BITMAP)
SendMessage(hwndDlg, M_BKGR_UPDATE, 0,0);
if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
- if (LOWORD(wParam) == IDC_BKGRLIST)
- {
- if (HIWORD(wParam) == CBN_SELCHANGE)
- {
+ if (LOWORD(wParam) == IDC_BKGRLIST) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
SendMessage(hwndDlg, M_BKGR_GETSTATE, dat->indx, 0);
SendMessage(hwndDlg, M_BKGR_SETSTATE, dat->indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0), 0);
}
@@ -196,8 +194,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
{
int indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0);
- if (indx != CB_ERR && indx < dat->count)
- {
+ if (indx != CB_ERR && indx < dat->count) {
indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
dat->item[indx].changed = TRUE;
@@ -266,8 +263,7 @@ static INT_PTR BkgrCfg_Register(WPARAM wParam,LPARAM lParam)
value = (char *)mir_alloc(len + 4); // add room for flags (DWORD)
memcpy(value, szSetting, len);
tok = strchr(value, '/');
- if (tok == NULL)
- {
+ if (tok == NULL) {
mir_free(value);
return 1;
}
diff --git a/plugins/Mwclist/CLUIFrames/cluiframes.cpp b/plugins/Mwclist/CLUIFrames/cluiframes.cpp
index a84992f80a..12d4f71ac4 100644
--- a/plugins/Mwclist/CLUIFrames/cluiframes.cpp
+++ b/plugins/Mwclist/CLUIFrames/cluiframes.cpp
@@ -826,40 +826,40 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
ModifyMItem((WPARAM)contMITitle,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].visible) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].visible) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIVisible,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].Locked) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].Locked) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMILock,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].TitleBar.ShowTitleBar) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMITBVisible,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].floating) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].floating) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIFloating,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if ((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ((Frames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIBorder,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].align&alTop) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignTop,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].align&alClient) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignClient,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].align&alBottom) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignBottom,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if ((!Frames[pos].visible)||(Frames[pos].Locked)||(pos == CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if (Frames[pos].collapsed) mi.flags |= CMIF_CHECKED;
+ if ((!Frames[pos].visible)||(Frames[pos].Locked)||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
ModifyMItem((WPARAM)contMIColl,(LPARAM)&mi);
}
ulockfrm();
@@ -879,40 +879,40 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITitle,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].visible) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].visible) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].Locked) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].Locked) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MILock,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].TitleBar.ShowTitleBar) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].floating) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].floating) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if ((Frames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ((Frames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alTop) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].align&alClient) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if (Frames[pos].align&alBottom) mi.flags|=CMIF_CHECKED;
+ if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if (Frames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if ((!Frames[pos].visible)||Frames[pos].Locked||(pos == CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ if (Frames[pos].collapsed) mi.flags |= CMIF_CHECKED;
+ if ((!Frames[pos].visible)||Frames[pos].Locked||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIColl,(LPARAM)&mi);
}
ulockfrm();
@@ -936,12 +936,12 @@ INT_PTR CLUIFramesGetFrameOptions(WPARAM wParam,LPARAM lParam)
switch(LOWORD(wParam)) {
case FO_FLAGS:
retval = 0;
- if (Frames[pos].visible) retval|=F_VISIBLE;
- if (!Frames[pos].collapsed) retval|=F_UNCOLLAPSED;
- if (Frames[pos].Locked) retval|=F_LOCKED;
- if (Frames[pos].TitleBar.ShowTitleBar) retval|=F_SHOWTB;
- if (Frames[pos].TitleBar.ShowTitleBarTip) retval|=F_SHOWTBTIP;
- if (!(GetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
+ if (Frames[pos].visible) retval |= F_VISIBLE;
+ if (!Frames[pos].collapsed) retval |= F_UNCOLLAPSED;
+ if (Frames[pos].Locked) retval |= F_LOCKED;
+ if (Frames[pos].TitleBar.ShowTitleBar) retval |= F_SHOWTB;
+ if (Frames[pos].TitleBar.ShowTitleBarTip) retval |= F_SHOWTBTIP;
+ if (!(GetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER;
break;
case FO_NAME:
@@ -1025,7 +1025,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam,LPARAM lParam)
SendMessage(Frames[pos].TitleBar.hwndTip,TTM_ACTIVATE,(WPARAM)Frames[pos].TitleBar.ShowTitleBarTip,0);
style = (int)GetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE);
- style|=WS_BORDER;
+ style |= WS_BORDER;
if (flag&F_NOBORDER) {style &= (~WS_BORDER);}
SetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE,(LONG)style);
ulockfrm();
@@ -1569,10 +1569,10 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
Frames[nFramescount].floating = FALSE;
//override tbbtip
- //clfrm->Flags|=F_SHOWTBTIP;
+ //clfrm->Flags != F_SHOWTBTIP;
//
if (DBGetContactSettingByte(0,CLUIFrameModule,"RemoveAllBorders",0) == 1)
- clfrm->Flags|=F_NOBORDER;
+ clfrm->Flags |= F_NOBORDER;
Frames[nFramescount].dwFlags = clfrm->Flags;
@@ -1633,7 +1633,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
CLUIFramesLoadFrameSettings(id2pos(retval));
style = GetWindowLongPtr(Frames[nFramescount-1].hWnd,GWL_STYLE);
style &= (~WS_BORDER);
- style|=((Frames[nFramescount-1].UseBorder)?WS_BORDER:0);
+ style |= ((Frames[nFramescount-1].UseBorder)?WS_BORDER:0);
SetWindowLongPtr(Frames[nFramescount-1].hWnd,GWL_STYLE,style);
if (Frames[nFramescount-1].order == 0){Frames[nFramescount-1].order = nFramescount;}
@@ -2815,7 +2815,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam,LPARAM lParam)
SetWindowText(frame->ContainerWnd,frame->TitleBar.tbname);
temp = GetWindowLongPtr(frame->ContainerWnd,GWL_EXSTYLE);
- temp|=WS_EX_TOOLWINDOW|WS_EX_TOPMOST ;
+ temp |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST ;
SetWindowLongPtr(frame->ContainerWnd,GWL_EXSTYLE,temp);
frame->floating = TRUE;
diff --git a/plugins/Mwclist/clc.cpp b/plugins/Mwclist/clc.cpp
index d43edd855d..4975eda998 100644
--- a/plugins/Mwclist/clc.cpp
+++ b/plugins/Mwclist/clc.cpp
@@ -177,7 +177,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
else {
//item in list already
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
- if (contact->iImage == (WORD)lParam) break;
+ if (contact->iImage == (WORD)lParam) break;
if (sortByStatus) dat->NeedResort = 1;
if (!shouldShow && !(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
@@ -191,7 +191,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
int oldflags;
contact->iImage = (WORD)lParam;
oldflags = contact->flags;
- if (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags|=CONTACTF_ONLINE;
+ if (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags |= CONTACTF_ONLINE;
else contact->flags &= ~CONTACTF_ONLINE;
if (oldflags != contact->flags)
dat->NeedResort = 1;
diff --git a/plugins/Mwclist/clcidents.cpp b/plugins/Mwclist/clcidents.cpp
index 0f9d4692ac..1cc940db2b 100644
--- a/plugins/Mwclist/clcidents.cpp
+++ b/plugins/Mwclist/clcidents.cpp
@@ -49,15 +49,18 @@ int GetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactI
for (;;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
- if (group == NULL) break;
+ if (group == NULL)
+ break;
group->scanIndex++;
continue;
}
- if (group == subgroup && contactIndex == group->scanIndex) return count;
+
+ if (group == subgroup && contactIndex == group->scanIndex)
+ return count;
+
count++;
- if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex]->flags & CONTACTF_STATUSMSG)) {
+ if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex]->flags & CONTACTF_STATUSMSG))
count++;
- }
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
if (group->cl.items[group->scanIndex]->group == subgroup && contactIndex == -1)
@@ -79,22 +82,21 @@ int GetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactI
pdisplayNameCacheEntry GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact)
{
- int idx;
- displayNameCacheEntry dnce, *pdnce,*pdnce2;
+ if (hContact == 0)
+ return NULL;
- if (hContact == 0) return NULL;
+ displayNameCacheEntry dnce;
dnce.hContact = hContact;
-
- pdnce = (displayNameCacheEntry*)li.List_Find(&dat->lCLCContactsCache,&dnce);
-
- if (pdnce == NULL)
- {
+ displayNameCacheEntry *pdnce = (displayNameCacheEntry*)li.List_Find(&dat->lCLCContactsCache,&dnce);
+ if (pdnce == NULL) {
pdnce = (displayNameCacheEntry*)mir_calloc(sizeof(displayNameCacheEntry));
pdnce->hContact = hContact;
+
+ int idx;
li.List_GetIndex(&dat->lCLCContactsCache,pdnce,&idx);
li.List_Insert(&dat->lCLCContactsCache,pdnce,idx);
- pdnce2 = (displayNameCacheEntry*)li.List_Find(&dat->lCLCContactsCache,&dnce);//for check
+ displayNameCacheEntry *pdnce2 = (displayNameCacheEntry*)li.List_Find(&dat->lCLCContactsCache,&dnce);//for check
if (pdnce2->hContact != pdnce->hContact)
return NULL;
diff --git a/plugins/Mwclist/clcitems.cpp b/plugins/Mwclist/clcitems.cpp
index 3e504a2611..ae69b6ee42 100644
--- a/plugins/Mwclist/clcitems.cpp
+++ b/plugins/Mwclist/clcitems.cpp
@@ -155,14 +155,14 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,struct ClcGroup
szProto = cacheEntry->szProto;
if (szProto != NULL&&!pcli->pfnIsHiddenMode(dat,cacheEntry->status))
- group->cl.items[i]->flags|=CONTACTF_ONLINE;
+ group->cl.items[i]->flags |= CONTACTF_ONLINE;
apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
- if (apparentMode == ID_STATUS_OFFLINE) group->cl.items[i]->flags|=CONTACTF_INVISTO;
- else if (apparentMode == ID_STATUS_ONLINE) group->cl.items[i]->flags|=CONTACTF_VISTO;
- else if (apparentMode) group->cl.items[i]->flags|=CONTACTF_VISTO|CONTACTF_INVISTO;
- if (cacheEntry->NotOnList) group->cl.items[i]->flags|=CONTACTF_NOTONLIST;
+ if (apparentMode == ID_STATUS_OFFLINE) group->cl.items[i]->flags |= CONTACTF_INVISTO;
+ else if (apparentMode == ID_STATUS_ONLINE) group->cl.items[i]->flags |= CONTACTF_VISTO;
+ else if (apparentMode) group->cl.items[i]->flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
+ if (cacheEntry->NotOnList) group->cl.items[i]->flags |= CONTACTF_NOTONLIST;
idleMode = szProto != NULL?cacheEntry->IdleTS:0;
- if (idleMode) group->cl.items[i]->flags|=CONTACTF_IDLE;
+ if (idleMode) group->cl.items[i]->flags |= CONTACTF_IDLE;
lstrcpyn(group->cl.items[i]->szText,cacheEntry->name, SIZEOF(group->cl.items[i]->szText));
group->cl.items[i]->proto = szProto;
@@ -189,59 +189,56 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,struct ClcGroup
void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
{
- struct ClcGroup *group;
- struct ClcContact * cont;
- pdisplayNameCacheEntry cacheEntry;
- DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
- WORD status;
- char *szProto;
-
- if (FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1){return;}
- cacheEntry = GetContactFullCacheEntry(hContact);
- if (cacheEntry == NULL) return;
- szProto = cacheEntry->szProto;
+ if (FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
+ return;
+ pdisplayNameCacheEntry cacheEntry = GetContactFullCacheEntry(hContact);
+ if (cacheEntry == NULL)
+ return;
- //char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ char *szProto = cacheEntry->szProto;
dat->NeedResort = 1;
ClearRowByIndexCache();
ClearClcContactCache(dat,hContact);
- if (style&CLS_NOHIDEOFFLINE) checkHideOffline = 0;
+ WORD status;
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
+ if (style & CLS_NOHIDEOFFLINE) checkHideOffline = 0;
if (checkHideOffline) {
if (szProto == NULL) status = ID_STATUS_OFFLINE;
else status = cacheEntry->status;
}
+ ClcGroup *group;
if (lstrlen(cacheEntry->szGroup) == 0)
group = &dat->list;
else {
group = AddGroup(hwnd,dat,cacheEntry->szGroup,(DWORD)-1,0,0);
if (group == NULL) {
- int i,len;
DWORD groupFlags;
- TCHAR *szGroupName;
+ int i;
if ( !(style & CLS_HIDEEMPTYGROUPS))
return;
if (checkHideOffline && pcli->pfnIsHiddenMode(dat,status)) {
for (i = 1;;i++) {
- szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
+ TCHAR *szGroupName = pcli->pfnGetGroupName(i, &groupFlags);
if (szGroupName == NULL)
return; //never happens
- if (!lstrcmp(szGroupName,cacheEntry->szGroup)) break;
+ if ( !lstrcmp(szGroupName,cacheEntry->szGroup))
+ break;
}
if (groupFlags & GROUPF_HIDEOFFLINE)
return;
}
for (i = 1;; i++) {
- szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
+ TCHAR *szGroupName = pcli->pfnGetGroupName(i, &groupFlags);
if (szGroupName == NULL)
return; //never happens
if (!lstrcmp(szGroupName,cacheEntry->szGroup))
break;
- len = lstrlen(szGroupName);
+ size_t len = lstrlen(szGroupName);
if (!_tcsncmp(szGroupName,cacheEntry->szGroup,len) && cacheEntry->szGroup[len] == '\\')
AddGroup(hwnd,dat,szGroupName,groupFlags,i,1);
}
@@ -255,7 +252,7 @@ void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTo
return;
}
}
- cont = AddContactToGroup(dat,group,cacheEntry);
+ ClcContact *cont = AddContactToGroup(dat,group,cacheEntry);
if (cont && cont->proto) {
cont->SubAllocated = 0;
if (strcmp(cont->proto,"MetaContacts") == 0)
@@ -303,12 +300,15 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
group = &dat->list;
nameOffset = 0;
for (i = 0;;i++) {
- if (group->scanIndex == group->cl.count) break;
+ if (group->scanIndex == group->cl.count)
+ break;
+
if (group->cl.items[i]->type == CLCIT_GROUP) {
int len = lstrlen(group->cl.items[i]->szText);
if (!_tcsncmp(group->cl.items[i]->szText,dbv.ptszVal+nameOffset,len) && (dbv.ptszVal[nameOffset+len] == '\\' || dbv.pszVal[nameOffset+len] == '\0')) {
group->totalMembers--;
- if (dbv.pszVal[nameOffset+len] == '\0') break;
+ if (dbv.pszVal[nameOffset+len] == '\0')
+ break;
}
}
}
@@ -347,7 +347,9 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
for (i = 1;;i++) {
szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
- if (szGroupName == NULL) break;
+ if (szGroupName == NULL)
+ break;
+
AddGroup(hwnd,dat,szGroupName,groupFlags,i,0);
}
}
@@ -361,10 +363,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
//cacheEntry->ClcContact = NULL;
ClearClcContactCache(dat,hContact);
if (cacheEntry == NULL)
- {
MessageBoxA(0,"Fail To Get CacheEntry for hContact","!!!!!!!!",0);
- }
-
if (style&CLS_SHOWHIDDEN || !cacheEntry->Hidden) {
if (lstrlen(cacheEntry->szGroup) == 0)
@@ -389,9 +388,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
else cont = AddContactToGroup(dat,group,cacheEntry);
}
}
- if (cont)
- if (cont->proto)
- {
+ if (cont && cont->proto) {
cont->SubAllocated = 0;
if (strcmp(cont->proto,"MetaContacts") == 0)
AddSubcontacts(cont);
@@ -405,7 +402,8 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
for (;;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
- if (group == NULL) break;
+ if (group == NULL)
+ break;
}
else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
if (group->cl.items[group->scanIndex]->group->cl.count == 0) {
@@ -445,7 +443,9 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction)
for (;;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
- if (group == NULL) break;
+ if (group == NULL)
+ break;
+
group->scanIndex++;
continue;
}
@@ -461,7 +461,6 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction)
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
- // count += group->cl.count;
continue;
}
group->scanIndex++;
@@ -481,21 +480,15 @@ int GetGroupContentsCount(struct ClcGroup *group,int visibleOnly)
group = group->parent;
group->scanIndex++;
continue;
-
}
-// else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && (group->cl.items[group->scanIndex]->SubAllocated>0) && visibleOnly && group->cl.items[group->scanIndex]->SubExpanded)
-// {
-// count += group->cl.items[group->scanIndex]->SubAllocated;
+
count++;
- if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex]->flags & CONTACTF_STATUSMSG)) {
+ if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex]->flags & CONTACTF_STATUSMSG))
count++;
- }
-// else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (!visibleOnly || group->cl.items[group->scanIndex]->group->expanded)) {
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (!visibleOnly || group->cl.items[group->scanIndex]->group->expanded)) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
-// count += group->cl.count;
continue;
}
group->scanIndex++;
@@ -572,7 +565,8 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for (;;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
- if (group == NULL) break;
+ if (group == NULL)
+ break;
}
else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
group = group->cl.items[group->scanIndex]->group;
@@ -613,8 +607,10 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
savedInfoAlloced += allocstep;
savedInfo = (struct SavedInfoState_t*)mir_realloc(savedInfo,sizeof(struct SavedInfoState_t)*savedInfoAlloced);
}
- if (group->parent == NULL) savedInfo[savedInfoCount-1].parentId = -1;
- else savedInfo[savedInfoCount-1].parentId = group->groupId;
+ if (group->parent == NULL)
+ savedInfo[savedInfoCount-1].parentId = -1;
+ else
+ savedInfo[savedInfoCount-1].parentId = group->groupId;
savedInfo[savedInfoCount-1].contact = *group->cl.items[group->scanIndex];
}
group->scanIndex++;
@@ -628,7 +624,8 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for (;;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
- if (group == NULL) break;
+ if (group == NULL)
+ break;
}
else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
group = group->cl.items[group->scanIndex]->group;
@@ -644,7 +641,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for (i = 0;i<savedContactCount;i++)
if (savedContact[i].hContact == group->cl.items[group->scanIndex]->hContact) {
CopyMemory(group->cl.items[group->scanIndex]->iExtraImage,savedContact[i].iExtraImage,MAXEXTRACOLUMNS);
- if (savedContact[i].checked) group->cl.items[group->scanIndex]->flags|=CONTACTF_CHECKED;
+ if (savedContact[i].checked) group->cl.items[group->scanIndex]->flags |= CONTACTF_CHECKED;
break;
}
if (group->cl.items[group->scanIndex]->SubAllocated>0)
@@ -654,7 +651,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for (i = 0;i<savedContactCount;i++)
if (savedContact[i].hContact == group->cl.items[group->scanIndex]->subcontacts[l].hContact) {
CopyMemory(group->cl.items[group->scanIndex]->subcontacts[l].iExtraImage,savedContact[i].iExtraImage,MAXEXTRACOLUMNS);
- if (savedContact[i].checked) group->cl.items[group->scanIndex]->subcontacts[l].flags|=CONTACTF_CHECKED;
+ if (savedContact[i].checked) group->cl.items[group->scanIndex]->subcontacts[l].flags |= CONTACTF_CHECKED;
break;
}
}
diff --git a/plugins/Mwclist/clcopts.cpp b/plugins/Mwclist/clcopts.cpp
index 201f2543f9..32de8b13f6 100644
--- a/plugins/Mwclist/clcopts.cpp
+++ b/plugins/Mwclist/clcopts.cpp
@@ -163,7 +163,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
tvi.hItem = TreeView_GetRoot(hwndTree);
while(tvi.hItem) {
TreeView_GetItem(hwndTree,&tvi);
- if (((tvi.state&TVIS_STATEIMAGEMASK)>>12 == 2)) flags|=tvi.lParam;
+ if (((tvi.state&TVIS_STATEIMAGEMASK)>>12 == 2)) flags |= tvi.lParam;
tvi.hItem = TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
return flags;
@@ -208,121 +208,108 @@ static INT_PTR CALLBACK DlgProcClcMetaOpts(HWND hwndDlg, UINT msg, WPARAM wParam
break;
}
return FALSE;
-
-
-
-
}
static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- { int i;
- DWORD exStyle = DBGetContactSettingDword(NULL,"CLC","ExStyle",pcli->pfnGetDefaultExStyle());
- for (i = 0;i < SIZEOF(checkBoxToStyleEx); i++)
- CheckDlgButton(hwndDlg,checkBoxToStyleEx[i].id,(exStyle&checkBoxToStyleEx[i].flag)^(checkBoxToStyleEx[i].flag*checkBoxToStyleEx[i].not)?BST_CHECKED:BST_UNCHECKED);
- }
- { UDACCEL accel[2] = {{0,10},{2,50}};
- SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETRANGE,0,MAKELONG(999,0));
- SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel), (LPARAM)&accel );
- SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
- }
- CheckDlgButton(hwndDlg,IDC_IDLE,DBGetContactSettingByte(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE)?BST_CHECKED:BST_UNCHECKED);
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
+ SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
+ {
+ DWORD exStyle = DBGetContactSettingDword(NULL,"CLC","ExStyle",pcli->pfnGetDefaultExStyle());
+ for (int i = 0;i < SIZEOF(checkBoxToStyleEx); i++)
+ CheckDlgButton(hwndDlg,checkBoxToStyleEx[i].id,(exStyle&checkBoxToStyleEx[i].flag)^(checkBoxToStyleEx[i].flag*checkBoxToStyleEx[i].not)?BST_CHECKED:BST_UNCHECKED);
+
+ UDACCEL accel[2] = {{0,10},{2,50}};
+ SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETRANGE,0,MAKELONG(999,0));
+ SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel), (LPARAM)&accel );
+ SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
+ }
+ CheckDlgButton(hwndDlg,IDC_IDLE,DBGetContactSettingByte(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE)?BST_CHECKED:BST_UNCHECKED);
- /* CheckDlgButton(hwndDlg, IDC_META, DBGetContactSettingByte(NULL,"CLC","Meta",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METADBLCLK, DBGetContactSettingByte(NULL,"CLC","MetaDoubleClick",0) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- CheckDlgButton(hwndDlg, IDC_METASUBEXTRA, DBGetContactSettingByte(NULL,"CLC","MetaHideExtra",1) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
- */
- SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETRANGE,0,MAKELONG(64,0));
- SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN),0));
- SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETRANGE,0,MAKELONG(50,0));
- SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT),0));
- CheckDlgButton(hwndDlg,IDC_GREYOUT,DBGetContactSettingDword(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS)?BST_CHECKED:BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETRANGE,0,MAKELONG(64,0));
+ SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN),0));
+ SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETRANGE,0,MAKELONG(50,0));
+ SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT),0));
+ CheckDlgButton(hwndDlg,IDC_GREYOUT,DBGetContactSettingDword(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS)?BST_CHECKED:BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
- EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),greyoutValues,SIZEOF(greyoutValues),DBGetContactSettingDword(NULL,"CLC","FullGreyoutFlags",CLCDEFAULT_FULLGREYOUTFLAGS));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),DBGetContactSettingDword(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
- CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,DBGetContactSettingByte(NULL,"CLC","NoVScrollBar",0)?BST_CHECKED:BST_UNCHECKED);
- return TRUE;
- case WM_VSCROLL:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
- EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
- if (LOWORD(wParam) == IDC_GREYOUT)
- EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
- case IDC_GREYOUTOPTS:
- case IDC_HIDEOFFLINEOPTS:
- if (((LPNMHDR)lParam)->code == NM_CLICK) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if (hti.flags&TVHT_ONITEMSTATEICON) {
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem = hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1?2:1;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- { int i;
- DWORD exStyle = 0;
- for (i = 0;i < SIZEOF(checkBoxToStyleEx);i++)
- if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
- exStyle|=checkBoxToStyleEx[i].flag;
- DBWriteContactSettingDword(NULL,"CLC","ExStyle",exStyle);
- }
- { DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
- DBWriteContactSettingDword(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
- if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
- DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
- else
- DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",0);
- }
- /* DBWriteContactSettingByte(NULL,"CLC","Meta",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_META)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaHideExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA)); // by FYR
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),greyoutValues,SIZEOF(greyoutValues),DBGetContactSettingDword(NULL,"CLC","FullGreyoutFlags",CLCDEFAULT_FULLGREYOUTFLAGS));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),DBGetContactSettingDword(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
+ CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,DBGetContactSettingByte(NULL,"CLC","NoVScrollBar",0)?BST_CHECKED:BST_UNCHECKED);
+ return TRUE;
- */
- DBWriteContactSettingByte(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
- DBWriteContactSettingDword(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
- DBWriteContactSettingByte(NULL,"CLC","LeftMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingWord(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CLC","GroupIndent",(BYTE)SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CLC","NoVScrollBar",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_NOSCROLLBAR)?1:0));
+ case WM_VSCROLL:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
+ if (LOWORD(wParam) == IDC_GREYOUT)
+ EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
+ if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- pcli->pfnClcOptionsChanged();
- return TRUE;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case IDC_GREYOUTOPTS:
+ case IDC_HIDEOFFLINEOPTS:
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_ONITEMSTATEICON) {
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.iImage = tvi.iSelectedImage = (tvi.iImage == 1) ? 2 : 1;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- break;
}
break;
- case WM_DESTROY:
- ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),TVSIL_NORMAL));
- break;
+ case 0:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ int i;
+ DWORD exStyle = 0;
+ for (i = 0;i < SIZEOF(checkBoxToStyleEx);i++)
+ if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
+ exStyle |= checkBoxToStyleEx[i].flag;
+ DBWriteContactSettingDword(NULL,"CLC","ExStyle",exStyle);
+
+ DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
+ DBWriteContactSettingDword(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
+ if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
+ DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
+ else
+ DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",0);
+
+ DBWriteContactSettingByte(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
+ DBWriteContactSettingDword(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
+ DBWriteContactSettingByte(NULL,"CLC","LeftMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
+ DBWriteContactSettingWord(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,0));
+ DBWriteContactSettingByte(NULL,"CLC","GroupIndent",(BYTE)SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_GETPOS,0,0));
+ DBWriteContactSettingByte(NULL,"CLC","NoVScrollBar",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_NOSCROLLBAR)?1:0));
+
+ pcli->pfnClcOptionsChanged();
+ return TRUE;
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),TVSIL_NORMAL));
+ break;
}
return FALSE;
}
@@ -338,7 +325,8 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
- { DBVARIANT dbv;
+ {
+ DBVARIANT dbv;
if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
@@ -350,9 +338,8 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
else
mir_free(dbv.pszVal);
}
- }
- { WORD bmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ WORD bmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
CheckDlgButton(hwndDlg,IDC_STRETCHH,bmpUse&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_STRETCHV,bmpUse&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_TILEH,bmpUse&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
@@ -361,10 +348,10 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,bmpUse&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_TILEVROWH,bmpUse&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
- }
- { HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
+ HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
- if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ if (MySHAutoComplete)
+ MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
}
return TRUE;
@@ -405,21 +392,22 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
DBWriteContactSettingByte(NULL,"StatusBar","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
- { COLORREF col;
+ {
+ COLORREF col;
col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
if (col == CLCDEFAULT_BKCOLOUR) DBDeleteContactSetting(NULL,"StatusBar","BkColour");
else DBWriteContactSettingDword(NULL,"StatusBar","BkColour",col);
col = SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_GETCOLOUR,0,0);
if (col == CLCDEFAULT_SELBKCOLOUR) DBDeleteContactSetting(NULL,"StatusBar","SelBkColour");
else DBWriteContactSettingDword(NULL,"StatusBar","SelBkColour",col);
- }
- {
+
char str[MAX_PATH],strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
@@ -429,15 +417,14 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w
}
else DBWriteContactSettingString(NULL,"StatusBar","BkBitmap",str);
- }
- { WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags|=CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags|=CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags|=CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags|=CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags|=CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags|=CLBF_PROPORTIONAL;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags|=CLBF_TILEVTOROWHEIGHT;
+ WORD flags = 0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
DBWriteContactSettingWord(NULL,"StatusBar","BkBmpUse",flags);
}
@@ -553,13 +540,13 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
else DBWriteContactSettingString(NULL,"CLC","BkBitmap",str);
}
{ WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags|=CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags|=CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags|=CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags|=CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags|=CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags|=CLBF_PROPORTIONAL;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags|=CLBF_TILEVTOROWHEIGHT;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
DBWriteContactSettingWord(NULL,"CLC","BkBmpUse",flags);
}
diff --git a/plugins/Mwclist/clcutils.cpp b/plugins/Mwclist/clcutils.cpp
index 39ed63e403..e9253b4082 100644
--- a/plugins/Mwclist/clcutils.cpp
+++ b/plugins/Mwclist/clcutils.cpp
@@ -42,20 +42,20 @@ int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact
GetClientRect(hwnd,&clRect);
if (testx<0 || testy<0 || testy>=clRect.bottom || testx>=clRect.right) {
if (flags) {
- if (testx<0) *flags|=CLCHT_TOLEFT;
- else if (testx>=clRect.right) *flags|=CLCHT_TORIGHT;
- if (testy<0) *flags|=CLCHT_ABOVE;
- else if (testy>=clRect.bottom) *flags|=CLCHT_BELOW;
+ if (testx<0) *flags |= CLCHT_TOLEFT;
+ else if (testx>=clRect.right) *flags |= CLCHT_TORIGHT;
+ if (testy<0) *flags |= CLCHT_ABOVE;
+ else if (testy>=clRect.bottom) *flags |= CLCHT_BELOW;
}
return -1;
}
if (testx<dat->leftMargin) {
- if (flags) *flags|=CLCHT_INLEFTMARGIN|CLCHT_NOWHERE;
+ if (flags) *flags |= CLCHT_INLEFTMARGIN|CLCHT_NOWHERE;
return -1;
}
hit = GetRowByIndex(dat ,(testy+dat->yScroll)/dat->rowHeight,&hitcontact,&hitgroup);
if (hit == -1) {
- if (flags) *flags|=CLCHT_NOWHERE|CLCHT_BELOWITEMS;
+ if (flags) *flags |= CLCHT_NOWHERE|CLCHT_BELOWITEMS;
return -1;
}
if (contact) *contact = hitcontact;
@@ -68,7 +68,7 @@ int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact
for (indent = 0;hitgroup->parent;indent++,hitgroup = hitgroup->parent);
if (testx<dat->leftMargin+indent*dat->groupIndent+subident) {
- if (flags) *flags|=CLCHT_ONITEMINDENT;
+ if (flags) *flags |= CLCHT_ONITEMINDENT;
return hit;
}
checkboxWidth = 0;
@@ -76,11 +76,11 @@ int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact
if (style&CLS_GROUPCHECKBOXES && hitcontact->type == CLCIT_GROUP) checkboxWidth = dat->checkboxSize+2;
if (hitcontact->type == CLCIT_INFO && hitcontact->flags&CLCIIF_CHECKBOX) checkboxWidth = dat->checkboxSize+2;
if (testx<dat->leftMargin+indent*dat->groupIndent+checkboxWidth+subident) {
- if (flags) *flags|=CLCHT_ONITEMCHECK;
+ if (flags) *flags |= CLCHT_ONITEMCHECK;
return hit;
}
if (testx<dat->leftMargin+indent*dat->groupIndent+checkboxWidth+dat->iconXSpace+subident) {
- if (flags) *flags|=CLCHT_ONITEMICON;
+ if (flags) *flags |= CLCHT_ONITEMICON;
return hit;
}
@@ -119,7 +119,7 @@ int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact
if (testx>=x &&
testx<x+cxSmIcon) {
- if (flags) *flags|=CLCHT_ONITEMEXTRA|(i<<24);
+ if (flags) *flags |= CLCHT_ONITEMEXTRA|(i<<24);
ReleaseDC(hwnd,hdc);
return hit;
@@ -145,10 +145,10 @@ int HitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact
SelectObject(hdc,oldfont);
ReleaseDC(hwnd,hdc);
if (testx<dat->leftMargin+indent*dat->groupIndent+checkboxWidth+dat->iconXSpace+width+4+subident) {
- if (flags) *flags|=CLCHT_ONITEMLABEL;
+ if (flags) *flags |= CLCHT_ONITEMLABEL;
return hit;
}
- if (flags) *flags|=CLCHT_NOWHERE;
+ if (flags) *flags |= CLCHT_NOWHERE;
return -1;
}
@@ -241,7 +241,7 @@ void RecalcScrollBar(HWND hwnd,struct ClcData *dat)
void CalcEipPosition( struct ClcData *dat, struct ClcContact *contact, struct ClcGroup *group, POINT *result)
{
int indent;
- for (indent = 0; group->parent; indent++, group == group->parent);
+ for (indent = 0; group->parent; indent++, group = group->parent);
result->x = indent * dat->groupIndent + dat->iconXSpace - 2;
result->y = dat->selection * dat->rowHeight - dat->yScroll;
diff --git a/plugins/Mwclist/clisttray.cpp b/plugins/Mwclist/clisttray.cpp
index 9112d74a1f..04e71c6a0c 100644
--- a/plugins/Mwclist/clisttray.cpp
+++ b/plugins/Mwclist/clisttray.cpp
@@ -155,26 +155,21 @@ INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam)
MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
if (mii == NULL) return 0;
- if (hHideShowMainMenuItem == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
-
+ if (hHideShowMainMenuItem == (HANDLE)lParam) {
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hTrayMainMenuItemProxy == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+
+ if (hTrayMainMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
- if (hTrayStatusMenuItemProxy == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ if (hTrayStatusMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
-
+
return(TRUE);
}
diff --git a/plugins/Mwclist/cluiopts.cpp b/plugins/Mwclist/cluiopts.cpp
index fe7762fe0b..33fc3abaf4 100644
--- a/plugins/Mwclist/cluiopts.cpp
+++ b/plugins/Mwclist/cluiopts.cpp
@@ -416,16 +416,13 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
frameopt = frameopt & (~F_VISIBLE);
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR))
- {
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
ShowWindow(pcli->hwndStatus,SW_SHOW);
- frameopt|=F_VISIBLE;
- }
- else
- {
- ShowWindow(pcli->hwndStatus,SW_HIDE);
+ frameopt |= F_VISIBLE;
}
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
+ else ShowWindow(pcli->hwndStatus,SW_HIDE);
+
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
diff --git a/plugins/Mwclist/cluiservices.cpp b/plugins/Mwclist/cluiservices.cpp
index f31fa1c0eb..f75fbc9dac 100644
--- a/plugins/Mwclist/cluiservices.cpp
+++ b/plugins/Mwclist/cluiservices.cpp
@@ -156,17 +156,14 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto)
if ( !DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1))
flags |= SBT_NOBORDERS;
- for (partCount = 0, i = 0; i<protoCount; i++) //count down since built in ones tend to go at the end
- {
- ProtocolData *PD;
-
+ for (partCount = 0, i = 0; i<protoCount; i++) { //count down since built in ones tend to go at the end
int ind = pcli->pfnGetAccountIndexByPos(i);
if (ind < 0) continue;
if (!pcli->pfnGetProtocolVisibility(accs[ind]->szModuleName))
continue;
- PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
+ ProtocolData *PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
PD->RealName = mir_strdup(accs[ind]->szModuleName);
PD->protopos = accs[ind]->iOrder;
diff --git a/plugins/Mwclist/commonheaders.h b/plugins/Mwclist/commonheaders.h
index 7115bf4978..e8333401b2 100644
--- a/plugins/Mwclist/commonheaders.h
+++ b/plugins/Mwclist/commonheaders.h
@@ -105,18 +105,18 @@ extern int ( *saveIconFromStatusMode )( const char *szProto,int nStatus, HAN
// Register of plugin's user
//
-// wParam == (WPARAM)szSetting - string that describes a user
+// wParam = (WPARAM)szSetting - string that describes a user
// format: Category/ModuleName,
// eg: "Contact list background/CLUI",
// "Status bar background/StatusBar"
-// lParam == (LPARAM)dwFlags
+// lParam = (LPARAM)dwFlags
//
#define MS_BACKGROUNDCONFIG_REGISTER "BkgrCfg/Register"
//
// Notification about changed background
-// wParam == ModuleName
-// lParam == 0
+// wParam = ModuleName
+// lParam = 0
#define ME_BACKGROUNDCONFIG_CHANGED "BkgrCfg/Changed"
diff --git a/plugins/Mwclist/groupmenu.cpp b/plugins/Mwclist/groupmenu.cpp
index 7e126708c5..815b55274a 100644
--- a/plugins/Mwclist/groupmenu.cpp
+++ b/plugins/Mwclist/groupmenu.cpp
@@ -145,30 +145,24 @@ INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
if (mii == NULL) return 0;
- if (hHideShowMainMenuItem == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
-
+ if (hHideShowMainMenuItem == (HANDLE)lParam) {
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hGroupMainMenuItemProxy == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+
+ if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
- if (hGroupStatusMenuItemProxy == (HANDLE)lParam)
- {
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
+ mii->fMask |= MIIM_SUBMENU;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
- return(TRUE);
+ return TRUE;
}
-
//called with:
//wparam - ownerdata
//lparam - lparam from winproc