From 23e8be15f5c5e0dc5c064253e3fa6bc4dbd2c506 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 21 Aug 2012 15:26:14 +0000 Subject: unicode config for Rate plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@1515 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Rate/rate_10.vcxproj | 8 +++--- plugins/Rate/src/commonheaders.h | 14 +++-------- plugins/Rate/src/main.cpp | 10 ++++---- plugins/Rate/src/options.cpp | 54 ++++++++++++++++++++-------------------- 4 files changed, 40 insertions(+), 46 deletions(-) (limited to 'plugins/Rate') diff --git a/plugins/Rate/rate_10.vcxproj b/plugins/Rate/rate_10.vcxproj index 8d70796c49..3308db2b17 100644 --- a/plugins/Rate/rate_10.vcxproj +++ b/plugins/Rate/rate_10.vcxproj @@ -25,21 +25,21 @@ DynamicLibrary - MultiByte + Unicode true DynamicLibrary - MultiByte + Unicode true DynamicLibrary - MultiByte + Unicode DynamicLibrary - MultiByte + Unicode diff --git a/plugins/Rate/src/commonheaders.h b/plugins/Rate/src/commonheaders.h index 9fde7034e0..2637e8f42b 100644 --- a/plugins/Rate/src/commonheaders.h +++ b/plugins/Rate/src/commonheaders.h @@ -29,12 +29,6 @@ #define _CRT_SECURE_NO_WARNINGS -//needed by m_utils.h -#include - -// needed by m_icolib.h > r9256 -#include - //Miranda API headers #include #include @@ -61,15 +55,15 @@ static const int DefaultSlot = EXTRA_ICON_PROTO; static struct { - char* szDescr; + TCHAR* szDescr; char* szName; int defIconID; HANDLE hIconLibItem; } iconList[] = { - { LPGEN( "Rate high" ), "rate_high", IDI_RATEHI }, - { LPGEN( "Rate medium" ), "rate_medium", IDI_RATEME }, - { LPGEN( "Rate low" ), "rate_low", IDI_RATELO }, + { LPGENT( "Rate high" ), "rate_high", IDI_RATEHI }, + { LPGENT( "Rate medium" ), "rate_medium", IDI_RATEME }, + { LPGENT( "Rate low" ), "rate_low", IDI_RATELO }, }; diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index 1fce96c918..8fe42060f1 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -171,13 +171,13 @@ static void init_icolib (void) SKINICONDESC sid = {0}; sid.cbSize = sizeof(sid); - sid.pszSection = Translate("Contact Rate"); - sid.pszDefaultFile = szFile; - sid.flags = SIDF_PATH_TCHAR; + sid.ptszSection = LPGENT("Contact Rate"); + sid.ptszDefaultFile = szFile; + sid.flags = SIDF_ALL_TCHAR; for (int i = 0; i < SIZEOF(iconList); i++ ) { sid.pszName = iconList[i].szName; - sid.pszDescription = iconList[i].szDescr; + sid.ptszDescription = iconList[i].szDescr; sid.iDefaultIndex = -iconList[i].defIconID; iconList[i].hIconLibItem = Skin_AddIcon(&sid); } @@ -220,7 +220,7 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam) { DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; - if (wParam != NULL && !lstrcmp(cws->szModule,"CList") && !lstrcmp(cws->szSetting,"Rate")) + if (wParam != NULL && !lstrcmpA(cws->szModule,"CList") && !lstrcmpA(cws->szSetting,"Rate")) setExtaIcon((HANDLE)wParam, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal); return 0; diff --git a/plugins/Rate/src/options.cpp b/plugins/Rate/src/options.cpp index d6088aa691..bd8c3a228e 100644 --- a/plugins/Rate/src/options.cpp +++ b/plugins/Rate/src/options.cpp @@ -55,32 +55,32 @@ enum { clist_nicer }; -const char *szAdvancedIconsModern[] = { - "E-mail", - "Web page", - "Phone/SMS", - "Advanced #1", - "Advanced #2", - "Advanced #3", - "Client", - "Advanced #4", - "Protocol", - "Visibility/Chat activity" +const TCHAR *szAdvancedIconsModern[] = { + LPGENT("E-mail"), + LPGENT("Web page"), + LPGENT("Phone/SMS"), + LPGENT("Advanced #1"), + LPGENT("Advanced #2"), + LPGENT("Advanced #3"), + LPGENT("Client"), + LPGENT("Advanced #4"), + LPGENT("Protocol"), + LPGENT("Visibility/Chat activity") }; //const int cAdvancedIconsModern = sizeof(szAdvancedIconsModern) / sizeof(szAdvancedIconsModern[0]); -const char *szAdvancedIconsNicer[] = { - "Reserved", - "E-mail", - "Homepage", - "Telephone", - "Advanced #1", - "Advanced #2", - "Client", - "Advanced #3", - "Advanced #4", - "Reserved #1", - "Reserved #2" +const TCHAR *szAdvancedIconsNicer[] = { + LPGENT("Reserved"), + LPGENT("E-mail"), + LPGENT("Homepage"), + LPGENT("Telephone"), + LPGENT("Advanced #1"), + LPGENT("Advanced #2"), + LPGENT("Client"), + LPGENT("Advanced #3"), + LPGENT("Advanced #4"), + LPGENT("Reserved #1"), + LPGENT("Reserved #2") }; //const int cAdvancedIconsNicer = sizeof(szAdvancedIconsNicer) / sizeof(szAdvancedIconsNicer[0]); @@ -138,7 +138,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (usedClist != clist_none) { for (int i = 0; i < cAdvancedIcons; i++) { - SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) Translate( usedClist==clist_modern ? szAdvancedIconsModern[i] : szAdvancedIconsNicer[i])); + SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) TranslateTS( usedClist==clist_modern ? szAdvancedIconsModern[i] : szAdvancedIconsNicer[i])); } if (usedClist == clist_modern ) @@ -210,11 +210,11 @@ int onOptInitialise(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.hInstance = g_hInst; - odp.pszGroup = LPGEN("Contact List"); - odp.pszTitle = LPGEN("Rate"); + odp.ptszGroup = LPGENT("Contact List"); + odp.ptszTitle = LPGENT("Rate"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_RATE_OPT); odp.pfnDlgProc = DlgProcOptions; - odp.flags = ODPF_BOLDGROUPS; + odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR; Options_AddPage(wParam, &odp); return 0; -- cgit v1.2.3