summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-07-25 18:35:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-07-25 18:35:16 +0000
commitf8025eba881e80e6dc301c4005ef0d2077bf086a (patch)
tree44b7e885f95c3eddbd3378f0744aec21ebd64461 /src
parent60eb7158c64c215db62ba3df6f248778792cbe5a (diff)
- obsolete menu processing code removed;
- common menu commands processing code moved to the core; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14698 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clc.cpp47
-rw-r--r--src/mir_app/src/clc.h1
-rw-r--r--src/mir_app/src/clistcore.cpp1
-rw-r--r--src/mir_app/src/menu_clist.cpp8
-rw-r--r--src/mir_app/src/srmm_statusicon.cpp24
5 files changed, 37 insertions, 44 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index d6baa3ff91..3410754d1c 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -59,12 +59,6 @@ void fnClcOptionsChanged(void)
cli.pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0);
}
-// stub. does nothing
-HMENU fnBuildGroupPopupMenu(ClcGroup *group)
-{
- return Menu_BuildSubGroupMenu(group);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// standard CLC services
@@ -1246,7 +1240,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (dat->selection != -1 && hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMCHECK | CLCHT_ONITEMLABEL)) {
HMENU hMenu;
if (contact->type == CLCIT_GROUP)
- hMenu = cli.pfnBuildGroupPopupMenu(contact->group);
+ hMenu = Menu_BuildSubGroupMenu(contact->group);
else if (contact->type == CLCIT_CONTACT)
hMenu = Menu_BuildContactMenu(contact->hContact);
else
@@ -1272,28 +1266,31 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (hit == -1)
break;
if (contact->type == CLCIT_CONTACT)
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)contact->hContact))
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), contact->hContact))
break;
- switch (LOWORD(wParam)) {
- case POPUP_NEWSUBGROUP:
- if (contact->type != CLCIT_GROUP)
+
+ if (contact->type == CLCIT_GROUP) {
+ switch (LOWORD(wParam)) {
+ case POPUP_NEWSUBGROUP:
+ if (contact->type != CLCIT_GROUP)
+ break;
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
+ CallService(MS_CLIST_GROUPCREATE, contact->groupId, 0);
break;
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
- CallService(MS_CLIST_GROUPCREATE, contact->groupId, 0);
- break;
- case POPUP_RENAMEGROUP:
- cli.pfnBeginRenameSelection(hwnd, dat);
- break;
- case POPUP_DELETEGROUP:
- if (contact->type != CLCIT_GROUP)
+ case POPUP_RENAMEGROUP:
+ cli.pfnBeginRenameSelection(hwnd, dat);
break;
- CallService(MS_CLIST_GROUPDELETE, contact->groupId, 0);
- break;
- case POPUP_GROUPHIDEOFFLINE:
- if (contact->type != CLCIT_GROUP)
+ case POPUP_DELETEGROUP:
+ if (contact->type == CLCIT_GROUP)
+ CallService(MS_CLIST_GROUPDELETE, contact->groupId, 0);
break;
- CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId, MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
- break;
+ case POPUP_GROUPHIDEOFFLINE:
+ if (contact->type == CLCIT_GROUP)
+ CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId, MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
+ break;
+ }
+
+ Menu_ProcessCommandById(wParam, (LPARAM)hwnd);
}
break;
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index 5df01c3eff..dfb5a93dba 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -39,7 +39,6 @@ extern int g_IconWidth, g_IconHeight;
void fnClcOptionsChanged(void);
void fnClcBroadcast(int msg, WPARAM wParam, LPARAM lParam);
-HMENU fnBuildGroupPopupMenu(ClcGroup* group);
void fnInitAutoRebuild(HWND hWnd);
LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp
index 9c53d8f1ec..7df2f0d0ed 100644
--- a/src/mir_app/src/clistcore.cpp
+++ b/src/mir_app/src/clistcore.cpp
@@ -74,7 +74,6 @@ static INT_PTR srvRetrieveInterface(WPARAM, LPARAM)
cli.pfnClcOptionsChanged = fnClcOptionsChanged;
cli.pfnClcBroadcast = fnClcBroadcast;
cli.pfnContactListControlWndProc = fnContactListControlWndProc;
- cli.pfnBuildGroupPopupMenu = fnBuildGroupPopupMenu;
cli.pfnRegisterFileDropping = fnRegisterFileDropping;
cli.pfnUnregisterFileDropping = fnUnregisterFileDropping;
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp
index 273cf5e7b4..5bfeeee21b 100644
--- a/src/mir_app/src/menu_clist.cpp
+++ b/src/mir_app/src/menu_clist.cpp
@@ -661,12 +661,12 @@ INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam)
if (!(cmd >= CLISTMENUIDMIN && cmd <= CLISTMENUIDMAX))
return 0; // DO NOT process ids outside from clist menu id range v0.7.0.27+
- //process old menu sys
+ // process old menu sys
if (HIWORD(wParam) & MPCF_CONTACTMENU)
- return MO_ProcessCommandBySubMenuIdent((int)hContactMenuObject, LOWORD(wParam), lParam);
+ return MO_ProcessCommandBySubMenuIdent(hContactMenuObject, cmd, lParam);
- //unknown old menu
- return Menu_ProcessCommandById(LOWORD(wParam), lParam);
+ // unknown old menu
+ return Menu_ProcessCommandById(cmd, lParam);
}
BOOL FindMenuHanleByGlobalID(HMENU hMenu, TMO_IntMenuItem *id, MenuItemData* itdat)
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp
index 87916cebb0..e12c1e107c 100644
--- a/src/mir_app/src/srmm_statusicon.cpp
+++ b/src/mir_app/src/srmm_statusicon.cpp
@@ -23,6 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
+void SafeDestroyIcon(HICON hIcon)
+{
+ if (hIcon != NULL)
+ if (!IcoLib_IsManaged(hIcon))
+ ::DestroyIcon(hIcon);
+}
+
struct StatusIconChild : public MZeroedObject
{
~StatusIconChild()
@@ -36,15 +43,6 @@ struct StatusIconChild : public MZeroedObject
HICON hIcon, hIconDisabled;
int flags;
TCHAR *tszTooltip;
-
- void SafeDestroyIcon(HICON hIcon)
- {
- if (hIcon == NULL)
- return;
-
- if (!IcoLib_IsManaged(hIcon))
- ::DestroyIcon(hIcon);
- }
};
struct StatusIconMain : public MZeroedObject
@@ -105,7 +103,7 @@ INT_PTR ModifyStatusIcon(WPARAM hContact, LPARAM lParam)
pc->hContact = hContact;
p->arChildren.insert(pc);
}
- else pc->SafeDestroyIcon(pc->hIcon);
+ else SafeDestroyIcon(pc->hIcon);
pc->flags = sid->flags;
pc->hIcon = sid->hIcon;
@@ -193,11 +191,11 @@ static INT_PTR GetNthIcon(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-void KillModuleSrmmIcons(int hLangpack)
+void KillModuleSrmmIcons(int _hLang)
{
- for (int i=arIcons.getCount()-1; i >= 0; i--) {
+ for (int i = arIcons.getCount()-1; i >= 0; i--) {
StatusIconMain &p = arIcons[i];
- if (p.hLangpack == hLangpack)
+ if (p.hLangpack == _hLang)
arIcons.remove(i);
}
}