From ca2afc50a432cefe892c6877710642bce6bd57c9 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 28 Jun 2015 16:50:17 +0000 Subject: Minor cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@14429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/main.cpp | 4 +-- plugins/NotesAndReminders/src/main.cpp | 2 +- plugins/SecureIM/src/language.cpp | 32 ++++++++++++----------- plugins/SecureIM/src/language.h | 20 +++++++------- plugins/SecureIM/src/main.cpp | 48 +++++++++++++++++----------------- plugins/SecureIM/src/svcs_clist.cpp | 4 +-- 6 files changed, 57 insertions(+), 53 deletions(-) (limited to 'plugins') diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 0363d91c42..87724d69ab 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -656,12 +656,12 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) dwLocalPortUsed = nlb.wPort; dwLocalIpAddress = nlb.dwInternalIP; - Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENT("Disable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DISABLE_SERVER))); + Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Disable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DISABLE_SERVER))); } else if (hDirectBoundPort && wparam == 0) { Netlib_CloseHandle(hDirectBoundPort); hDirectBoundPort = 0; - Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENT("Enable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE))); + Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Enable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE))); } else return 0; // no changes; diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index f83edada99..84fa4fed13 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -195,7 +195,7 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam) // register menus CLISTMENUITEM mi = { 0 }; - mi.hParentMenu = Menu_CreateRoot(MO_MAIN, (TCHAR*)LPGENW("Notes && Reminders"), 1600000000); + mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENW("Notes && Reminders"), 1600000000); mi.flags = CMIF_TCHAR; mi.position = 1600000000; diff --git a/plugins/SecureIM/src/language.cpp b/plugins/SecureIM/src/language.cpp index 0221b528fd..09cea10156 100644 --- a/plugins/SecureIM/src/language.cpp +++ b/plugins/SecureIM/src/language.cpp @@ -61,26 +61,28 @@ LPCSTR sim228 = "ANSI"; LPCSTR sim229 = "UTF8"; LPCSTR sim230 = LPGEN("Mode"); LPCSTR sim231[] = { LPGEN("Native"), "PGP", "GPG", "RSA/AES", "RSA" }; +LPCWSTR sim231W[] = { LPGENW("Native"), L"PGP", L"GPG", L"RSA/AES", L"RSA" }; LPCSTR sim232[] = { LPGEN("Disabled"), LPGEN("Enabled"), LPGEN("Always try") }; +LPCWSTR sim232W[] = { LPGENW("Disabled"), LPGENW("Enabled"), LPGENW("Always try") }; LPCSTR sim233 = "PUB"; LPCSTR sim234 = "SHA1"; //Context Menu -LPCSTR sim301 = LPGEN("Create SecureIM connection"); -LPCSTR sim302 = LPGEN("Disable SecureIM connection"); -LPCSTR sim306 = LPGEN("Load PGP Key"); -LPCSTR sim307 = LPGEN("Unload PGP Key"); -LPCSTR sim308 = LPGEN("Load GPG Key"); -LPCSTR sim309 = LPGEN("Unload GPG Key"); -LPCSTR sim310 = LPGEN("Delete RSA Key"); -LPCSTR sim311[] = { LPGEN("SecureIM mode (Native)"), - LPGEN("SecureIM mode (PGP)"), - LPGEN("SecureIM mode (GPG)"), - LPGEN("SecureIM mode (RSA/AES)"), - LPGEN("SecureIM mode (RSA)") }; -LPCSTR sim312[] = { LPGEN("SecureIM status (disabled)"), - LPGEN("SecureIM status (enabled)"), - LPGEN("SecureIM status (always try)") }; +LPCWSTR sim301 = LPGENW("Create SecureIM connection"); +LPCWSTR sim302 = LPGENW("Disable SecureIM connection"); +LPCWSTR sim306 = LPGENW("Load PGP Key"); +LPCWSTR sim307 = LPGENW("Unload PGP Key"); +LPCWSTR sim308 = LPGENW("Load GPG Key"); +LPCWSTR sim309 = LPGENW("Unload GPG Key"); +LPCWSTR sim310 = LPGENW("Delete RSA Key"); +LPCWSTR sim311[] = { LPGENW("SecureIM mode (Native)"), + LPGENW("SecureIM mode (PGP)"), + LPGENW("SecureIM mode (GPG)"), + LPGENW("SecureIM mode (RSA/AES)"), + LPGENW("SecureIM mode (RSA)") }; +LPCWSTR sim312[] = { LPGENW("SecureIM status (disabled)"), + LPGENW("SecureIM status (enabled)"), + LPGENW("SecureIM status (always try)") }; //System messages LPCSTR sim401 = LPGEN("SecureIM: Sorry, unable to decrypt this message because you have no PGP/GPG installed. Visit www.pgp.com or www.gnupg.org for more info."); diff --git a/plugins/SecureIM/src/language.h b/plugins/SecureIM/src/language.h index d3937d0418..6ff5adb793 100644 --- a/plugins/SecureIM/src/language.h +++ b/plugins/SecureIM/src/language.h @@ -62,20 +62,22 @@ extern LPCSTR sim228; extern LPCSTR sim229; extern LPCSTR sim230; extern LPCSTR sim231[]; +extern LPCWSTR sim231W[]; extern LPCSTR sim232[]; +extern LPCWSTR sim232W[]; extern LPCSTR sim233; extern LPCSTR sim234; //Context Menu -extern LPCSTR sim301; -extern LPCSTR sim302; -extern LPCSTR sim306; -extern LPCSTR sim307; -extern LPCSTR sim308; -extern LPCSTR sim309; -extern LPCSTR sim310; -extern LPCSTR sim311[]; -extern LPCSTR sim312[]; +extern LPCWSTR sim301; +extern LPCWSTR sim302; +extern LPCWSTR sim306; +extern LPCWSTR sim307; +extern LPCWSTR sim308; +extern LPCWSTR sim309; +extern LPCWSTR sim310; +extern LPCWSTR sim311[]; +extern LPCWSTR sim312[]; //System messages extern LPCSTR sim401; diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index b3515a2d38..6d7882de14 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -36,7 +36,7 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) ///////////////////////////////////////////////////////////////////////////////////////// // basic events: onModuleLoad, onModulesLoad, onShutdown -static HGENMENU AddMenuItem(LPCSTR name, int pos, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0) +static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0) { CLISTMENUITEM mi = { 0 }; mi.flags = flags | CMIF_HIDDEN; @@ -47,7 +47,7 @@ static HGENMENU AddMenuItem(LPCSTR name, int pos, HICON hicon, LPCSTR service, i return Menu_AddContactMenuItem(&mi); } -static HGENMENU AddSubItem(HGENMENU hRoot, LPCSTR name, int pos, int poppos, LPCSTR service, WPARAM wParam = 0) +static HGENMENU MyAddSubItem(HGENMENU hRoot, LPCSTR name, int pos, int poppos, LPCSTR service, WPARAM wParam = 0) { CLISTMENUITEM mi = { 0 }; mi.flags = CMIF_HIDDEN; @@ -230,45 +230,45 @@ static int onModulesLoaded(WPARAM, LPARAM) CreateProtoServiceFunction(MODULENAME, PSS_MESSAGE, onSendMsg); // create a menu item for creating a secure im connection to the user. - g_hMenu[0] = AddMenuItem(sim301, 110000, g_hICO[ICO_CM_EST], MODULENAME"/SIM_EST", CMIF_NOTOFFLINE); - g_hMenu[1] = AddMenuItem(sim302, 110001, g_hICO[ICO_CM_DIS], MODULENAME"/SIM_DIS", CMIF_NOTOFFLINE); + g_hMenu[0] = MyAddMenuItem(sim301, 110000, g_hICO[ICO_CM_EST], MODULENAME"/SIM_EST", CMIF_NOTOFFLINE); + g_hMenu[1] = MyAddMenuItem(sim302, 110001, g_hICO[ICO_CM_DIS], MODULENAME"/SIM_DIS", CMIF_NOTOFFLINE); if (ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) { - g_hMenu[2] = AddMenuItem(sim312[0], 110002, NULL, NULL); - g_hMenu[3] = AddSubItem(g_hMenu[2], sim232[0], 110003, 110002, MODULENAME"/SIM_ST_DIS"); - g_hMenu[4] = AddSubItem(g_hMenu[2], sim232[1], 110004, 110002, MODULENAME"/SIM_ST_ENA"); - g_hMenu[5] = AddSubItem(g_hMenu[2], sim232[2], 110005, 110002, MODULENAME"/SIM_ST_TRY"); + g_hMenu[2] = MyAddMenuItem(sim312[0], 110002, NULL, NULL); + g_hMenu[3] = MyAddSubItem(g_hMenu[2], sim232[0], 110003, 110002, MODULENAME"/SIM_ST_DIS"); + g_hMenu[4] = MyAddSubItem(g_hMenu[2], sim232[1], 110004, 110002, MODULENAME"/SIM_ST_ENA"); + g_hMenu[5] = MyAddSubItem(g_hMenu[2], sim232[2], 110005, 110002, MODULENAME"/SIM_ST_TRY"); } else { g_hMenu[2] = 0; - g_hMenu[3] = AddMenuItem(sim232[0], 110003, NULL, MODULENAME"/SIM_ST_DIS"); - g_hMenu[4] = AddMenuItem(sim232[1], 110004, NULL, MODULENAME"/SIM_ST_ENA"); - g_hMenu[5] = AddMenuItem(sim232[2], 110005, NULL, MODULENAME"/SIM_ST_TRY"); + g_hMenu[3] = MyAddMenuItem(sim232W[0], 110003, NULL, MODULENAME"/SIM_ST_DIS"); + g_hMenu[4] = MyAddMenuItem(sim232W[1], 110004, NULL, MODULENAME"/SIM_ST_ENA"); + g_hMenu[5] = MyAddMenuItem(sim232W[2], 110005, NULL, MODULENAME"/SIM_ST_TRY"); } if (bPGPloaded) { - g_hMenu[6] = AddMenuItem(sim306, 110006, mode2icon(MODE_PGP | SECURED, 2), MODULENAME"/PGP_SET", 0); - g_hMenu[7] = AddMenuItem(sim307, 110007, mode2icon(MODE_PGP, 2), MODULENAME"/PGP_DEL", 0); + g_hMenu[6] = MyAddMenuItem(sim306, 110006, mode2icon(MODE_PGP | SECURED, 2), MODULENAME"/PGP_SET", 0); + g_hMenu[7] = MyAddMenuItem(sim307, 110007, mode2icon(MODE_PGP, 2), MODULENAME"/PGP_DEL", 0); } if (bGPGloaded) { - g_hMenu[8] = AddMenuItem(sim308, 110008, mode2icon(MODE_GPG | SECURED, 2), MODULENAME"/GPG_SET", 0); - g_hMenu[9] = AddMenuItem(sim309, 110009, mode2icon(MODE_GPG, 2), MODULENAME"/GPG_DEL", 0); + g_hMenu[8] = MyAddMenuItem(sim308, 110008, mode2icon(MODE_GPG | SECURED, 2), MODULENAME"/GPG_SET", 0); + g_hMenu[9] = MyAddMenuItem(sim309, 110009, mode2icon(MODE_GPG, 2), MODULENAME"/GPG_DEL", 0); } if (ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) { - g_hMenu[10] = AddMenuItem(sim311[0], 110010, NULL, NULL); - g_hMenu[11] = AddSubItem(g_hMenu[10], sim231[0], 110011, 110010, MODULENAME"/MODE_NAT"); - g_hMenu[12] = AddSubItem(g_hMenu[10], sim231[1], 110012, 110010, MODULENAME"/MODE_PGP"); - g_hMenu[13] = AddSubItem(g_hMenu[10], sim231[2], 110013, 110010, MODULENAME"/MODE_GPG"); - g_hMenu[14] = AddSubItem(g_hMenu[10], sim231[3], 110014, 110010, MODULENAME"/MODE_RSA"); + g_hMenu[10] = MyAddMenuItem(sim311[0], 110010, NULL, NULL); + g_hMenu[11] = MyAddSubItem(g_hMenu[10], sim231[0], 110011, 110010, MODULENAME"/MODE_NAT"); + g_hMenu[12] = MyAddSubItem(g_hMenu[10], sim231[1], 110012, 110010, MODULENAME"/MODE_PGP"); + g_hMenu[13] = MyAddSubItem(g_hMenu[10], sim231[2], 110013, 110010, MODULENAME"/MODE_GPG"); + g_hMenu[14] = MyAddSubItem(g_hMenu[10], sim231[3], 110014, 110010, MODULENAME"/MODE_RSA"); } else { g_hMenu[10] = 0; - g_hMenu[11] = AddMenuItem(sim231[0], 110011, NULL, MODULENAME"/MODE_NAT"); - g_hMenu[12] = AddMenuItem(sim231[1], 110012, NULL, MODULENAME"/MODE_PGP"); - g_hMenu[13] = AddMenuItem(sim231[2], 110013, NULL, MODULENAME"/MODE_GPG"); - g_hMenu[14] = AddMenuItem(sim231[3], 110014, NULL, MODULENAME"/MODE_RSA"); + g_hMenu[11] = MyAddMenuItem(sim231W[0], 110011, NULL, MODULENAME"/MODE_NAT"); + g_hMenu[12] = MyAddMenuItem(sim231W[1], 110012, NULL, MODULENAME"/MODE_PGP"); + g_hMenu[13] = MyAddMenuItem(sim231W[2], 110013, NULL, MODULENAME"/MODE_GPG"); + g_hMenu[14] = MyAddMenuItem(sim231W[3], 110014, NULL, MODULENAME"/MODE_RSA"); } InitSRMMIcons(); diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp index 7a7a60c2b4..5d1a565565 100644 --- a/plugins/SecureIM/src/svcs_clist.cpp +++ b/plugins/SecureIM/src/svcs_clist.cpp @@ -102,7 +102,7 @@ int __cdecl onRebuildContactMenu(WPARAM hContact, LPARAM lParam) // set status menu if (bSCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) { - Menu_ModifyItem(g_hMenu[2], _A2T(sim312[ptr->status]), g_hICO[ICO_ST_DIS + ptr->status]); + Menu_ModifyItem(g_hMenu[2], sim312[ptr->status], g_hICO[ICO_ST_DIS + ptr->status]); for (int i = 0; i <= (ptr->mode == MODE_RSAAES ? 1 : 2); i++) Menu_ModifyItem(g_hMenu[3 + i], NULL, (i == ptr->status) ? g_hICO[ICO_ST_DIS + ptr->status] : NULL); @@ -121,7 +121,7 @@ int __cdecl onRebuildContactMenu(WPARAM hContact, LPARAM lParam) if (isSecureProto && !isChat && isMiranda) { // set mode menu if (bMCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) { - Menu_ModifyItem(g_hMenu[10], _A2T(sim311[ptr->mode]), g_hICO[ICO_OV_NAT + ptr->mode]); + Menu_ModifyItem(g_hMenu[10], sim311[ptr->mode], g_hICO[ICO_OV_NAT + ptr->mode]); for (int i = 0; i < MODE_CNT; i++) { if (i == MODE_PGP && ptr->mode != MODE_PGP && !bPGP) continue; -- cgit v1.2.3