diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-27 11:09:19 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-27 11:09:19 +0000 |
commit | ab4abbb7a60f941acab8f0566c6b619f68f1b489 (patch) | |
tree | a67f4d3bde6bb59d3c49195a8c6e9085e01124eb /protocols | |
parent | 9d65ee38c92c7a0656ddc6c4c26017b7226fc44b (diff) |
- CLISTMENUITEM::pszContactOwner removed, because it's supported only by contact's menu;
- Menu_AddContactMenuItem now receives parameter szProto;
- Menu_Add* helpers are converted into real functions;
git-svn-id: http://svn.miranda-ng.org/main/trunk@14409 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
30 files changed, 316 insertions, 377 deletions
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index fe5555e638..c51a5fb3eb 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -218,7 +218,7 @@ void CAimProto::InitMainMenus(void) if (hRoot == NULL) {
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle("aim");
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = 500090000;
hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
@@ -237,62 +237,57 @@ void CAimProto::InitMainMenus(void) CreateProtoService("/ManageAccount", &CAimProto::ManageAccount);
mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
- mi.pszName = LPGEN("Manage Account");
+ mi.name.a = LPGEN("Manage Account");
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
- mi.pszName = LPGEN("Instant Idle");
+ mi.name.a = LPGEN("Instant Idle");
hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
- mi.pszName = LPGEN( "Join Chat Room" );
+ mi.name.a = LPGEN( "Join Chat Room" );
hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
}
void CAimProto::InitContactMenus(void)
{
- //Do not put any services below HTML get away message!!!
- char service_name[200];
-
CLISTMENUITEM mi = { 0 };
- mi.pszService = service_name;
- mi.pszContactOwner = m_szModuleName;
- mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
CreateProtoService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
+ mi.pszService = "/GetHTMLAwayMsg";
mi.position = -2000006000;
mi.icolibItem = GetIconHandle("away");
- mi.pszName = LPGEN("Read &HTML Away Message");
+ mi.name.a = LPGEN("Read &HTML Away Message");
mi.flags = CMIF_NOTOFFLINE | CMIF_HIDDEN;
- hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
+ hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/GetProfile");
CreateProtoService("/GetProfile", &CAimProto::GetProfile);
+ mi.pszService = "/GetProfile";
mi.position = -2000005090;
mi.icolibItem = GetIconHandle("profile");
- mi.pszName = LPGEN("Read Profile");
+ mi.name.a = LPGEN("Read Profile");
mi.flags = CMIF_NOTOFFLINE;
- Menu_AddContactMenuItem(&mi);
+ Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
+ mi.pszService = "/AddToServerList";
mi.position = -2000005080;
mi.icolibItem = GetIconHandle("add");
- mi.pszName = LPGEN("Add To Server List");
+ mi.name.a = LPGEN("Add To Server List");
mi.flags = CMIF_NOTONLINE | CMIF_HIDDEN;
- hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
+ hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
+ mi.pszService = "/BlockCommand";
mi.position = -2000005060;
mi.icolibItem = GetIconHandle("block");
- mi.pszName = LPGEN("&Block");
+ mi.name.a = LPGEN("&Block");
mi.flags = CMIF_HIDDEN;
- hBlockContextMenuItem = Menu_AddContactMenuItem(&mi);
+ hBlockContextMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 589d2e125e..ecb6403495 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -110,70 +110,70 @@ void InitContactMenus() CLISTMENUITEM mi = { 0 };
mi.position = -2000006000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
- mi.pszName = LPGEN("Visit profile");
+ mi.name.a = LPGEN("Visit profile");
mi.pszService = "FacebookProto/VisitProfile";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitProfile>);
g_hContactMenuVisitProfile = Menu_AddContactMenuItem(&mi);
mi.position = -2000006001;
mi.icolibItem = GetIconHandle("friendship");
- mi.pszName = LPGEN("Visit friendship details");
+ mi.name.a = LPGEN("Visit friendship details");
mi.pszService = "FacebookProto/VisitFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitFriendship>);
g_hContactMenuVisitFriendship = Menu_AddContactMenuItem(&mi);
mi.position = -2000006002;
mi.icolibItem = GetIconHandle("conversation");
- mi.pszName = LPGEN("Visit conversation");
+ mi.name.a = LPGEN("Visit conversation");
mi.pszService = "FacebookProto/VisitConversation";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitConversation>);
g_hContactMenuVisitConversation = Menu_AddContactMenuItem(&mi);
mi.position = -2000006003;
mi.icolibItem = GetIconHandle("mind");
- mi.pszName = LPGEN("Share status...");
+ mi.name.a = LPGEN("Share status...");
mi.pszService = "FacebookProto/Mind";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::OnMind>);
g_hContactMenuPostStatus = Menu_AddContactMenuItem(&mi);
mi.position = -2000006004;
mi.icolibItem = GetIconHandle("poke");
- mi.pszName = LPGEN("Poke");
+ mi.name.a = LPGEN("Poke");
mi.pszService = "FacebookProto/Poke";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::Poke>);
g_hContactMenuPoke = Menu_AddContactMenuItem(&mi);
mi.position = -2000006010;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
- mi.pszName = LPGEN("Cancel friendship");
+ mi.name.a = LPGEN("Cancel friendship");
mi.pszService = "FacebookProto/CancelFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::CancelFriendship>);
g_hContactMenuAuthRevoke = Menu_AddContactMenuItem(&mi);
mi.position = -2000006011;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
- mi.pszName = LPGEN("Cancel friendship request");
+ mi.name.a = LPGEN("Cancel friendship request");
mi.pszService = "FacebookProto/CancelFriendshipRequest";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::OnCancelFriendshipRequest>);
g_hContactMenuAuthCancel = Menu_AddContactMenuItem(&mi);
mi.position = -2000006012;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
- mi.pszName = LPGEN("Request friendship");
+ mi.name.a = LPGEN("Request friendship");
mi.pszService = "FacebookProto/RequestFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::RequestFriendship>);
g_hContactMenuAuthAsk = Menu_AddContactMenuItem(&mi);
mi.position = -2000006013;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
- mi.pszName = LPGEN("Approve friendship");
+ mi.name.a = LPGEN("Approve friendship");
mi.pszService = "FacebookProto/ApproveFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::ApproveFriendship>);
g_hContactMenuAuthGrant = Menu_AddContactMenuItem(&mi);
mi.position = -2000006014;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
- mi.pszName = LPGEN("Deny friendship request");
+ mi.name.a = LPGEN("Deny friendship request");
mi.pszService = "FacebookProto/DenyFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::DenyFriendship>);
g_hContactMenuAuthDeny = Menu_AddContactMenuItem(&mi);
@@ -221,7 +221,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) miRoot.position = 500085000;
miRoot.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (this->isOnline() ? 0 : CMIF_GRAYED);
miRoot.icolibItem = GetIconHandle("facebook");
- miRoot.ptszName = m_tszUserName;
+ miRoot.name.t = m_tszUserName;
hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&miRoot);
}
else {
@@ -237,20 +237,20 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) //CreateProtoService(m_szModuleName,"/Mind",&FacebookProto::OnMind,this);
mir_strcpy(tDest, "/Mind");
- mi.pszName = LPGEN("Share status...");
+ mi.name.a = LPGEN("Share status...");
mi.icolibItem = GetIconHandle("mind");
m_hStatusMind = Menu_AddProtoMenuItem(&mi);
//CreateProtoService("/VisitProfile",&FacebookProto::VisitProfile);
mir_strcpy(tDest, "/VisitProfile");
- mi.pszName = LPGEN("Visit profile");
+ mi.name.a = LPGEN("Visit profile");
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
// TODO RM: remember and properly free in destructor?
/*m_hStatusMind = */Menu_AddProtoMenuItem(&mi);
//CreateProtoService("/VisitNotifications", &FacebookProto::VisitNotifications);
mir_strcpy(tDest, "/VisitNotifications");
- mi.pszName = LPGEN("Visit notifications");
+ mi.name.a = LPGEN("Visit notifications");
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
Menu_AddProtoMenuItem(&mi);
@@ -259,19 +259,19 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) CreateProtoService("/RefreshBuddyList", &FacebookProto::RefreshBuddyList);
mir_strcpy(tDest, "/RefreshBuddyList");
- mi.pszName = LPGEN("Refresh Buddy List");
+ mi.name.a = LPGEN("Refresh Buddy List");
mi.icolibItem = GetIconHandle("friendship");
Menu_AddProtoMenuItem(&mi);
CreateProtoService("/CheckFriendRequests", &FacebookProto::CheckFriendRequests);
mir_strcpy(tDest, "/CheckFriendRequests");
- mi.pszName = LPGEN("Check Friends Requests");
+ mi.name.a = LPGEN("Check Friends Requests");
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
Menu_AddProtoMenuItem(&mi);
CreateProtoService("/CheckNewsfeeds", &FacebookProto::CheckNewsfeeds);
mir_strcpy(tDest, "/CheckNewsfeeds");
- mi.pszName = LPGEN("Check Newsfeeds");
+ mi.name.a = LPGEN("Check Newsfeeds");
mi.icolibItem = GetIconHandle("newsfeed");
Menu_AddProtoMenuItem(&mi);
return 0;
diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index d39dc2b166..e9da9939d3 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -44,13 +44,13 @@ int InitMenus(WPARAM wParam, LPARAM lParam) mir_snprintf(szServiceName, _countof(szServiceName), "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX);
CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)szModuleName);
- CLISTMENUITEM cmi = { 0 };
- cmi.hParentMenu = HGENMENU(wParam);
- cmi.hIcon = g_hPopupIcon;
- cmi.position = 200101;
- cmi.pszName = LPGEN("Open mailbox");
- cmi.pszService = szServiceName;
- Menu_AddProtoMenuItem(&cmi);
+ CLISTMENUITEM mi = { 0 };
+ mi.hParentMenu = HGENMENU(wParam);
+ mi.icolibItem = g_hPopupIcon;
+ mi.position = 200101;
+ mi.name.a = LPGEN("Open mailbox");
+ mi.pszService = szServiceName;
+ Menu_AddProtoMenuItem(&mi);
}
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 7a7a6dd8d6..95b23cc877 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -235,18 +235,12 @@ INT_PTR GGPROTO::blockuser(WPARAM hContact, LPARAM lParam) #define GGS_BLOCKUSER "/BlockUser"
void GGPROTO::block_init()
{
- char service[64];
- mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, GGS_BLOCKUSER);
- CreateProtoService(GGS_BLOCKUSER, &GGPROTO::blockuser);
-
CLISTMENUITEM mi = { 0 };
- mi.flags = CMIF_TCHAR;
mi.position = -500050000;
mi.icolibItem = iconList[8].hIcolib;
- mi.ptszName = LPGENT("&Block");
- mi.pszService = service;
- mi.pszContactOwner = m_szModuleName;
- hBlockMenuItem = Menu_AddContactMenuItem(&mi);
+ mi.name.a = LPGEN("&Block");
+ mi.pszService = GGS_BLOCKUSER;
+ hBlockMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
::HookEvent(ME_CLIST_PREBUILDCONTACTMENU, gg_prebuildcontactmenu);
}
@@ -267,7 +261,7 @@ void GGPROTO::menus_init() HGENMENU hGCRoot, hCLRoot, hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = 500090000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = iconList[0].hIcolib;
@@ -277,12 +271,12 @@ void GGPROTO::menus_init() mi.hParentMenu = hRoot;
mi.flags = CMIF_TCHAR;
- mi.ptszName = LPGENT("Conference");
+ mi.name.t = LPGENT("Conference");
mi.position = 200001;
mi.icolibItem = iconList[14].hIcolib;
hGCRoot = Menu_AddProtoMenuItem(&mi);
- mi.ptszName = LPGENT("Contact list");
+ mi.name.t = LPGENT("Contact list");
mi.position = 200002;
mi.icolibItem = iconList[7].hIcolib;
hCLRoot = Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 76f99f114f..abecfa9c4a 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -68,7 +68,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) CreateProtoService(GGS_OPEN_CONF, &GGPROTO::gc_openconf);
mi.position = 2000050001;
mi.icolibItem = iconList[14].hIcolib;
- mi.ptszName = LPGENT("Open &conference...");
+ mi.name.t = LPGENT("Open &conference...");
mi.pszService = service;
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
@@ -77,7 +77,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) CreateProtoService(GGS_CLEAR_IGNORED, &GGPROTO::gc_clearignored);
mi.position = 2000050002;
mi.icolibItem = iconList[15].hIcolib;
- mi.ptszName = LPGENT("&Clear ignored conferences");
+ mi.name.t = LPGENT("&Clear ignored conferences");
mi.pszService = service;
hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 753bf9b454..6591861af4 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -68,19 +68,13 @@ int gg_img_remove(GGIMAGEDLGDATA *dat); int GGPROTO::img_init()
{
- char service[64];
- mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, GGS_SENDIMAGE);
- CreateProtoService(GGS_SENDIMAGE, &GGPROTO::img_sendimg);
-
// Send image contact menu item
CLISTMENUITEM mi = { 0 };
- mi.flags = CMIF_TCHAR;
mi.position = -2000010000;
mi.icolibItem = iconList[11].hIcolib;
- mi.ptszName = LPGENT("&Image");
- mi.pszService = service;
- mi.pszContactOwner = m_szModuleName;
- hImageMenuItem = Menu_AddContactMenuItem(&mi);
+ mi.name.a = LPGEN("&Image");
+ mi.pszService = GGS_SENDIMAGE;
+ hImageMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
// Receive image
CreateProtoService(GGS_RECVIMAGE, &GGPROTO::img_recvimage);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index b9c925d1d4..1c8b286dee 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -524,7 +524,7 @@ void GGPROTO::import_init(HGENMENU hRoot) mi.hParentMenu = hRoot;
mi.position = 2000500001;
mi.icolibItem = iconList[1].hIcolib;
- mi.ptszName = LPGENT("Import List From &Server");
+ mi.name.t = LPGENT("Import List From &Server");
mi.pszService = service;
hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
@@ -534,7 +534,7 @@ void GGPROTO::import_init(HGENMENU hRoot) mi.position = 2000500002;
mi.icolibItem = iconList[2].hIcolib;
- mi.ptszName = LPGENT("Import List From &Text File...");
+ mi.name.t = LPGENT("Import List From &Text File...");
mi.pszService = service;
hMainMenu[3] = Menu_AddProtoMenuItem(&mi);
@@ -544,7 +544,7 @@ void GGPROTO::import_init(HGENMENU hRoot) mi.position = 2000500003;
mi.icolibItem = iconList[3].hIcolib;
- mi.ptszName = LPGENT("&Remove List From Server");
+ mi.name.t = LPGENT("&Remove List From Server");
mi.pszService = service;
hMainMenu[4] = Menu_AddProtoMenuItem(&mi);
@@ -554,7 +554,7 @@ void GGPROTO::import_init(HGENMENU hRoot) mi.position = 2005000001;
mi.icolibItem = iconList[4].hIcolib;
- mi.ptszName = LPGENT("Export List To &Server");
+ mi.name.t = LPGENT("Export List To &Server");
mi.pszService = service;
hMainMenu[5] = Menu_AddProtoMenuItem(&mi);
@@ -564,7 +564,7 @@ void GGPROTO::import_init(HGENMENU hRoot) mi.position = 2005000002;
mi.icolibItem = iconList[5].hIcolib;
- mi.ptszName = LPGENT("Export List To &Text File...");
+ mi.name.t = LPGENT("Export List To &Text File...");
mi.pszService = service;
hMainMenu[6] = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index 1b19989681..748c8751de 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -425,7 +425,7 @@ void GGPROTO::sessions_menus_init(HGENMENU hRoot) mi.hParentMenu = hRoot;
mi.position = (hMenuRoot) ? 2050000001 : 200003;
mi.icolibItem = iconList[16].hIcolib;
- mi.ptszName = LPGENT("Concurrent &sessions");
+ mi.name.t = LPGENT("Concurrent &sessions");
mi.pszService = service;
Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index ef3635738c..5dab9c9973 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -32,7 +32,7 @@ void CIrcProto::InitMainMenus(void) HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
// Root popupmenuitem
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = -1999901010;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MAIN);
@@ -46,7 +46,7 @@ void CIrcProto::InitMainMenus(void) }
mi.flags = 0;
- mi.pszName = LPGEN("&Quick connect");
+ mi.name.a = LPGEN("&Quick connect");
mi.icolibItem = GetIconHandle(IDI_QUICK);
mir_strcpy(d, IRC_QUICKCONNECT);
mi.position = 201001;
@@ -55,26 +55,26 @@ void CIrcProto::InitMainMenus(void) if (m_iStatus != ID_STATUS_OFFLINE) mi.flags |= CMIF_GRAYED;
- mi.pszName = LPGEN("&Join channel");
+ mi.name.a = LPGEN("&Join channel");
mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN);//GetIconHandle(IDI_JOIN);
mir_strcpy(d, IRC_JOINCHANNEL);
mi.position = 201002;
hMenuJoin = Menu_AddProtoMenuItem(&mi);
- mi.pszName = LPGEN("&Change your nickname");
+ mi.name.a = LPGEN("&Change your nickname");
mi.icolibItem = GetIconHandle(IDI_RENAME);
mir_strcpy(d, IRC_CHANGENICK);
mi.position = 201003;
hMenuNick = Menu_AddProtoMenuItem(&mi);
- mi.pszName = LPGEN("Show the &list of available channels");
+ mi.name.a = LPGEN("Show the &list of available channels");
mi.icolibItem = GetIconHandle(IDI_LIST);
mir_strcpy(d, IRC_SHOWLIST);
mi.position = 201004;
hMenuList = Menu_AddProtoMenuItem(&mi);
if (m_useServer) mi.flags &= ~CMIF_GRAYED;
- mi.pszName = LPGEN("&Show the server window");
+ mi.name.a = LPGEN("&Show the server window");
mi.icolibItem = GetIconHandle(IDI_SERVER);
mir_strcpy(d, IRC_SHOWSERVER);
mi.position = 201005;
@@ -142,28 +142,28 @@ void InitContactMenus(void) CLISTMENUITEM mi = { 0 };
mi.pszService = temp;
- mi.pszName = LPGEN("Channel &settings");
+ mi.name.a = LPGEN("Channel &settings");
mi.icolibItem = GetIconHandle(IDI_MANAGER);
mir_strcpy(d, IRC_UM_CHANSETTINGS);
mi.position = 500090002;
hUMenuChanSettings = Menu_AddContactMenuItem(&mi);
hMenuChanSettings = CreateServiceFunction(temp, IrcMenuChanSettings);
- mi.pszName = LPGEN("&WhoIs info");
+ mi.name.a = LPGEN("&WhoIs info");
mi.icolibItem = GetIconHandle(IDI_WHOIS);
mir_strcpy(d, IRC_UM_WHOIS);
mi.position = 500090001;
hUMenuWhois = Menu_AddContactMenuItem(&mi);
hMenuWhois = CreateServiceFunction(temp, IrcMenuWhois);
- mi.pszName = LPGEN("Di&sconnect");
+ mi.name.a = LPGEN("Di&sconnect");
mi.icolibItem = GetIconHandle(IDI_DELETE);
mir_strcpy(d, IRC_UM_DISCONNECT);
mi.position = 500090001;
hUMenuDisconnect = Menu_AddContactMenuItem(&mi);
hMenuDisconnect = CreateServiceFunction(temp, IrcMenuDisconnect);
- mi.pszName = LPGEN("&Add to ignore list");
+ mi.name.a = LPGEN("&Add to ignore list");
mi.icolibItem = GetIconHandle(IDI_BLOCK);
mir_strcpy(d, IRC_UM_IGNORE);
mi.position = 500090002;
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index a075dc3cea..6de74333e1 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -117,7 +117,7 @@ void g_MenuInit(void) // "Request authorization"
mir_strcpy(pszDest, MS_REQ_AUTH); CreateServiceFunction(str, IcqMenuHandleRequestAuth );
- mi.pszName = LPGEN("Request authorization");
+ mi.name.a = LPGEN("Request authorization");
mi.position = 1000030000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
g_hContactMenuItems[ICMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -125,7 +125,7 @@ void g_MenuInit(void) // "Grant authorization"
mir_strcpy(pszDest, MS_GRANT_AUTH); CreateServiceFunction(str, IcqMenuHandleGrantAuth);
- mi.pszName = LPGEN("Grant authorization");
+ mi.name.a = LPGEN("Grant authorization");
mi.position = 1000029999;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
g_hContactMenuItems[ICMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
@@ -133,7 +133,7 @@ void g_MenuInit(void) // "Revoke authorization"
mir_strcpy(pszDest, MS_REVOKE_AUTH); CreateServiceFunction(str, IcqMenuHandleRevokeAuth);
- mi.pszName = LPGEN("Revoke authorization");
+ mi.name.a = LPGEN("Revoke authorization");
mi.position = 1000029998;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
g_hContactMenuItems[ICMI_AUTH_REVOKE] = Menu_AddContactMenuItem(&mi);
@@ -141,7 +141,7 @@ void g_MenuInit(void) // "Add to server list"
mir_strcpy(pszDest, MS_ICQ_ADDSERVCONTACT); CreateServiceFunction(str, IcqMenuHandleAddServContact);
- mi.pszName = LPGEN("Add to server list");
+ mi.name.a = LPGEN("Add to server list");
mi.position = -2049999999;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD);
g_hContactMenuItems[ICMI_ADD_TO_SERVLIST] = Menu_AddContactMenuItem(&mi);
@@ -149,7 +149,7 @@ void g_MenuInit(void) // "Show custom status details"
mir_strcpy(pszDest, MS_XSTATUS_SHOWDETAILS); CreateServiceFunction(str, IcqMenuHandleXStatusDetails);
- mi.pszName = LPGEN("Show custom status details");
+ mi.name.a = LPGEN("Show custom status details");
mi.position = -2000004999;
mi.icolibItem = 0;
g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = Menu_AddContactMenuItem(&mi);
@@ -157,7 +157,7 @@ void g_MenuInit(void) // "Open ICQ profile"
mir_strcpy(pszDest, MS_OPEN_PROFILE); CreateServiceFunction(str, IcqMenuHandleOpenProfile);
- mi.pszName = LPGEN("Open ICQ profile");
+ mi.name.a = LPGEN("Open ICQ profile");
mi.position = 1000029997;
g_hContactMenuItems[ICMI_OPEN_PROFILE] = Menu_AddContactMenuItem(&mi);
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 28cd0a0d7d..122d26816a 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -837,7 +837,6 @@ INT_PTR CIcqProto::menuXStatus(WPARAM, LPARAM, LPARAM fParam) void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
{
size_t len = mir_strlen(m_szModuleName);
- char srvFce[MAX_PATH + 64];
int bXStatusMenuBuilt = 0;
BYTE bXStatus = getContactXStatus(NULL);
@@ -861,23 +860,22 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) }
for (int i = 0; i <= XSTATUS_COUNT; i++) {
- mir_snprintf(srvFce, _countof(srvFce), "%s/menuXStatus%d", m_szModuleName, i);
-
+ char srvFce[MAX_PATH + 64];
+ mir_snprintf(srvFce, _countof(srvFce), "/menuXStatus%d", i);
mi.position++;
if (!i)
- bXStatusMenuBuilt = ServiceExists(srvFce);
+ bXStatusMenuBuilt = ProtoServiceExists(m_szModuleName, srvFce);
if (!bXStatusMenuBuilt)
CreateProtoServiceParam(srvFce+len, &CIcqProto::menuXStatus, i);
mi.flags = (bXStatus == i ? CMIF_CHECKED : 0);
mi.icolibItem = i ? hXStatusIcons[i-1] : NULL;
- mi.pszName = i ? (char*)nameXStatus[i-1] : (char *)LPGEN("None");
+ mi.name.a = i ? (char*)nameXStatus[i-1] : (char *)LPGEN("None");
mi.pszService = srvFce;
- mi.pszContactOwner = m_szModuleName;
- hXStatusItems[i] = Menu_AddStatusMenuItem(&mi);
+ hXStatusItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
Menu_ShowItem(hXStatusItems[i], !(m_bHideXStatusUI || m_bHideXStatusMenu));
}
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 7ef067e026..7124ed79bd 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -201,7 +201,7 @@ void g_MenuInit(void) CLISTMENUITEM mi = { 0 };
// "Request authorization"
- mi.pszName = LPGEN("Request authorization");
+ mi.name.a = LPGEN("Request authorization");
mi.position = -2000001000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
mi.pszService = "Jabber/ReqAuth";
@@ -210,7 +210,7 @@ void g_MenuInit(void) // "Grant authorization"
mi.pszService = "Jabber/GrantAuth";
- mi.pszName = LPGEN("Grant authorization");
+ mi.name.a = LPGEN("Grant authorization");
mi.position = -2000001001;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi);
@@ -218,7 +218,7 @@ void g_MenuInit(void) // Revoke auth
mi.pszService = "Jabber/RevokeAuth";
- mi.pszName = LPGEN("Revoke authorization");
+ mi.name.a = LPGEN("Revoke authorization");
mi.position = -2000001002;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi);
@@ -226,7 +226,7 @@ void g_MenuInit(void) // "Convert Chat/Contact"
mi.pszService = "Jabber/ConvertChatContact";
- mi.pszName = LPGEN("Convert");
+ mi.name.a = LPGEN("Convert");
mi.position = -1999901004;
mi.icolibItem = g_GetIconHandle(IDI_USER2ROOM);
g_hMenuConvert = Menu_AddContactMenuItem(&mi);
@@ -234,7 +234,7 @@ void g_MenuInit(void) // "Add to roster"
mi.pszService = "Jabber/AddToRoster";
- mi.pszName = LPGEN("Add to roster");
+ mi.name.a = LPGEN("Add to roster");
mi.position = -1999901005;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD);
g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi);
@@ -242,7 +242,7 @@ void g_MenuInit(void) // "Add to Bookmarks"
mi.pszService = "Jabber/AddToBookmarks";
- mi.pszName = LPGEN("Add to Bookmarks");
+ mi.name.a = LPGEN("Add to Bookmarks");
mi.position = -1999901006;
mi.icolibItem = g_GetIconHandle(IDI_BOOKMARKS);
g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
@@ -250,7 +250,7 @@ void g_MenuInit(void) // Login/logout
mi.pszService = "Jabber/TransportLogin";
- mi.pszName = LPGEN("Login/logout");
+ mi.name.a = LPGEN("Login/logout");
mi.position = -1999901007;
mi.icolibItem = g_GetIconHandle(IDI_LOGIN);
g_hMenuLogin = Menu_AddContactMenuItem(&mi);
@@ -258,7 +258,7 @@ void g_MenuInit(void) // Retrieve nicks
mi.pszService = "Jabber/TransportGetNicks";
- mi.pszName = LPGEN("Resolve nicks");
+ mi.name.a = LPGEN("Resolve nicks");
mi.position = -1999901008;
mi.icolibItem = g_GetIconHandle(IDI_REFRESH);
g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
@@ -266,7 +266,7 @@ void g_MenuInit(void) // Run Commands
mi.pszService = "Jabber/RunCommands";
- mi.pszName = LPGEN("Commands");
+ mi.name.a = LPGEN("Commands");
mi.position = -1999901009;
mi.icolibItem = g_GetIconHandle(IDI_COMMAND);
g_hMenuCommands = Menu_AddContactMenuItem(&mi);
@@ -274,7 +274,7 @@ void g_MenuInit(void) // Send Note
mi.pszService = "Jabber/SendNote";
- mi.pszName = LPGEN("Send Note");
+ mi.name.a = LPGEN("Send Note");
mi.position = -1999901010;
mi.icolibItem = g_GetIconHandle(IDI_SEND_NOTE);
g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
@@ -282,7 +282,7 @@ void g_MenuInit(void) // Direct Presence
mi.pszService = "Jabber/DirectPresenceDummySvc";
- mi.pszName = LPGEN("Send Presence");
+ mi.name.a = LPGEN("Send Presence");
mi.position = -1999901011;
mi.icolibItem = g_GetIconHandle(IDI_NOTES);
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
@@ -292,7 +292,7 @@ void g_MenuInit(void) char buf[] = "Jabber/DirectPresenceX";
buf[_countof(buf) - 2] = '0' + i;
mi.pszService = buf;
- mi.ptszName = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
+ mi.name.t = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
mi.position = -1999901000;
mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = Skin_LoadIcon(PresenceModeArray[i].icon);
@@ -304,13 +304,13 @@ void g_MenuInit(void) // Resource selector
mi.pszService = "Jabber/ResourceSelectorDummySvc";
- mi.pszName = LPGEN("Jabber Resource");
+ mi.name.a = LPGEN("Jabber Resource");
mi.position = -1999901011;
mi.icolibItem = g_GetIconHandle(IDI_JABBER);
g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);
mi.pszService = "Jabber/UseResource_last";
- mi.pszName = LPGEN("Last Active");
+ mi.name.a = LPGEN("Last Active");
mi.position = -1999901000;
mi.hParentMenu = g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle(IDI_JABBER);
@@ -318,7 +318,7 @@ void g_MenuInit(void) CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN);
mi.pszService = "Jabber/UseResource_server";
- mi.pszName = LPGEN("Server's Choice");
+ mi.name.a = LPGEN("Server's Choice");
mi.position = -1999901000;
mi.icolibItem = g_GetIconHandle(IDI_NODE_SERVER);
g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
@@ -416,23 +416,18 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) }
char text[256];
- mir_strcpy(text, m_szModuleName);
- size_t nModuleNameLength = mir_strlen(text);
- char* tDest = text + nModuleNameLength;
-
CLISTMENUITEM mi = { 0 };
mi.pszService = text;
- mi.pszContactOwner = m_szModuleName;
CMString szTmp;
for (int i = 0; i < nMenuResourceItemsNew; i++) {
- mir_snprintf(tDest, _countof(text) - nModuleNameLength, "/UseResource_%d", i);
+ mir_snprintf(text, _countof(text), "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
- CreateProtoServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i);
- mi.pszName = "";
+ CreateProtoServiceParam(text, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i);
+ mi.name.a = "";
mi.position = i;
mi.hParentMenu = g_hMenuResourcesRoot;
- m_phMenuResourceItems[i] = Menu_AddContactMenuItem(&mi);
+ m_phMenuResourceItems[i] = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
if (i < item->arResources.getCount()) {
pResourceStatus r(item->arResources[i]);
@@ -591,7 +586,7 @@ void CJabberProto::MenuInit() HGENMENU hJabberRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hJabberRoot == NULL) {
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = -1999901006;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = m_hProtoIcon;
@@ -608,13 +603,13 @@ void CJabberProto::MenuInit() mir_strcpy(tDest, "/Bookmarks");
mi.flags = 0;
mi.hParentMenu = hJabberRoot;
- mi.pszName = LPGEN("Bookmarks");
+ mi.name.a = LPGEN("Bookmarks");
mi.position = 200001;
mi.icolibItem = GetIconHandle(IDI_BOOKMARKS);
m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi);
// "Services..."
- mi.pszName = LPGEN("Services...");
+ mi.name.a = LPGEN("Services...");
mir_strcpy(tDest, "/Services");
mi.position = 200003;
mi.icolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
@@ -623,7 +618,7 @@ void CJabberProto::MenuInit() // "Service Discovery..."
CreateProtoService("/ServiceDiscovery", &CJabberProto::OnMenuHandleServiceDiscovery);
mir_strcpy(tDest, "/ServiceDiscovery");
- mi.pszName = LPGEN("Service Discovery");
+ mi.name.a = LPGEN("Service Discovery");
mi.position = 2000050001;
mi.icolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
mi.hParentMenu = hMenuServicesRoot;
@@ -631,28 +626,28 @@ void CJabberProto::MenuInit() CreateProtoService("/SD/MyTransports", &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports);
mir_strcpy(tDest, "/SD/MyTransports");
- mi.pszName = LPGEN("Registered Transports");
+ mi.name.a = LPGEN("Registered Transports");
mi.position = 2000050003;
mi.icolibItem = GetIconHandle(IDI_TRANSPORTL);
m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi);
CreateProtoService("/SD/Transports", &CJabberProto::OnMenuHandleServiceDiscoveryTransports);
mir_strcpy(tDest, "/SD/Transports");
- mi.pszName = LPGEN("Local Server Transports");
+ mi.name.a = LPGEN("Local Server Transports");
mi.position = 2000050004;
mi.icolibItem = GetIconHandle(IDI_TRANSPORT);
m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi);
CreateProtoService("/SD/Conferences", &CJabberProto::OnMenuHandleServiceDiscoveryConferences);
mir_strcpy(tDest, "/SD/Conferences");
- mi.pszName = LPGEN("Browse chatrooms");
+ mi.name.a = LPGEN("Browse chatrooms");
mi.position = 2000050005;
mi.icolibItem = GetIconHandle(IDI_GROUP);
m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi);
CreateProtoService("/Groupchat", &CJabberProto::OnMenuHandleJoinGroupchat);
mir_strcpy(tDest, "/Groupchat");
- mi.pszName = LPGEN("Create/Join group chat");
+ mi.name.a = LPGEN("Create/Join group chat");
mi.position = 2000050006;
mi.icolibItem = GetIconHandle(IDI_GROUP);
m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi);
@@ -660,7 +655,7 @@ void CJabberProto::MenuInit() // "Change Password..."
CreateProtoService("/ChangePassword", &CJabberProto::OnMenuHandleChangePassword);
mir_strcpy(tDest, "/ChangePassword");
- mi.pszName = LPGEN("Change Password");
+ mi.name.a = LPGEN("Change Password");
mi.position = 2000050007;
mi.icolibItem = GetIconHandle(IDI_KEYS);
m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi);
@@ -668,7 +663,7 @@ void CJabberProto::MenuInit() // "Roster editor"
CreateProtoService("/RosterEditor", &CJabberProto::OnMenuHandleRosterControl);
mir_strcpy(tDest, "/RosterEditor");
- mi.pszName = LPGEN("Roster editor");
+ mi.name.a = LPGEN("Roster editor");
mi.position = 2000050009;
mi.icolibItem = GetIconHandle(IDI_AGENTS);
m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi);
@@ -676,14 +671,14 @@ void CJabberProto::MenuInit() // "XML Console"
CreateProtoService("/XMLConsole", &CJabberProto::OnMenuHandleConsole);
mir_strcpy(tDest, "/XMLConsole");
- mi.pszName = LPGEN("XML Console");
+ mi.name.a = LPGEN("XML Console");
mi.position = 2000050010;
mi.icolibItem = GetIconHandle(IDI_CONSOLE);
Menu_AddProtoMenuItem(&mi);
CreateProtoService("/Notes", &CJabberProto::OnMenuHandleNotes);
mir_strcpy(tDest, "/Notes");
- mi.pszName = LPGEN("Notes");
+ mi.name.a = LPGEN("Notes");
mi.position = 2000050011;
mi.icolibItem = GetIconHandle(IDI_NOTES);
m_hMenuNotes = Menu_AddProtoMenuItem(&mi);
@@ -699,24 +694,23 @@ void CJabberProto::MenuInit() m_priorityMenuValSet = false;
mi.position = 200006;
- mi.pszContactOwner = m_szModuleName;
mi.hParentMenu = hJabberRoot;
- mi.pszName = LPGEN("Resource priority");
+ mi.name.a = LPGEN("Resource priority");
mi.flags = CMIF_HIDDEN;
m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
TCHAR szName[128];
- char srvFce[MAX_PATH + 64], *svcName = srvFce + mir_strlen(m_szModuleName);
+ char srvFce[MAX_PATH + 64];
mi.pszService = srvFce;
- mi.ptszName = szName;
+ mi.name.t = szName;
mi.position = 2000040000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hParentMenu = m_hMenuPriorityRoot;
- mir_snprintf(srvFce, _countof(srvFce), "%s/menuSetPriority/0", m_szModuleName);
- bool needServices = !ServiceExists(srvFce);
+ mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", 0);
+ bool needServices = !ProtoServiceExists(m_szModuleName, srvFce);
if (needServices)
- CreateProtoServiceParam(svcName, &CJabberProto::OnMenuSetPriority, 0);
+ CreateProtoServiceParam(srvFce, &CJabberProto::OnMenuSetPriority, 0);
int steps[] = { 10, 5, 1, 0, -1, -5, -10 };
for (int i = 0; i < _countof(steps); i++) {
@@ -725,7 +719,7 @@ void CJabberProto::MenuInit() continue;
}
- mir_snprintf(srvFce, _countof(srvFce), "%s/menuSetPriority/%d", m_szModuleName, steps[i]);
+ mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.icolibItem = GetIconHandle(IDI_ARROW_UP);
@@ -736,10 +730,10 @@ void CJabberProto::MenuInit() }
if (needServices)
- CreateProtoServiceParam(svcName, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
+ CreateProtoServiceParam(srvFce, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
mi.position++;
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
UpdatePriorityMenu((short)getWord("Priority", 0));
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index c0094d836e..27b686607f 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2092,23 +2092,20 @@ void CJabberProto::BuildPrivacyMenu() {
CLISTMENUITEM mi = { 0 };
mi.position = 200005;
- mi.pszContactOwner = m_szModuleName;
mi.icolibItem = GetIconHandle(IDI_AGENTS);
mi.flags = CMIF_HIDDEN;
- mi.pszName = LPGEN("Privacy Lists");
+ mi.name.a = LPGEN("Privacy Lists");
mi.hParentMenu = Menu_GetProtocolRoot(m_szModuleName);
m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
CreateProtoService("/PrivacyLists", &CJabberProto::OnMenuHandlePrivacyLists);
- char srvFce[MAX_PATH + 64];
- mir_snprintf(srvFce, _countof(srvFce), "%s/PrivacyLists", m_szModuleName);
- mi.pszService = srvFce;
+ mi.pszService = "/PrivacyLists";
mi.position = 3000040000;
mi.flags = CMIF_TCHAR;
mi.icolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
- mi.ptszName = LPGENT("List Editor...");
+ mi.name.t = LPGENT("List Editor...");
mi.hParentMenu = m_hPrivacyMenuRoot;
- Menu_AddProtoMenuItem(&mi);
+ Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
@@ -2137,7 +2134,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) }
mi.position++;
mi.icolibItem = Skin_GetIconHandle(m_privacyListManager.GetActiveListName() ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
- mi.ptszName = LPGENT("<none>");
+ mi.name.t = LPGENT("<none>");
m_hPrivacyMenuItems.insert(Menu_AddProtoMenuItem(&mi));
for (CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
@@ -2152,7 +2149,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mi.position++;
mi.icolibItem = Skin_GetIconHandle(
mir_tstrcmp(m_privacyListManager.GetActiveListName(), pList->GetListName()) ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
- mi.ptszName = pList->GetListName();
+ mi.name.t = pList->GetListName();
m_hPrivacyMenuItems.insert(Menu_AddProtoMenuItem(&mi));
}
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 85c9464cf6..7e1cd47ed0 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -471,7 +471,7 @@ void CPepGuiService::RebuildMenu() mi.position = 200010;
mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
mi.icolibItem = m_hIcolibItem;
- mi.ptszName = m_szText ? m_szText : _T("<advanced status slot>");
+ mi.name.t = m_szText ? m_szText : _T("<advanced status slot>");
m_hMenuItem = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index a8ad1ff78d..2624a00a3c 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -277,9 +277,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM hContact, LPARAM) int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
{
- CHAR szServiceFunction[MAX_PATH * 2], *pszServiceFunctionName, szValueName[MAX_PATH];
- strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
- pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
+ CHAR szServiceFunction[MAX_PATH], szValueName[MAX_PATH];
TCHAR szItem[MAX_PATH + 64];
mir_sntprintf(szItem, _countof(szItem), _T("%s Custom Status"), m_tszUserName);
@@ -289,7 +287,6 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) mi.hParentMenu = Menu_CreateRoot(MO_STATUS, szItem, 500085000);
mi.flags = CMIF_UNICODE;
mi.pszService = szServiceFunction;
- mi.pszContactOwner = m_szModuleName;
CMStringW szStatusTitle;
@@ -297,22 +294,22 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) if (getByte(NULL, "xStatusShowAll", MRA_DEFAULT_SHOW_ALL_XSTATUSES))
dwCount = MRA_XSTATUS_COUNT;
for (DWORD i = 0; i < dwCount; i ++) {
- mir_snprintf(pszServiceFunctionName, 100, "/menuXStatus%ld", i);
+ mir_snprintf(szServiceFunction, _countof(szServiceFunction), "/menuXStatus%ld", i);
mi.position ++;
if (i) {
mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", i);
if (mraGetStringW(NULL, szValueName, szStatusTitle))
- mi.ptszName = (TCHAR*)szStatusTitle.c_str();
+ mi.name.t = (TCHAR*)szStatusTitle.c_str();
else
- mi.ptszName = (TCHAR*)lpcszXStatusNameDef[i];
+ mi.name.t = (TCHAR*)lpcszXStatusNameDef[i];
mi.icolibItem = hXStatusAdvancedStatusIcons[i];
}
else {
- mi.ptszName = (TCHAR*)lpcszXStatusNameDef[i];
- mi.hIcon = NULL;
+ mi.name.t = (TCHAR*)lpcszXStatusNameDef[i];
+ mi.icolibItem = NULL;
}
- hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi);
+ hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
return 0;
}
@@ -325,20 +322,18 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI return NULL;
char szServiceFunction[MAX_PATH];
- strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
- char *pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { 0 };
- HGENMENU hRootMenu, (*fnAddFunc)(CLISTMENUITEM*);
+ HGENMENU hRootMenu, (__stdcall *fnAddFunc)(CLISTMENUITEM*, const char*, int);
if (bIsMain) {
fnAddFunc = Menu_AddProtoMenuItem;
hRootMenu = Menu_GetProtocolRoot(m_szModuleName);
if (hRootMenu == NULL) {
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.hIcon = g_hMainIcon;
+ mi.icolibItem = g_hMainIcon;
hRootMenu = Menu_AddProtoMenuItem(&mi);
}
@@ -351,19 +346,19 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI }
mi.flags = 0;
- mi.pszName = LPGEN("Services...");
- mi.hIcon = g_hMainIcon;
- hRootMenu = fnAddFunc(&mi);
+ mi.name.a = LPGEN("Services...");
+ mi.icolibItem = g_hMainIcon;
+ hRootMenu = fnAddFunc(&mi, m_szModuleName, hLangpack);
mi.hParentMenu = hRootMenu;
mi.pszService = szServiceFunction;
for (size_t i = 0; i < dwCount; i++) {
- mir_strcpy(pszServiceFunctionName, pgdiItems[i].szName);
+ mi.pszService = pgdiItems[i].szName;
mi.position = int(lPosition + i);
mi.icolibItem = pgdiItems[i].hIcolib;
- mi.pszName = pgdiItems[i].szDescr;
- hResult[i] = fnAddFunc(&mi);
+ mi.name.a = pgdiItems[i].szDescr;
+ hResult[i] = fnAddFunc(&mi, m_szModuleName, hLangpack);
Menu_ConfigureItem(hResult[i], MCI_OPT_EXECPARAM, lPopupPosition);
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 2a43ea284b..a70494628c 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -279,7 +279,7 @@ void CMsnProto::MsnInitMainMenu(void) mi.position = 500085000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MSN);
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
@@ -296,7 +296,7 @@ void CMsnProto::MsnInitMainMenu(void) CreateProtoService(MS_SET_NICKNAME_UI, &CMsnProto::SetNicknameUI);
mi.position = 201001;
mi.icolibItem = GetIconHandle(IDI_MSN);
- mi.pszName = LPGEN("Set &Nickname");
+ mi.name.a = LPGEN("Set &Nickname");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
#endif
@@ -304,28 +304,28 @@ void CMsnProto::MsnInitMainMenu(void) CreateProtoService(MSN_INVITE, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
mi.icolibItem = GetIconHandle(IDI_INVITE);
- mi.pszName = LPGEN("Create &Chat");
+ mi.name.a = LPGEN("Create &Chat");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
mir_strcpy(tDest, MS_GOTO_INBOX);
CreateProtoService(MS_GOTO_INBOX, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
mi.icolibItem = GetIconHandle(IDI_INBOX);
- mi.pszName = LPGEN("Display &Hotmail Inbox");
+ mi.name.a = LPGEN("Display &Hotmail Inbox");
menuItemsMain[1] = Menu_AddProtoMenuItem(&mi);
mir_strcpy(tDest, MS_EDIT_PROFILE);
CreateProtoService(MS_EDIT_PROFILE, &CMsnProto::MsnEditProfile);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("View &Profile");
+ mi.name.a = LPGEN("View &Profile");
menuItemsMain[2] = Menu_AddProtoMenuItem(&mi);
mir_strcpy(tDest, MS_EDIT_ALERTS);
CreateProtoService(MS_EDIT_ALERTS, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("Setup Live &Alerts");
+ mi.name.a = LPGEN("Setup Live &Alerts");
menuItemsMain[3] = Menu_AddProtoMenuItem(&mi);
MSN_EnableMenuItems(m_iStatus >= ID_STATUS_ONLINE);
@@ -410,14 +410,14 @@ void MSN_InitContactMenu(void) hBlockCom = CreateServiceFunction(servicefunction, MsnMenuBlockCommand);
mi.position = -500050000;
mi.icolibItem = GetIconHandle(IDI_MSNBLOCK);
- mi.pszName = LPGEN("&Block");
+ mi.name.a = LPGEN("&Block");
hBlockMenuItem = Menu_AddContactMenuItem(&mi);
mir_strcpy(tDest, MSN_VIEW_PROFILE);
hViewProfile = CreateServiceFunction(servicefunction, MsnMenuViewProfile);
mi.position = -500050003;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("View &Profile");
+ mi.name.a = LPGEN("View &Profile");
hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
#ifdef OBSOLETE
@@ -426,7 +426,7 @@ void MSN_InitContactMenu(void) mi.flags = CMIF_NOTOFFLINE;
mi.position = -500050002;
mi.icolibItem = GetIconHandle(IDI_NETMEETING);
- mi.pszName = LPGEN("&Start Netmeeting");
+ mi.name.a = LPGEN("&Start Netmeeting");
hNetmeetingMenuItem = Menu_AddContactMenuItem(&mi);
#endif
@@ -435,7 +435,7 @@ void MSN_InitContactMenu(void) mi.position = -2000010005;
mi.flags = CMIF_HIDDEN;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_SENDEMAIL);
- mi.pszName = LPGEN("Open &Hotmail Inbox");
+ mi.name.a = LPGEN("Open &Hotmail Inbox");
hOpenInboxMenuItem = Menu_AddContactMenuItem(&mi);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MSN_OnPrebuildContactMenu);
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 697a829421..3ac009dc6e 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -508,21 +508,16 @@ void CSametimeProto::InitConferenceMenu() CreateProtoService(MS_SAMETIME_MENULEAVECHAT, &CSametimeProto::onMenuLeaveChat);
CreateProtoService(MS_SAMETIME_MENUCREATECHAT, &CSametimeProto::onMenuCreateChat);
- char service[128];
-
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
- mi.pszContactOwner = m_szModuleName;
- mi.ptszName = LPGENT("Leave conference");
- mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENULEAVECHAT);
- mi.pszService = service;
+ mi.name.t = LPGENT("Leave conference");
+ mi.pszService = MS_SAMETIME_MENULEAVECHAT;
mi.icolibItem = GetIconHandle(IDI_ICON_LEAVE);
- hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi);
+ hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mi.ptszName = LPGENT("Start conference");
- mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUCREATECHAT);
- mi.pszService = service;
+ mi.name.t = LPGENT("Start conference");
+ mi.pszService = MS_SAMETIME_MENUCREATECHAT;
mi.icolibItem = GetIconHandle(IDI_ICON_INVITE);
hCreateChatMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 9994db0920..96826d75d9 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -560,15 +560,11 @@ void CSametimeProto::InitSessionMenu() CreateProtoService(MS_SAMETIME_MENUANNOUNCESESSION, &CSametimeProto::SessionAnnounce);
- char service[128];
-
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
mi.position = 2000060000;
- mi.ptszName = LPGENT("Send announcement...");
- mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUANNOUNCESESSION);
- mi.pszService = service;
+ mi.name.t = LPGENT("Send announcement...");
+ mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION;
mi.icolibItem = GetIconHandle(IDI_ICON_ANNOUNCE);
- mi.pszContactOwner = m_szModuleName;
- Menu_AddContactMenuItem(&mi);
+ Menu_AddContactMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp index 0d072a76b3..d3b5f9b130 100644 --- a/protocols/SkypeWeb/src/skype_menus.cpp +++ b/protocols/SkypeWeb/src/skype_menus.cpp @@ -65,7 +65,7 @@ void CSkypeProto::InitMenus() // Request authorization
mi.pszService = MODULE"/RequestAuth";
- mi.ptszName = LPGENT("Request authorization");
+ mi.name.t = LPGENT("Request authorization");
mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
mi.icolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
ContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -73,28 +73,28 @@ void CSkypeProto::InitMenus() // Grant authorization
mi.pszService = MODULE"/GrantAuth";
- mi.ptszName = LPGENT("Grant authorization");
+ mi.name.t = LPGENT("Grant authorization");
mi.position = CMI_POSITION + CMI_AUTH_GRANT;
mi.icolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
ContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::OnGrantAuth>);
mi.pszService = MODULE"/GetHistory";
- mi.ptszName = LPGENT("Get server history");
+ mi.name.t = LPGENT("Get server history");
mi.position = CMI_POSITION + CMI_GETSERVERHISTORY;
mi.icolibItem = GetIconHandle("synchistory");
ContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GetContactHistory>);
mi.pszService = MODULE"/BlockContact";
- mi.ptszName = LPGENT("Block contact");
+ mi.name.t = LPGENT("Block contact");
mi.position = CMI_POSITION + CMI_BLOCK;
mi.icolibItem = GetIconHandle("user_block");
ContactMenuItems[CMI_BLOCK] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::BlockContact>);
mi.pszService = MODULE"/UnblockContact";
- mi.ptszName = LPGENT("Unblock contact");
+ mi.name.t = LPGENT("Unblock contact");
mi.position = CMI_POSITION + CMI_UNBLOCK;
mi.icolibItem = GetIconHandle("user_unblock");
ContactMenuItems[CMI_UNBLOCK] = Menu_AddContactMenuItem(&mi);
@@ -118,7 +118,7 @@ int CSkypeProto::OnInitStatusMenu() HGENMENU hStatusMunuRoot = Menu_GetProtocolRoot(m_szModuleName);
if (!hStatusMunuRoot)
{
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = -1999901006;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = Skin_GetIconHandle("main");
@@ -137,7 +137,7 @@ int CSkypeProto::OnInitStatusMenu() mir_strcpy(tDest, "/CreateNewChat");
CreateProtoService(tDest, &CSkypeProto::SvcCreateChat);
- mi.ptszName = LPGENT("Create new chat");
+ mi.name.t = LPGENT("Create new chat");
mi.position = SMI_POSITION + SMI_CREATECHAT;
mi.icolibItem = GetIconHandle("conference");
Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index cf0dbf3917..13fbb9fddd 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -105,7 +105,7 @@ void CSteamProto::OnInitStatusMenu() HGENMENU hSteamRoot = Menu_GetProtocolRoot(m_szModuleName);
if (!hSteamRoot) {
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = -1999901006;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
hSteamRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
@@ -121,7 +121,7 @@ void CSteamProto::OnInitStatusMenu() // Show block list
mir_strcpy(tDest, "/BlockList");
CreateProtoService(tDest, &CSteamProto::OpenBlockListCommand);
- mi.ptszName = LPGENT("Blocked contacts");
+ mi.name.t = LPGENT("Blocked contacts");
mi.position = 200000 + SMI_BLOCKED_LIST;
//mi.icolibItem = NULL;
Menu_AddProtoMenuItem(&mi);
@@ -138,7 +138,7 @@ void CSteamProto::InitMenus() // "Request authorization"
mi.pszService = MODULE "/AuthRequest";
- mi.ptszName = LPGENT("Request authorization");
+ mi.name.t = LPGENT("Request authorization");
mi.position = -201001000 + CMI_AUTH_REQUEST;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
contactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -146,7 +146,7 @@ void CSteamProto::InitMenus() // "Block"
mi.pszService = MODULE "/Block";
- mi.ptszName = LPGENT("Block");
+ mi.name.t = LPGENT("Block");
mi.position = -201001001 + CMI_BLOCK;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
contactMenuItems[CMI_BLOCK] = Menu_AddContactMenuItem(&mi);
@@ -156,7 +156,7 @@ void CSteamProto::InitMenus() // "Join to game"
mi.pszService = MODULE "/JoinToGame";
- mi.ptszName = LPGENT("Join to game");
+ mi.name.t = LPGENT("Join to game");
mi.position = -200001000 + CMI_JOIN_GAME;
mi.icolibItem = NULL;
contactMenuItems[CMI_JOIN_GAME] = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index d7334edd89..660967c6c3 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -265,7 +265,6 @@ void TlenProtocol::initMenuItems() char *pSvcName = text + mir_strlen(text);
CLISTMENUITEM mi = { 0 };
- mi.pszContactOwner = m_szModuleName;
mi.hParentMenu = hMenuRoot = Menu_CreateRoot(MO_MAIN, m_tszUserName, -1999901009, GetIconHandle(IDI_TLEN));
mi.pszService = text;
@@ -274,7 +273,7 @@ void TlenProtocol::initMenuItems() // "Multi-User Conference"
mir_strcpy(pSvcName, "/MainMenuMUC");
CreateProtoService(pSvcName, &TlenProtocol::MUCMenuHandleMUC);
- mi.pszName = LPGEN("Multi-User Conference");
+ mi.name.a = LPGEN("Multi-User Conference");
mi.position = 2000050002;
mi.icolibItem = GetIconHandle(IDI_MUC);
mi.pszService = text;
@@ -282,7 +281,7 @@ void TlenProtocol::initMenuItems() mir_strcpy(pSvcName, "/MainMenuInbox");
CreateProtoService(pSvcName, &TlenProtocol::MenuHandleInbox);
- mi.pszName = LPGEN("Tlen Mail");
+ mi.name.a = LPGEN("Tlen Mail");
mi.position = 2000050003;
mi.icolibItem = GetIconHandle(IDI_MAIL);
mi.pszService = text;
@@ -291,44 +290,44 @@ void TlenProtocol::initMenuItems() mi.hParentMenu = NULL;
// "Send picture"
- mir_strcpy(pSvcName, "/SendPicture");
+ mi.pszService = "/SendPicture";
CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleSendPicture);
- mi.pszName = LPGEN("Send picture");
+ mi.name.a = LPGEN("Send picture");
mi.position = -2000019030;
mi.icolibItem = GetIconHandle(IDI_IMAGE);
- hMenuPicture = Menu_AddContactMenuItem(&mi);
+ hMenuPicture = Menu_AddContactMenuItem(&mi, m_szModuleName);
// "Invite to MUC"
- mir_strcpy(pSvcName, "/ContactMenuMUC");
+ mi.pszService = "/ContactMenuMUC";
CreateProtoService(pSvcName, &TlenProtocol::MUCContactMenuHandleMUC);
- mi.pszName = LPGEN("Multi-User Conference");
+ mi.name.a = LPGEN("Multi-User Conference");
mi.position = -2000019020;
mi.icolibItem = GetIconHandle(IDI_MUC);
- hMenuContactMUC = Menu_AddContactMenuItem(&mi);
+ hMenuContactMUC = Menu_AddContactMenuItem(&mi, m_szModuleName);
// "Invite to voice chat"
- mir_strcpy(pSvcName, "/ContactMenuVoice");
+ mi.pszService = "/ContactMenuVoice";
CreateProtoService(pSvcName, &TlenProtocol::VoiceContactMenuHandleVoice);
- mi.pszName = LPGEN("Voice Chat");
+ mi.name.a = LPGEN("Voice Chat");
mi.position = -2000019010;
mi.icolibItem = GetIconHandle(IDI_VOICE);
- hMenuContactVoice = Menu_AddContactMenuItem(&mi);
+ hMenuContactVoice = Menu_AddContactMenuItem(&mi, m_szModuleName);
// "Request authorization"
- mir_strcpy(pSvcName, "/RequestAuth");
+ mi.pszService = "/RequestAuth";
CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleRequestAuth);
- mi.pszName = LPGEN("Request authorization");
+ mi.name.a = LPGEN("Request authorization");
mi.position = -2000001001;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
- hMenuContactRequestAuth = Menu_AddContactMenuItem(&mi);
+ hMenuContactRequestAuth = Menu_AddContactMenuItem(&mi, m_szModuleName);
// "Grant authorization"
- mir_strcpy(pSvcName, "/GrantAuth");
+ mi.pszService = "/GrantAuth";
CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleGrantAuth);
- mi.pszName = LPGEN("Grant authorization");
+ mi.name.a = LPGEN("Grant authorization");
mi.position = -2000001000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
- hMenuContactGrantAuth = Menu_AddContactMenuItem(&mi);
+ hMenuContactGrantAuth = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
TlenProtocol* tlenProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index 6aab96385e..b023a668ba 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -46,7 +46,7 @@ void CToxProto::InitMenus() // Request authorization
mi.pszService = MODULE"/RequestAuth";
- mi.ptszName = LPGENT("Request authorization");
+ mi.name.t = LPGENT("Request authorization");
mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
mi.icolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
ContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -54,7 +54,7 @@ void CToxProto::InitMenus() // Grant authorization
mi.pszService = MODULE"/GrantAuth";
- mi.ptszName = LPGENT("Grant authorization");
+ mi.name.t = LPGENT("Grant authorization");
mi.position = CMI_POSITION + CMI_AUTH_GRANT;
mi.icolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
ContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
@@ -62,7 +62,7 @@ void CToxProto::InitMenus() // Start audio call
mi.pszService = MODULE"/Audio/Call";
- mi.ptszName = LPGENT("Call");
+ mi.name.t = LPGENT("Call");
mi.position = -2000020000 + CMI_AUDIO_CALL;
mi.icolibItem = GetIconHandle("audio_start");
ContactMenuItems[CMI_AUDIO_CALL] = Menu_AddContactMenuItem(&mi);
@@ -86,7 +86,7 @@ int CToxProto::OnInitStatusMenu() HGENMENU hStatusMunuRoot = Menu_GetProtocolRoot(m_szModuleName);
if (!hStatusMunuRoot)
{
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
mi.position = -1999901006;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = Skin_GetIconHandle("main");
@@ -99,7 +99,7 @@ int CToxProto::OnInitStatusMenu() // Create copy tox id command
mir_strcpy(tDest, "/CopyToxID");
CreateProtoService(tDest, &CToxProto::OnCopyToxID);
- mi.ptszName = LPGENT("Copy Tox ID");
+ mi.name.t = LPGENT("Copy Tox ID");
mi.position = SMI_POSITION + SMI_TOXID_COPY;
Menu_AddProtoMenuItem(&mi);
@@ -107,7 +107,7 @@ int CToxProto::OnInitStatusMenu() // Create group chat command
/*mir_strcpy(tDest, "/CreateChatRoom");
CreateProtoService(tDest, &CToxProto::OnCreateChatRoom);
- mi.ptszName = LPGENT("Create group chat");
+ mi.name.t = LPGENT("Create group chat");
mi.position = SMI_POSITION + SMI_GROUPCHAT_CREATE;
mi.icolibItem = Skin_GetIconHandle("conference");
HGENMENU hCreateChatRoom = Menu_AddProtoMenuItem(&mi);*/
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 2dbbf5f1f7..ba5ebc4672 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -272,7 +272,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) // "Send Tweet..."
CreateProtoService("/Tweet", &TwitterProto::OnTweet);
mir_strcpy(tDest, "/Tweet");
- mi.ptszName = LPGENT("Send Tweet...");
+ mi.name.t = LPGENT("Send Tweet...");
mi.position = 200001;
mi.icolibItem = GetIconHandle("tweet");
Menu_AddStatusMenuItem(&mi);
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index 5c97648203..53606e35a5 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -91,14 +91,14 @@ void InitContactMenus() mi.position = -2000006000;
mi.icolibItem = GetIconHandle("reply");
- mi.ptszName = LPGENT("Reply...");
+ mi.name.t = LPGENT("Reply...");
mi.pszService = "Twitter/ReplyToTweet";
g_hMenuEvts[1] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
g_hMenuItems[0] = Menu_AddContactMenuItem(&mi);
mi.position = -2000006000;
mi.icolibItem = GetIconHandle("homepage");
- mi.ptszName = LPGENT("Visit Homepage");
+ mi.name.t = LPGENT("Visit Homepage");
mi.pszService = "Twitter/VisitHomepage";
g_hMenuEvts[2] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::VisitHomepage>);
g_hMenuItems[1] = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 6e52444d8c..c342ba326a 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -202,134 +202,134 @@ void CVkProto::InitMenus() mir_snprintf(szService, "%s%s", m_szModuleName, PS_CREATECHAT);
mi.position = 10009 + PMI_CREATECHAT;
mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN);
- mi.pszName = LPGEN("Create new chat");
+ mi.name.a = LPGEN("Create new chat");
g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_SETSTATUSMSG);
mi.position = 10009 + PMI_SETSTATUSMSG;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_STATUS));
- mi.pszName = LPGEN("Status message");
+ mi.name.a = LPGEN("Status message");
g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST);
mi.position = 10009 + PMI_WALLPOST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
- mi.pszName = LPGEN("Send message to my wall");
+ mi.name.a = LPGEN("Send message to my wall");
g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
mi.position = 10009 + PMI_LOADVKNEWS;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
- mi.pszName = LPGEN("Load news from VK");
+ mi.name.a = LPGEN("Load news from VK");
g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_VISITPROFILE);
mi.position = 10009 + PMI_VISITPROFILE;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
- mi.pszName = LPGEN("Visit profile");
+ mi.name.a = LPGEN("Visit profile");
g_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi);
// Contact Menu Items
mi.hParentMenu = NULL;
- mi.pszContactOwner = m_szModuleName;
mi.flags = CMIF_TCHAR;
+ mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
- mi.ptszName = LPGENT("Visit profile");
- g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Visit profile");
+ g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST);
+ mi.pszService = PS_WALLPOST;
mi.position = -200001000 + CMI_WALLPOST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
- mi.ptszName = LPGENT("Send message to user\'s wall");
- g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Send message to user\'s wall");
+ g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_ADDASFRIEND);
+ mi.pszService = PS_ADDASFRIEND;
mi.position = -200001000 + CMI_ADDASFRIEND;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
- mi.ptszName = LPGENT("Add as friend");
- g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Add as friend");
+ g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_DELETEFRIEND);
+ mi.pszService = PS_DELETEFRIEND;
mi.position = -200001000 + CMI_DELETEFRIEND;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
- mi.ptszName = LPGENT("Delete from friend list");
- g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Delete from friend list");
+ g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_BANUSER);
+ mi.pszService = PS_BANUSER;
mi.position = -200001000 + CMI_BANUSER;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
- mi.ptszName = LPGENT("Ban user");
- g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Ban user");
+ g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_REPORTABUSE);
+ mi.pszService = PS_REPORTABUSE;
mi.position = -200001000 + CMI_REPORTABUSE;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
- mi.ptszName = LPGENT("Report abuse");
- g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Report abuse");
+ g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_DESTROYKICKCHAT);
+ mi.pszService = PS_DESTROYKICKCHAT;
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
- mi.ptszName = LPGENT("Destroy room");
- g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Destroy room");
+ g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_OPENBROADCAST);
+ mi.pszService = PS_OPENBROADCAST;
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
- mi.ptszName = LPGENT("Open broadcast");
- g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Open broadcast");
+ g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
+ mi.pszService = PS_LOADVKNEWS;
mi.position = -200001000 + CMI_LOADVKNEWS;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
- mi.ptszName = LPGENT("Load news from VK");
- g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Load news from VK");
+ g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
// Sync history menu
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORY);
+ mi.pszService = PS_GETSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("Reload messages from vk.com...");
- g_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("Reload messages from vk.com...");
+ g_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.hParentMenu = g_hContactMenuItems[CMI_GETSERVERHISTORY];
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY);
+ mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for last 1 day");
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for last 1 day");
+ g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY);
+ mi.pszService = PS_GETSERVERHISTORYLAST3DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for last 3 days");
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for last 3 days");
+ g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY);
+ mi.pszService = PS_GETSERVERHISTORYLAST7DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for last week");
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for last week");
+ g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY);
+ mi.pszService = PS_GETSERVERHISTORYLAST30DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for last 30 days");
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for last 30 days");
+ g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY);
+ mi.pszService = PS_GETSERVERHISTORYLAST90DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for last 90 days");
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for last 90 days");
+ g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY);
+ mi.pszService = PS_GETALLSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.ptszName = LPGENT("for all time");
- g_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
+ mi.name.t = LPGENT("for all time");
+ g_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index d802870dad..4595692cc7 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -59,7 +59,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam) mi.position = 500085000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (isOnline() ? 0 : CMIF_GRAYED);
mi.icolibItem = GetIconHandle("whatsApp");
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
@@ -75,7 +75,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam) CreateProtoService("/CreateGroup", &WhatsAppProto::OnCreateGroup);
mir_strcpy(tDest, "/CreateGroup");
mi.hParentMenu = hRoot;
- mi.pszName = LPGEN("Create group");
+ mi.name.a = LPGEN("Create group");
mi.icolibItem = GetIconHandle("createGroup");
m_hMenuCreateGroup = Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 8abedcb60c..6bc8091fd7 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -438,7 +438,6 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid) CLISTMENUITEM mi = { 0 };
mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENW("Start game"), 500084000);
- mi.pszContactOwner = protocolname;
mir_snprintf(temp, _countof(temp), servicefunction, this->id);
//wenn die servicefunktion schon exisitert vernichten, hehe
@@ -447,8 +446,8 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid) CreateServiceFunctionParam(temp, StartGame, this->id);
mi.pszService = temp;
mi.position = 500090002 + pos;
- mi.hIcon = this->hicon ? this->hicon : LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.pszName = menuitemtext(this->name);
+ mi.icolibItem = this->hicon ? this->hicon : LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.a = menuitemtext(this->name);
this->menuhandle = Menu_AddMainMenuItem(&mi);
//menu aktualisieren ob hidden
diff --git a/protocols/Xfire/src/Xfire_gamelist.cpp b/protocols/Xfire/src/Xfire_gamelist.cpp index 344289044a..f62989fec3 100644 --- a/protocols/Xfire/src/Xfire_gamelist.cpp +++ b/protocols/Xfire/src/Xfire_gamelist.cpp @@ -244,9 +244,8 @@ void Xfire_gamelist::createDummyMenuItem() CLISTMENUITEM mi = { 0 };
mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENW("Start game"), 500084000);
mi.position = 500090001;
- mi.pszName = Translate("Please wait...");
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.pszContactOwner = protocolname;
+ mi.name.a = Translate("Please wait...");
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
dummymenuitem = Menu_AddMainMenuItem(&mi);
}
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index ab06f85b5c..6c4c93412f 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1120,104 +1120,95 @@ extern "C" __declspec(dllexport) int Load(void) char servicefunction[100];
// gotoprofilemenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "GotoProfile");
- CreateServiceFunction(servicefunction, GotoProfile);
- mi.pszService = servicefunction;
+ CreateProtoServiceFunction(protocolname, "/GotoProfile", GotoProfile);
+ mi.pszService = "/GotoProfile";
mi.position = 500090000;
- mi.pszContactOwner = protocolname;
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("&XFire Online Profile");
- Menu_AddContactMenuItem(&mi);
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("&XFire Online Profile");
+ Menu_AddContactMenuItem(&mi, protocolname);
// gotoxfireclansitemenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "GotoXFireClanSite");
- CreateServiceFunction(servicefunction, GotoXFireClanSite);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("XFire &Clan Site");
- gotoclansite = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/GotoXFireClanSite", GotoXFireClanSite);
+ mi.pszService = "/GotoXFireClanSite";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("XFire &Clan Site");
+ gotoclansite = Menu_AddContactMenuItem(&mi, protocolname);
// kopiermenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "GetIPPort");
- CreateServiceFunction(servicefunction, GetIPPort);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("C&opy Server Address and Port");
- copyipport = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/GetIPPort", GetIPPort);
+ mi.pszService = "/GetIPPort";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("C&opy Server Address and Port");
+ copyipport = Menu_AddContactMenuItem(&mi, protocolname);
// kopiermenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "VoiceIPPort");
- CreateServiceFunction(servicefunction, GetVIPPort);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Cop&y Voice Server Address and Port");
- vipport = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/VoiceIPPort", GetVIPPort);
+ mi.pszService = "/VoiceIPPort";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Cop&y Voice Server Address and Port");
+ vipport = Menu_AddContactMenuItem(&mi, protocolname);
// joinmenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "JoinGame");
- CreateServiceFunction(servicefunction, JoinGame);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Join &Game...");
- joingame = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/JoinGame", JoinGame);
+ mi.pszService = "/JoinGame";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Join &Game...");
+ joingame = Menu_AddContactMenuItem(&mi, protocolname);
// playmenüpunkt
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "StartThisGame");
- CreateServiceFunction(servicefunction, StartThisGame);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Play this game...");
- startthisgame = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/StartThisGame", StartThisGame);
+ mi.pszService = "/StartThisGame";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Play this game...");
+ startthisgame = Menu_AddContactMenuItem(&mi, protocolname);
// remove friend
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "RemoveFriend");
- CreateServiceFunction(servicefunction, RemoveFriend);
+ CreateProtoServiceFunction(protocolname, "/RemoveFriend", RemoveFriend);
+ mi.pszService = "/RemoveFriend";
mi.position = 2000070000;
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Remove F&riend...");
- removefriend = Menu_AddContactMenuItem(&mi);
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Remove F&riend...");
+ removefriend = Menu_AddContactMenuItem(&mi, protocolname);
// block user
- mir_strcpy(servicefunction, protocolname);
- mir_strcat(servicefunction, "BlockFriend");
- CreateServiceFunction(servicefunction, BlockFriend);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Block U&ser...");
- blockfriend = Menu_AddContactMenuItem(&mi);
+ CreateProtoServiceFunction(protocolname, "/BlockFriend", BlockFriend);
+ mi.pszService = "/BlockFriend";
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Block U&ser...");
+ blockfriend = Menu_AddContactMenuItem(&mi, protocolname);
+ // main menu items
// my fire profile
mi.hParentMenu = Menu_CreateRoot(MO_MAIN, _T(protocolname), 500090000);
mir_strcpy(servicefunction, protocolname);
mir_strcat(servicefunction, "GotoProfile2");
CreateServiceFunction(servicefunction, GotoProfile2);
mi.position = 500090000;
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("&My XFire Online Profile");
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("&My XFire Online Profile");
Menu_AddMainMenuItem(&mi);
// my activity protocol
mir_strcpy(servicefunction, protocolname);
mir_strcat(servicefunction, "GotoProfileAct");
CreateServiceFunction(servicefunction, GotoProfileAct);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("&Activity Report");
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("&Activity Report");
Menu_AddMainMenuItem(&mi);
//rescan my games
mir_strcpy(servicefunction, protocolname);
mir_strcat(servicefunction, "ReScanMyGames");
CreateServiceFunction(servicefunction, ReScanMyGames);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("&Rescan my games...");
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("&Rescan my games...");
Menu_AddMainMenuItem(&mi);
mir_strcpy(servicefunction, protocolname);
mir_strcat(servicefunction, "SetNick");
CreateServiceFunction(servicefunction, SetNickDlg);
- mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.ptszName = LPGENT("Set &Nickname");
+ mi.icolibItem = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
+ mi.name.t = LPGENT("Set &Nickname");
Menu_AddMainMenuItem(&mi);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, RebuildContactMenu);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index a66b451843..f9ea13afd1 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -370,7 +370,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 500015000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_YAHOO);
- mi.ptszName = m_tszUserName;
+ mi.name.t = m_tszUserName;
hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
@@ -389,7 +389,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 290000;
mi.icolibItem = GetIconHandle(IDI_SET_STATUS);
- mi.pszName = LPGEN("Set &Custom Status");
+ mi.name.a = LPGEN("Set &Custom Status");
menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
@@ -399,7 +399,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 290005;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("&Edit My Profile");
+ mi.name.a = LPGEN("&Edit My Profile");
menuItemsAll[1] = Menu_AddProtoMenuItem(&mi);
// Show My profile
@@ -408,7 +408,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 290006;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("&My Profile");
+ mi.name.a = LPGEN("&My Profile");
menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
// Show Yahoo mail
@@ -417,7 +417,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 290010;
mi.icolibItem = GetIconHandle(IDI_INBOX);
- mi.pszName = LPGEN("&Yahoo Mail");
+ mi.name.a = LPGEN("&Yahoo Mail");
menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
// Show Address Book
@@ -426,7 +426,7 @@ void CYahooProto::MenuMainInit(void) mi.position = 290015;
mi.icolibItem = GetIconHandle(IDI_YAB);
- mi.pszName = LPGEN("&Address Book");
+ mi.name.a = LPGEN("&Address Book");
menuItemsAll[4] = Menu_AddProtoMenuItem(&mi);
// Show Calendar
@@ -435,36 +435,29 @@ void CYahooProto::MenuMainInit(void) mi.position = 290017;
mi.icolibItem = GetIconHandle(IDI_CALENDAR);
- mi.pszName = LPGEN("&Calendar");
+ mi.name.a = LPGEN("&Calendar");
menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
mir_strcpy(tDest, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CYahooProto::CreateConference);
mi.position = 290018;
mi.icolibItem = GetIconHandle(IDI_YAHOO);
- mi.pszName = LPGEN("Create Conference");
+ mi.name.a = LPGEN("Create Conference");
menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
}
void CYahooProto::MenuContactInit(void)
{
- char servicefunction[100];
- mir_strcpy(servicefunction, m_szModuleName);
- char* tDest = servicefunction + mir_strlen(servicefunction);
-
CLISTMENUITEM mi = { 0 };
- mi.pszService = servicefunction;
- mi.pszContactOwner = m_szModuleName;
// Show Profile
- mir_strcpy(tDest, YAHOO_SHOW_PROFILE);
CreateProtoService(YAHOO_SHOW_PROFILE, &CYahooProto::OnShowProfileCommand);
+ mi.pszService = YAHOO_SHOW_PROFILE;
mi.position = -2000006000;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
- mi.pszName = LPGEN("&Show Profile");
- hShowProfileMenuItem = Menu_AddContactMenuItem(&mi);
-
+ mi.name.a = LPGEN("&Show Profile");
+ hShowProfileMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
void CYahooProto::MenuUninit(void)
|