diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-16 19:39:31 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-16 19:39:31 +0300 |
commit | 6c0c95718d89b90c1993ca85656183e1a1c27bfe (patch) | |
tree | 901fdcfb631c3f24d65c6da07b9386e462010981 | |
parent | 8607a3a930f014ffabe03535e4ba5f2429fa395f (diff) |
fixes #4078 (Сделать меню групп доступнее)
-rw-r--r-- | include/m_clist.h | 12 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 290764 -> 290260 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 290438 -> 289972 bytes | |||
-rw-r--r-- | plugins/Clist_modern/src/groupmenu.cpp | 112 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/init.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_menuitems.cpp | 81 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_menuitems.h | 3 | ||||
-rw-r--r-- | src/mir_app/src/clc.cpp | 26 | ||||
-rw-r--r-- | src/mir_app/src/clui.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/genmenu.h | 3 | ||||
-rw-r--r-- | src/mir_app/src/menu_groups.cpp | 334 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 5 |
14 files changed, 206 insertions, 377 deletions
diff --git a/include/m_clist.h b/include/m_clist.h index 4c58f89896..365f95669f 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -156,18 +156,6 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddGroupMenuItem(TMO_MenuItem *pmi, GroupMen #define ME_CLIST_PREBUILDGROUPMENU "CList/PreBuildGroupMenu"
/////////////////////////////////////////////////////////////////////////////////////////
-// SUBGROUP MENU
-
-// adds a new item to the SubGroup menus
-// wParam=GroupMenuParam*, params to call when exec menuitem
-// lParam=(LPARAM)(TMO_MenuItem*)&mi
-EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddSubGroupMenuItem(TMO_MenuItem *pmi, GroupMenuParam *gmp = nullptr);
-
-// the SubGroup menu is about to be built
-// wParam = lParam = 0
-#define ME_CLIST_PREBUILDSUBGROUPMENU "CList/PreBuildSubGroupMenu"
-
-/////////////////////////////////////////////////////////////////////////////////////////
// TRAY MENU
// builds the tray menu
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex d5c7e0546d..c5b56d9a15 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 41564e1b0b..0f536676ed 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp index 0afffb63e2..36f7d3b617 100644 --- a/plugins/Clist_modern/src/groupmenu.cpp +++ b/plugins/Clist_modern/src/groupmenu.cpp @@ -27,115 +27,53 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Group MENU //////////////////////////////
-HGENMENU hGroupMainMenuItemProxy, hGroupStatusMenuItemProxy;
-
-void InitSubGroupMenus(void);
+static HGENMENU hShowOfflineUsersHereMenuItem;
-INT_PTR GroupMenuOnAddService(WPARAM wParam, LPARAM lParam)
+// wparam menu handle to pass to clc.c
+// lparam WM_COMMAND HWND
+static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
- MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
- if (mii == nullptr)
- return 0;
+ bool showOfflineinGroup, gray;
- if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = Menu_GetMainMenu();
+ ClcGroup *group = (ClcGroup *)wParam;
+ if (wParam == 0 || MirandaExiting())
+ showOfflineinGroup = gray = false;
+ else {
+ showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
+ gray = !group->bHideOffline;
}
- if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = Menu_GetStatusMenu();
- }
+ Menu_ShowItem(hShowOfflineUsersHereMenuItem, gray);
+ Menu_SetChecked(hShowOfflineUsersHereMenuItem, showOfflineinGroup && gray);
+ return 0;
+}
- return TRUE;
+static INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
+{
+ SendMessage(lParam ? (HWND)lParam : (HWND)g_clistApi.hwndContactTree, WM_COMMAND, wParam, 0);
+ return 0;
}
void InitGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSGroup/GroupMenuOnAddService", GroupMenuOnAddService);
-
- InitSubGroupMenus();
-
CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98);
- mi.position = 500;
+ mi.position = 500001;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.name.a = LPGEN("&Hide/show");
Menu_AddGroupMenuItem(&mi);
- SET_UID(mi, 0xb0f29663, 0x68b6, 0x494c, 0xaf, 0xab, 0xf6, 0x86, 0x45, 0xb8, 0xdb, 0xde);
- mi.position = 200000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszService = "FindAdd/FindAddCommand";
- mi.name.a = LPGEN("&Find/add contacts...");
- Menu_AddGroupMenuItem(&mi);
-
- SET_UID(mi, 0xff6855b4, 0x8c50, 0x43b7, 0x97, 0x51, 0xc1, 0x28, 0xa3, 0x10, 0x2b, 0x86);
- mi.position = 300000;
- mi.pszService = "";
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
- mi.name.a = LPGEN("&Main menu");
- hGroupMainMenuItemProxy = Menu_AddGroupMenuItem(&mi);
-
- SET_UID(mi, 0xba91af46, 0x34e5, 0x4f3a, 0x88, 0x1c, 0xe7, 0xa3, 0x53, 0x58, 0x19, 0xde);
- mi.position = 300100;
- mi.pszService = "";
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
- mi.name.a = LPGEN("&Status");
- hGroupStatusMenuItemProxy = Menu_AddGroupMenuItem(&mi);
-
- SET_UID(mi, 0xc2895531, 0x98e9, 0x40bc, 0x9b, 0x8e, 0xfb, 0x33, 0xe8, 0xab, 0xcc, 0xef);
- mi.position = 400000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
- mi.pszService = "Options/OptionsCommand";
- mi.name.a = LPGEN("&Options...");
- Menu_AddGroupMenuItem(&mi);
-
- SET_UID(mi, 0x2221068a, 0x285d, 0x490c, 0xb1, 0x95, 0xff, 0x49, 0x75, 0xbc, 0xe4, 0x59);
- mi.position = 1000000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszService = "Help/AboutCommand";
- mi.name.a = LPGEN("&About");
- Menu_AddGroupMenuItem(&mi);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////// SubGroup MENU //////////////////////////////
-
-static HGENMENU hShowOfflineUsersHereMenuItem;
-
-// wparam menu handle to pass to clc.c
-// lparam WM_COMMAND HWND
-static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
-{
- ClcGroup *group = (ClcGroup *)wParam;
- if (wParam == 0)
- return 0;
-
- if (MirandaExiting())
- return 0;
-
- bool showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
- bool gray2 = !group->bHideOffline;
-
- Menu_EnableItem(hShowOfflineUsersHereMenuItem, gray2);
- Menu_SetChecked(hShowOfflineUsersHereMenuItem, showOfflineinGroup && gray2);
- return 0;
-}
-
-void InitSubGroupMenus(void)
-{
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildSubGroupMenu);
// add exit command to menu
GroupMenuParam gmp = { POPUP_GROUPSHOWOFFLINE, 0 };
- CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7E081A28, 0x19B3, 0x407F, 0x80, 0x6B, 0x70, 0xC3, 0xC3, 0xA9, 0xD2, 0xA4);
- mi.position = 1002;
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.position = 900001;
+ mi.pszService = "Modern/GroupMenuExecProxy";
mi.name.a = LPGEN("&Show offline users in here");
- hShowOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
+ hShowOfflineUsersHereMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
+ CreateServiceFunction(mi.pszService, GroupMenuExecProxy);
}
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 46cf5dd029..628b9c0f99 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -154,7 +154,8 @@ static int OnModulesLoaded(WPARAM, LPARAM) // build contact's menuitems
RebuildMenu();
- HookEvent(ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDSTATUSMENU, OnBuildStatusMenu);
return 0;
}
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 5c7ee52469..6635f70216 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -40,7 +40,8 @@ HGENMENU *hMenuItemAccount = nullptr; *
* @return 0 on success, -1 on failure
**/
-INT_PTR RemoveMenuItems(HGENMENU *pItems, int Count)
+
+static INT_PTR RemoveMenuItems(HGENMENU *pItems, int Count)
{
if (!Count || !pItems) {
return -1;
@@ -63,6 +64,7 @@ INT_PTR RemoveMenuItems(HGENMENU *pItems, int Count) *
* @return nothing
**/
+
void RebuildContact()
{
HGENMENU mhRoot = nullptr;
@@ -85,7 +87,6 @@ void RebuildContact() // support new genmenu style
CMenuItem mi(&g_plugin);
-
switch (flag) {
case 3:
//cascade off
@@ -280,14 +281,15 @@ void RebuildMain() *
* @return nothing
**/
+
+static HGENMENU hGroupMenuItems[3], hSubGroupMenuItems[3];
+
void RebuildGroup()
{
int flag = 0;
uint8_t item = 0;
HGENMENU mhRoot = nullptr;
- HGENMENU mhExIm = nullptr;
- static HGENMENU hMenuItem[3] = { nullptr, nullptr, nullptr };
// load options
flag = g_plugin.getByte(SET_MI_GROUP, MCAS_NOTINITIATED);
@@ -297,7 +299,7 @@ void RebuildGroup() }
// delete all MenuItems and set all bytes 0 to avoid problems
- RemoveMenuItems(hMenuItem, _countof(hMenuItem));
+ RemoveMenuItems(hGroupMenuItems, _countof(hGroupMenuItems));
// create service name main (prevent to generate {(Null)/Ex-/Import Group} in db) and set pointer to end it
char text[200];
@@ -308,19 +310,18 @@ void RebuildGroup() switch (flag) {
case 3:
- //cascade off
- mhRoot = mhExIm = nullptr;
- hMenuItem[item++] = nullptr;
+ // cascade off
+ mhRoot = nullptr;
+ hGroupMenuItems[item++] = nullptr;
break;
case 5:
- //cascade all
+ // cascade all
SET_UID(mi, 0xfefe20db, 0x431f, 0x4fef, 0x9d, 0xa6, 0x70, 0xcd, 0x25, 0xf1, 0x2f, 0x1d);
mi.position = 250000;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
mhRoot = Menu_AddGroupMenuItem(&mi);
- hMenuItem[item++] = mhRoot;
- mhExIm = mhRoot;
+ hGroupMenuItems[item++] = mhRoot;
break;
case 9:
//cascade Ex/Import
@@ -328,9 +329,8 @@ void RebuildGroup() mi.position = 250100;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import contact");
- mhExIm = Menu_AddGroupMenuItem(&mi);
- hMenuItem[item++] = mhExIm;
- mhRoot = nullptr;
+ mhRoot = Menu_AddGroupMenuItem(&mi);
+ hGroupMenuItems[item++] = mhRoot;
break;
default:
//disable Menue
@@ -338,7 +338,7 @@ void RebuildGroup() }
// VCard's Ex/Import menuitems
- mi.root = mhExIm;
+ mi.root = mhRoot;
// Export
SET_UID(mi, 0x9a0d81ec, 0x6795, 0x421a, 0xb2, 0x79, 0x41, 0xbd, 0xde, 0x29, 0x3b, 0xa4);
@@ -346,7 +346,7 @@ void RebuildGroup() mi.name.a = LPGEN("Export all contacts");
mi.position = 250200;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
+ hGroupMenuItems[item++] = Menu_AddGroupMenuItem(&mi);
// Import
SET_UID(mi, 0xd6d98c8f, 0x5cdf, 0x4138, 0x88, 0x6c, 0x31, 0x1a, 0x5a, 0x9, 0x56, 0xbb);
@@ -354,7 +354,7 @@ void RebuildGroup() mi.name.a = LPGEN("Import all contacts");
mi.position = 250300;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
+ hGroupMenuItems[item++] = Menu_AddGroupMenuItem(&mi);
}
/******************************
@@ -376,10 +376,6 @@ void RebuildSubGroup() uint8_t item = 0;
GroupMenuParam gmp = { 0 };
- HGENMENU mhRoot = nullptr;
- HGENMENU mhExIm = nullptr;
- static HGENMENU hMenuItem[3] = { nullptr, nullptr, nullptr };
-
// load options
flag = g_plugin.getByte(SET_MI_SUBGROUP, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
@@ -388,7 +384,7 @@ void RebuildSubGroup() }
// delete all MenuItems and set all bytes 0 to avoid problems
- RemoveMenuItems(hMenuItem, _countof(hMenuItem));
+ RemoveMenuItems(hSubGroupMenuItems, _countof(hSubGroupMenuItems));
// create service name main (prevent to generate {(Null)/Ex-/Import Group} in db) and set pointer to end it
char text[200];
@@ -398,11 +394,13 @@ void RebuildSubGroup() mi.pszService = text;
char* tDest = text + mir_strlen(text);
+ HGENMENU mhRoot;
+
switch (flag) {
case 3:
//cascade off
- mhRoot = mhExIm = nullptr;
- hMenuItem[item++] = nullptr;
+ mhRoot = nullptr;
+ hSubGroupMenuItems[item++] = nullptr;
break;
case 5:
//cascade all
@@ -410,9 +408,8 @@ void RebuildSubGroup() mi.position = 1050000;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
- mhRoot = Menu_AddSubGroupMenuItem(&mi);
- hMenuItem[item++] = mhRoot;
- mhExIm = mhRoot;
+ mhRoot = Menu_AddGroupMenuItem(&mi);
+ hSubGroupMenuItems[item++] = mhRoot;
break;
case 9:
//cascade Ex/Import
@@ -420,9 +417,8 @@ void RebuildSubGroup() mi.position = 1050100;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import group");
- mhExIm = Menu_AddSubGroupMenuItem(&mi);
- hMenuItem[item++] = mhExIm;
- mhRoot = nullptr;
+ mhRoot = Menu_AddGroupMenuItem(&mi);
+ hSubGroupMenuItems[item++] = mhRoot;
break;
default:
//disable Menue
@@ -430,27 +426,37 @@ void RebuildSubGroup() }
// VCard's Ex/Import menuitems
- mi.root = mhExIm;
+ mi.root = mhRoot;
// Export
SET_UID(mi, 0x65be2523, 0x15fd, 0x45ca, 0xae, 0xe6, 0xc2, 0x98, 0xd2, 0xa9, 0xff, 0xd5);
mir_strcpy(tDest, "/ExportGroup"); //mi.pszService
if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
- mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export group");
+ mi.name.a = mhRoot!= NULL ? LPGEN("&Export") : LPGEN("&Export group");
mi.position = 1050200;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
gmp.wParam = TRUE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
+ hSubGroupMenuItems[item++] = Menu_AddGroupMenuItem(&mi, &gmp);
// Import
SET_UID(mi, 0xf6be7278, 0x4adb, 0x4e6a, 0x9f, 0x63, 0x79, 0xda, 0xbb, 0xcd, 0xbe, 0x42);
mir_strcpy(tDest, "/ImportGroup"); //mi.pszService
if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
- mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import group");
+ mi.name.a = mhRoot != NULL ? LPGEN("&Import") : LPGEN("&Import group");
mi.position = 1050300;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
gmp.wParam = FALSE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
+ hSubGroupMenuItems[item++] = Menu_AddGroupMenuItem(&mi, &gmp);
+}
+
+int OnBuildGroupMenu(WPARAM wParam, LPARAM)
+{
+ for (auto &it : hGroupMenuItems)
+ Menu_ShowItem(it, wParam == 0);
+
+ for (auto &it : hSubGroupMenuItems)
+ Menu_ShowItem(it, wParam != 0);
+ return 0;
}
/******************************
@@ -469,7 +475,7 @@ void RebuildSubGroup() *
* @return always 0
**/
-INT_PTR RebuildAccount(WPARAM, LPARAM lParam)
+int OnBuildStatusMenu(WPARAM, LPARAM lParam)
{
if (Miranda_IsTerminated())
return 0;
@@ -577,5 +583,6 @@ void RebuildMenu() RebuildContact();
RebuildGroup();
RebuildSubGroup();
- RebuildAccount(NULL, 1);
+
+ OnBuildStatusMenu(NULL, 1);
}
diff --git a/plugins/UserInfoEx/src/mir_menuitems.h b/plugins/UserInfoEx/src/mir_menuitems.h index 27d8f7afc9..8dcb432cd9 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.h +++ b/plugins/UserInfoEx/src/mir_menuitems.h @@ -32,7 +32,8 @@ void RebuildMain(); void RebuildContact();
void RebuildGroup();
void RebuildSubGroup();
-INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam);
+int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam);
+int OnBuildStatusMenu(WPARAM wParam, LPARAM lParam);
#endif /* _UINFOEX_MENUITEMS_H_INCLUDED_ */
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 458aae07a0..b52c63f672 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -1201,7 +1201,7 @@ LBL_MoveSelection: if (dat->selection != -1 && hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMCHECK | CLCHT_ONITEMLABEL)) {
HMENU hMenu;
if (contact->type == CLCIT_GROUP)
- hMenu = Menu_BuildSubGroupMenu(contact->group);
+ hMenu = Menu_BuildGroupMenu(contact->group);
else if (contact->type == CLCIT_CONTACT)
hMenu = Menu_BuildContactMenu(contact->hContact);
else
@@ -1231,30 +1231,8 @@ LBL_MoveSelection: if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, contact->hContact))
break;
- if (contact->type == CLCIT_GROUP) {
- switch (LOWORD(wParam)) {
- case POPUP_NEWGROUP:
- case POPUP_NEWSUBGROUP:
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
- if (LOWORD(wParam) == POPUP_NEWGROUP)
- Clist_GroupCreate(0, nullptr);
- else
- Clist_GroupCreate(contact->groupId, nullptr);
- break;
- case POPUP_RENAMEGROUP:
- g_clistApi.pfnBeginRenameSelection(hwnd, dat);
- break;
- case POPUP_DELETEGROUP:
- Clist_GroupDelete(contact->groupId);
- break;
- case POPUP_GROUPHIDEOFFLINE:
- Clist_GroupSetFlags(contact->groupId, MAKELPARAM(contact->group->bHideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
- break;
- }
-
+ if (contact->type == CLCIT_GROUP)
Menu_ProcessCommandById(wParam, (LPARAM)hwnd);
- }
break;
case WM_DESTROY:
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 3837862075..e46368d640 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -892,7 +892,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
}
if (PtInRect(&rc, pt)) {
- HMENU hMenu = Menu_BuildGroupMenu();
+ HMENU hMenu = Menu_BuildGroupMenu(nullptr);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, hwnd, nullptr);
Menu_DestroyNestedMenu(hMenu);
return 0;
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h index 072c252171..bf004c48b6 100644 --- a/src/mir_app/src/genmenu.h +++ b/src/mir_app/src/genmenu.h @@ -126,8 +126,7 @@ int UninitGenMenu(); int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *param);
-HMENU Menu_BuildGroupMenu(void);
-HMENU Menu_BuildSubGroupMenu(struct ClcGroup *group);
+HMENU Menu_BuildGroupMenu(struct ClcGroup *group);
LPTSTR GetMenuItemText(TMO_IntMenuItem*);
diff --git a/src/mir_app/src/menu_groups.cpp b/src/mir_app/src/menu_groups.cpp index ea5b08bc98..a8dccf8e77 100644 --- a/src/mir_app/src/menu_groups.cpp +++ b/src/mir_app/src/menu_groups.cpp @@ -25,15 +25,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
/////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////// Group MENU //////////////////////////////
+// Group menu
-int hGroupMenuObject, hSubGroupMenuObject;
+int hGroupMenuObject;
-static HANDLE hEventPreBuildGroupMenu, hEventPreBuildSubGroupMenu;
-static HGENMENU hHideOfflineUsersMenuItem;
-static HGENMENU hHideOfflineUsersOutHereMenuItem;
-static HGENMENU hHideEmptyGroupsMenuItem;
-static HGENMENU hDisableGroupsMenuItem;
+static HANDLE hEventPreBuildGroupMenu;
+static HGENMENU hmiHideOfflineUsers, hmiHideOfflineUsersInHere, hmiHideOfflineUsersOutHere;
+static HGENMENU hmiHideEmptyGroups, hmiDisableGroups;
+static HGENMENU hmiCreateSubgroup, hmiRenameGroup, hmiDeleteGroup;
// Groupmenu exec param(ownerdata)
@@ -43,12 +42,12 @@ struct GroupMenuExecParam int Param1, Param2;
};
-HMENU Menu_BuildGroupMenu()
+HMENU Menu_BuildGroupMenu(struct ClcGroup *group)
{
- NotifyEventHooks(hEventPreBuildGroupMenu, 0, 0);
+ NotifyEventHooks(hEventPreBuildGroupMenu, WPARAM(group), 0);
HMENU hMenu = CreatePopupMenu();
- Menu_Build(hMenu, hGroupMenuObject);
+ Menu_Build(hMenu, hGroupMenuObject, WPARAM(group));
return hMenu;
}
@@ -74,6 +73,22 @@ MIR_APP_DLL(HGENMENU) Menu_AddGroupMenuItem(TMO_MenuItem *pmi, GroupMenuParam *g }
// called with:
+// wparam - ClcGroup*
+// lparam - lparam from winproc
+static INT_PTR GroupMenuCheckService(WPARAM wParam, LPARAM)
+{
+ TCheckProcParam *CParam = (TCheckProcParam *)wParam;
+ if (CParam) {
+ GroupMenuExecParam *mmep = (GroupMenuExecParam *)(CParam->MenuItemOwnerData);
+ if (mmep) {
+ mmep->Param1 = CParam->wParam;
+ mmep->Param2 = CParam->lParam;
+ }
+ }
+ return 1;
+}
+
+// called with:
// wparam - ownerdata
// lparam - lparam from winproc
INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM)
@@ -114,7 +129,7 @@ static INT_PTR UseGroupsHelper(WPARAM, LPARAM) return newVal;
}
-static INT_PTR HideOfflineHelper(WPARAM, LPARAM)
+static INT_PTR ToggleOfflineHelper(WPARAM, LPARAM)
{
return g_clistApi.pfnSetHideOffline(-1);
}
@@ -134,119 +149,58 @@ static INT_PTR CreateGroupHelper(WPARAM, LPARAM) return 0;
}
-static int OnBuildGroupMenu(WPARAM, LPARAM)
+static INT_PTR CreateSubGroupHelper(WPARAM wParam, LPARAM)
{
- bool bChecked = Clist::HideOffline;
- Menu_SetChecked(hHideOfflineUsersMenuItem, bChecked);
-
- bChecked = SendMessage(g_clistApi.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
- Menu_SetChecked(hHideOfflineUsersOutHereMenuItem, bChecked);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(g_clistApi.hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
- uint32_t dwStyle = GetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE);
- Menu_SetChecked(hHideEmptyGroupsMenuItem, (dwStyle & CLS_HIDEEMPTYGROUPS) != 0);
- Menu_SetChecked(hDisableGroupsMenuItem, (dwStyle & CLS_USEGROUPS) == 0);
+ auto *pGroup = (ClcGroup *)wParam;
+ Clist_GroupCreate(pGroup ? pGroup->groupId : 0, nullptr);
return 0;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////// SubGroup MENU //////////////////////////////
-
-struct SubGroupMenuExecParam
+static INT_PTR HideInGroupHelper(WPARAM wParam, LPARAM)
{
- char *szServiceName;
- int Param1, Param2;
-};
-
-HMENU Menu_BuildSubGroupMenu(ClcGroup *group)
-{
- NotifyEventHooks(hEventPreBuildSubGroupMenu, (WPARAM)group, 0);
-
- HMENU hMenu = CreatePopupMenu();
- Menu_Build(hMenu, hSubGroupMenuObject, (WPARAM)group, 0);
- return hMenu;
+ auto *pGroup = (ClcGroup *)wParam;
+ Clist_GroupSetFlags(pGroup->groupId, MAKELPARAM(pGroup->bHideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
+ return 0;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_APP_DLL(HGENMENU) Menu_AddSubGroupMenuItem(TMO_MenuItem *pmi, GroupMenuParam *gmp)
+static INT_PTR RenameGroupHelper(WPARAM wParam, LPARAM)
{
- SubGroupMenuExecParam *mmep = (SubGroupMenuExecParam *)mir_calloc(sizeof(SubGroupMenuExecParam));
- if (mmep == nullptr)
- return nullptr;
-
- // we need just one parametr.
- mmep->szServiceName = mir_strdup(pmi->pszService);
- if (gmp != nullptr) {
- mmep->Param1 = gmp->wParam;
- mmep->Param2 = gmp->lParam;
- }
-
- HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, pmi, mmep);
-
- char buf[1024];
- mir_snprintf(buf, "%s/%s", pmi->pszService, pmi->name.a);
- Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, buf);
- return hNewItem;
+ auto *pGroup = (ClcGroup *)wParam;
+ PostMessage(g_clistApi.hwndContactTree, CLM_EDITLABEL, pGroup->groupId | HCONTACT_ISGROUP, 0);
+ return 0;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM)
+static INT_PTR DeleteGroupHelper(WPARAM wParam, LPARAM)
{
- TCheckProcParam *CParam = (TCheckProcParam *)wParam;
- if (CParam) {
- SubGroupMenuExecParam *mmep = (SubGroupMenuExecParam *)(CParam->MenuItemOwnerData);
- if (mmep)
- mmep->Param2 = CParam->lParam;
- }
- return 1;
+ auto *pGroup = (ClcGroup *)wParam;
+ Clist_GroupDelete(pGroup->groupId);
+ return 0;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// called with:
-// wparam - ownerdata
-// lparam - lparam from winproc
-
-static INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam)
+static int OnBuildGroupMenu(WPARAM wParam, LPARAM)
{
- if (wParam != 0) {
- SubGroupMenuExecParam *mmep = (SubGroupMenuExecParam *)wParam;
- CallService(mmep->szServiceName, mmep->Param1, lParam);
- }
- return 1;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
+ bool bChecked = Clist::HideOffline;
+ Menu_SetChecked(hmiHideOfflineUsers, bChecked);
-static INT_PTR FreeOwnerDataSubGroupMenu(WPARAM, LPARAM lParam)
-{
- SubGroupMenuExecParam *mmep = (SubGroupMenuExecParam *)lParam;
- if (mmep != nullptr) {
- mir_free(mmep->szServiceName);
- mir_free(mmep);
- }
- return 0;
-}
+ bChecked = SendMessage(g_clistApi.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) != 0;
+ Menu_SetChecked(hmiHideOfflineUsersOutHere, bChecked);
-/////////////////////////////////////////////////////////////////////////////////////////
+ uint32_t dwStyle = GetWindowLongPtr(g_clistApi.hwndContactTree, GWL_STYLE);
+ Menu_SetChecked(hmiHideEmptyGroups, (dwStyle & CLS_HIDEEMPTYGROUPS) != 0);
+ Menu_SetChecked(hmiDisableGroups, (dwStyle & CLS_USEGROUPS) == 0);
-static HGENMENU hHideOfflineUsersHereMenuItem;
+ Menu_ShowItem(hmiRenameGroup, wParam != 0);
+ Menu_ShowItem(hmiDeleteGroup, wParam != 0);
+ Menu_ShowItem(hmiCreateSubgroup, wParam != 0);
+ Menu_ShowItem(hmiHideOfflineUsersInHere, wParam != 0);
+ Menu_ShowItem(hmiHideOfflineUsersOutHere, wParam == 0);
-static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
-{
- ClcGroup *group = (ClcGroup*)wParam;
+ ClcGroup *group = (ClcGroup *)wParam;
if (group != nullptr) // contact->group
- Menu_SetChecked(hHideOfflineUsersHereMenuItem, group->bHideOffline != 0);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// wparam menu handle to pass to clc.c
-// lparam WM_COMMAND HWND
-
-static INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
-{
- SendMessage(lParam ? (HWND)lParam : (HWND)g_clistApi.hwndContactTree, WM_COMMAND, wParam, 0);
+ Menu_SetChecked(hmiHideOfflineUsersInHere, group->bHideOffline != 0);
return 0;
}
@@ -254,10 +208,9 @@ static INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam) void InitGroupMenus(void)
{
- GroupMenuParam gmp = {};
-
// Group menu
CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSGroup/CheckService", GroupMenuCheckService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
hEventPreBuildGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
@@ -265,106 +218,77 @@ void InitGroupMenus(void) hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), nullptr, "CLISTMENUSGroup/ExecService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
+ Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_CHECK_SERVICE, "CLISTMENUSGroup/CheckService");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuOnAddService");
- {
- CMenuItem mi(&g_plugin);
-
- SET_UID(mi, 0x2f75bc72, 0xd836, 0x4922, 0x9f, 0xe, 0xed, 0x9e, 0xe7, 0x2b, 0x84, 0xf0);
- mi.position = 100000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUPADD);
- mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
- mi.name.a = LPGEN("New group");
- Menu_AddGroupMenuItem(&mi);
- CreateServiceFunction(mi.pszService, CreateGroupHelper);
-
- SET_UID(mi, 0xe6269658, 0x69, 0x4094, 0x9b, 0x35, 0x4e, 0x80, 0x29, 0x26, 0xf, 0x8e);
- mi.position = 500001;
- mi.hIcolibItem = nullptr;
- mi.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
- mi.name.a = LPGEN("Hide offline users");
- gmp.wParam = -1;
- hHideOfflineUsersMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
- CreateServiceFunction(mi.pszService, HideOfflineHelper);
-
- SET_UID(mi, 0xeded7371, 0xf6e6, 0x48c3, 0x8c, 0x9e, 0x62, 0xc1, 0xd5, 0xcb, 0x51, 0xbc);
- mi.position++;
- mi.pszService = MS_CLIST_TOGGLEHIDEOFFLINEROOT;
- mi.name.a = LPGEN("Hide offline users out here");
- hHideOfflineUsersOutHereMenuItem = Menu_AddGroupMenuItem(&mi);
- CreateServiceFunction(mi.pszService, HideOfflineRootHelper);
-
- SET_UID(mi, 0x4c17b9cf, 0x513a, 0x41d8, 0x8d, 0x2b, 0x89, 0x44, 0x81, 0x14, 0x0, 0x91);
- mi.position++;
- mi.pszService = MS_CLIST_TOGGLEEMPTYGROUPS;
- mi.name.a = LPGEN("Hide empty groups");
- hHideEmptyGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
- CreateServiceFunction(mi.pszService, HideGroupsHelper);
-
- SET_UID(mi, 0xfcbdbbb1, 0xa553, 0x49ac, 0xa5, 0xdf, 0xb4, 0x81, 0x38, 0xf, 0xa0, 0xc7);
- mi.position++;
- mi.pszService = MS_CLIST_TOGGLEGROUPS;
- mi.name.a = LPGEN("Disable groups");
- hDisableGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
- CreateServiceFunction(mi.pszService, UseGroupsHelper);
-
- SET_UID(mi, 0xfffb8733, 0xa3e4, 0x4566, 0xa6, 0x6e, 0x4c, 0x4c, 0x7c, 0xe9, 0x56, 0x99);
- mi.position = 1900000;
- mi.pszService = "CloseAction";
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
- mi.name.a = LPGEN("Exit");
- Menu_AddGroupMenuItem(&mi);
- }
- // SubGroup menu
- CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
- CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService", SubGroupMenuCheckService);
-
- hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
-
- hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), nullptr, "CLISTMENUSSubGroup/ExecService");
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_CHECK_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuCheckService");
- {
- CMenuItem mi(&g_plugin);
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- CreateServiceFunction(mi.pszService, GroupMenuExecProxy);
-
- SET_UID(mi, 0xd208f1d2, 0x7220, 0x4d37, 0xb6, 0xe4, 0xd5, 0x4a, 0xe8, 0xa3, 0xf4, 0x53);
- mi.position = 1000;
- mi.name.a = LPGEN("New group");
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD);
- gmp.wParam = POPUP_NEWGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- SET_UID(mi, 0x24bcb592, 0x660e, 0x4541, 0xa0, 0xac, 0x11, 0x4a, 0x23, 0xc8, 0x9b, 0x91);
- mi.position++;
- mi.name.a = LPGEN("New subgroup");
- gmp.wParam = POPUP_NEWSUBGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- SET_UID(mi, 0xd85f5ff0, 0x12ca, 0x464d, 0x86, 0x51, 0x53, 0x36, 0x9f, 0x1d, 0x80, 0x45);
- mi.position++;
- mi.hIcolibItem = nullptr;
- mi.name.a = LPGEN("Hide offline users in here");
- gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- SET_UID(mi, 0xf0953dd, 0x5c31, 0x48a4, 0xb4, 0x16, 0x89, 0x5, 0x97, 0xd0, 0x75, 0x3e);
- mi.position = 900001;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
- mi.name.a = LPGEN("Rename group");
- gmp.wParam = POPUP_RENAMEGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- SET_UID(mi, 0xb0d63cda, 0xa743, 0x4cfa, 0xa6, 0x2d, 0x50, 0xc0, 0x90, 0xe7, 0x6a, 0xc4);
- mi.position++;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
- mi.name.a = LPGEN("Delete group");
- gmp.wParam = POPUP_DELETEGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
- }
+ CMenuItem mi(&g_plugin);
+
+ SET_UID(mi, 0x2f75bc72, 0xd836, 0x4922, 0x9f, 0xe, 0xed, 0x9e, 0xe7, 0x2b, 0x84, 0xf0);
+ mi.position = 100000;
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUPADD);
+ mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
+ mi.name.a = LPGEN("New group");
+ Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, CreateGroupHelper);
+
+ SET_UID(mi, 0x24bcb592, 0x660e, 0x4541, 0xa0, 0xac, 0x11, 0x4a, 0x23, 0xc8, 0x9b, 0x91);
+ mi.position++;
+ mi.name.a = LPGEN("New subgroup");
+ mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
+ hmiCreateSubgroup = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, CreateSubGroupHelper);
+
+ SET_UID(mi, 0xe6269658, 0x69, 0x4094, 0x9b, 0x35, 0x4e, 0x80, 0x29, 0x26, 0xf, 0x8e);
+ mi.position = 500001;
+ mi.hIcolibItem = nullptr;
+ mi.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
+ mi.name.a = LPGEN("Hide offline users");
+ hmiHideOfflineUsers = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, ToggleOfflineHelper);
+
+ SET_UID(mi, 0xeded7371, 0xf6e6, 0x48c3, 0x8c, 0x9e, 0x62, 0xc1, 0xd5, 0xcb, 0x51, 0xbc);
+ mi.position++;
+ mi.pszService = MS_CLIST_TOGGLEHIDEOFFLINEROOT;
+ mi.name.a = LPGEN("Hide offline users out here");
+ hmiHideOfflineUsersOutHere = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, HideOfflineRootHelper);
+
+ SET_UID(mi, 0x4c17b9cf, 0x513a, 0x41d8, 0x8d, 0x2b, 0x89, 0x44, 0x81, 0x14, 0x0, 0x91);
+ mi.position++;
+ mi.pszService = MS_CLIST_TOGGLEEMPTYGROUPS;
+ mi.name.a = LPGEN("Hide empty groups");
+ hmiHideEmptyGroups = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, HideGroupsHelper);
+
+ SET_UID(mi, 0xfcbdbbb1, 0xa553, 0x49ac, 0xa5, 0xdf, 0xb4, 0x81, 0x38, 0xf, 0xa0, 0xc7);
+ mi.position++;
+ mi.pszService = MS_CLIST_TOGGLEGROUPS;
+ mi.name.a = LPGEN("Disable groups");
+ hmiDisableGroups = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, UseGroupsHelper);
+
+ SET_UID(mi, 0xd85f5ff0, 0x12ca, 0x464d, 0x86, 0x51, 0x53, 0x36, 0x9f, 0x1d, 0x80, 0x45);
+ mi.position = 900001;
+ mi.hIcolibItem = nullptr;
+ mi.name.a = LPGEN("Hide offline users in here");
+ mi.pszService = "CLISTMENUSGroup/HideInGroupHelper";
+ hmiHideOfflineUsersInHere = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, HideInGroupHelper);
+
+ SET_UID(mi, 0xf0953dd, 0x5c31, 0x48a4, 0xb4, 0x16, 0x89, 0x5, 0x97, 0xd0, 0x75, 0x3e);
+ mi.position++;
+ mi.name.a = LPGEN("Rename group");
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
+ mi.pszService = "CLISTMENUSGroup/RenameGroupHelper";
+ hmiRenameGroup = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, RenameGroupHelper);
+
+ SET_UID(mi, 0xb0d63cda, 0xa743, 0x4cfa, 0xa6, 0x2d, 0x50, 0xc0, 0x90, 0xe7, 0x6a, 0xc4);
+ mi.position++;
+ mi.name.a = LPGEN("Delete group");
+ mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
+ mi.pszService = "CLISTMENUSGroup/DeleteGroupHelper";
+ hmiDeleteGroup = Menu_AddGroupMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, DeleteGroupHelper);
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index f1267d12ad..9a82e8e1f0 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -158,7 +158,6 @@ Menu_BuildContactMenu @226 Menu_GetMainMenu @228
Menu_GetStatusMenu @229
Menu_AddGroupMenuItem @231
-Menu_AddSubGroupMenuItem @232
Menu_AddTrayMenuItem @234
Menu_BuildTrayMenu @235
Menu_DestroyNestedMenu @236
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 4dd4d1e245..64227040f5 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -158,7 +158,6 @@ Menu_BuildContactMenu @226 Menu_GetMainMenu @228
Menu_GetStatusMenu @229
Menu_AddGroupMenuItem @231
-Menu_AddSubGroupMenuItem @232
Menu_AddTrayMenuItem @234
Menu_BuildTrayMenu @235
Menu_DestroyNestedMenu @236
diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index d3bd1a71b9..1576f6d873 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -664,9 +664,6 @@ #define ID_ICQ_EXIT 40001
#define IDM_COPY 40001
#define ID_RESET 40002
-#define POPUP_NEWGROUP 40003
-#define POPUP_NEWSUBGROUP 40004
-#define POPUP_GROUPHIDEOFFLINE 40006
#define IDM_SENDMESSAGE 40009
#define IDM_COPYALL 40011
#define IDM_SELECTALL 40012
@@ -675,8 +672,6 @@ #define IDM_COPYLINK 40015
#define ID_CANCELCHANGE 40018
#define POPUP_GROUPSHOWOFFLINE 40019
-#define POPUP_RENAMEGROUP 40052
-#define POPUP_DELETEGROUP 40053
#define ID_GROUP 40066
#define ID_UNGROUP 40067
#define IDM_SEARCH_GOOGLE 40080
|