summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/clistmenus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_nicer/src/clistmenus.cpp')
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp55
1 files changed, 25 insertions, 30 deletions
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index ef24d740b7..6181e3f600 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -36,23 +36,23 @@ extern IconItemT iconItem[];
void DestroyTrayMenu(HMENU hMenu)
{
- int i, cnt;
-
- cnt = GetMenuItemCount(hMenu);
- for (i=0; i<cnt; ++i)
- {
- HMENU hSubMenu = GetSubMenu(hMenu, i);
- if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
- RemoveMenu(hMenu, i--, MF_BYPOSITION);
- }
- DestroyMenu(hMenu);
+ int i, cnt;
+
+ cnt = GetMenuItemCount(hMenu);
+ for (i = 0; i < cnt; ++i)
+ {
+ HMENU hSubMenu = GetSubMenu(hMenu, i);
+ if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
+ RemoveMenu(hMenu, i--, MF_BYPOSITION);
+ }
+ DestroyMenu(hMenu);
}
-INT_PTR CloseAction(WPARAM wParam,LPARAM lParam)
+INT_PTR CloseAction(WPARAM wParam, LPARAM lParam)
{
int k;
cfg::shutDown = 1;
- k=CallService(MS_SYSTEM_OKTOEXIT,0,0);
+ k = CallService(MS_SYSTEM_OKTOEXIT, 0, 0);
if (k) {
DestroyWindow(pcli->hwndContactList);
PostQuitMessage(0);
@@ -64,11 +64,7 @@ INT_PTR CloseAction(WPARAM wParam,LPARAM lParam)
static HANDLE hWindowListIGN = 0;
-/*
- * dialog procedure for handling the contact ignore dialog (available from the contact
- * menu
- */
-
+// dialog procedure for handling the contact ignore dialog (available from the contact menu
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA);
@@ -120,9 +116,9 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
else {
TCHAR szTitle[512];
DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0);
- BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
+ BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
- int i = 0;
+ int i = 0;
mir_sntprintf(szTitle, 512, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
@@ -168,7 +164,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_IGN_PRIORITY:
SendMessage(pcli->hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
return 0;
@@ -177,7 +173,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
return 0;
case IDC_IGN_NONE:
SendMessage(hWnd, WM_USER + 100, hContact, 0);
- return 0;
+ return 0;
case IDC_IGN_ALWAYSONLINE:
if (IsDlgButtonChecked(hWnd, IDC_IGN_ALWAYSONLINE))
CheckDlgButton(hWnd, IDC_IGN_ALWAYSOFFLINE, FALSE);
@@ -221,7 +217,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
LRESULT iSel = SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_GETCURSEL, 0, 0);
DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
- int i = 0;
+ int i = 0;
FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL);
if (iSel != CB_ERR) {
@@ -282,7 +278,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
break;
}
break;
- case WM_USER + 100: // fill dialog (wParam = hContact, lParam = mask)
+ case WM_USER + 100: // fill dialog (wParam = hContact, lParam = mask)
{
CheckDlgButton(hWnd, IDC_IGN_MSGEVENTS, lParam & (1 << (IGNOREEVENT_MESSAGE - 1)) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_IGN_FILEEVENTS, lParam & (1 << (IGNOREEVENT_FILE - 1)) ? BST_CHECKED : BST_UNCHECKED);
@@ -292,7 +288,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
CheckDlgButton(hWnd, IDC_IGN_ONLINE, lParam & (1 << (IGNOREEVENT_USERONLINE - 1)) ? BST_CHECKED : BST_UNCHECKED);
return 0;
}
- case WM_USER + 110: // retrieve value
+ case WM_USER + 110: // retrieve value
{
DWORD *dwNewMask = (DWORD *)lParam, dwMask = 0;
@@ -307,7 +303,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
*dwNewMask = dwMask;
return 0;
}
- case WM_USER + 120: // set visibility status
+ case WM_USER + 120: // set visibility status
{
ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL)) {
@@ -320,7 +316,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
}
return 0;
}
- case WM_USER + 130: // update apparent mode
+ case WM_USER + 130: // update apparent mode
{
ClcContact *contact = NULL;
@@ -360,7 +356,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
*
* if dialog is already open, focus it.
*/
-
static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam)
{
HWND hWnd = 0;
@@ -369,10 +364,10 @@ static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam)
hWindowListIGN = WindowList_Create();
hWnd = WindowList_Find(hWindowListIGN, wParam);
- if ( wParam ) {
- if ( hWnd == 0 )
+ if (wParam) {
+ if (hWnd == 0)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_QUICKIGNORE), 0, IgnoreDialogProc, (LPARAM)wParam);
- else if ( IsWindow( hWnd ))
+ else if (IsWindow(hWnd))
SetFocus(hWnd);
}
return 0;