From 624a4190048b1205488f5973e121615c76171ae3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Oct 2013 15:39:44 +0000 Subject: even less calls of MS_CLIST_GETSTATUSMODEDESCRIPTION git-svn-id: http://svn.miranda-ng.org/main/trunk@6429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BossKeyPlus/src/Options.cpp | 4 ++-- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 10 +++++----- plugins/Ping/src/options.cpp | 2 +- plugins/TipperYM/src/common.h | 1 + plugins/TipperYM/src/popwin.cpp | 4 ++-- plugins/TipperYM/src/tipper.cpp | 7 ++++--- plugins/TipperYM/src/translations.cpp | 5 ++--- plugins/TooltipNotify/src/TooltipNotify.cpp | 2 +- plugins/YAPP/src/options.cpp | 5 +---- 9 files changed, 19 insertions(+), 21 deletions(-) (limited to 'plugins') diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index cf7babd781..63eb25d851 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -73,8 +73,8 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) CheckDlgButton(hwndDlg,IDC_MAINOPT_USEDEFMSG,(g_wMask & OPT_USEDEFMSG) ? (BST_CHECKED) : (BST_UNCHECKED)); CheckDlgButton(hwndDlg,IDC_MAINOPT_TRAYICON,(g_wMask & OPT_TRAYICON) ? (BST_CHECKED) : (BST_UNCHECKED)); - for (int i = ID_STATUS_OFFLINE;i <= ID_STATUS_OUTTOLUNCH; i++) - SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_INSERTSTRING, -1, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, i, GSMDF_TCHAR)); + for (int i=ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) + SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(i, 0)); SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_SETCURSEL, db_get_b(NULL, MOD_NAME, "stattype", 2), 0); diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 6a4d4a850c..609ddb1675 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -328,10 +328,10 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR); EnableWindow(hwnd, FALSE); } - SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, ( LPARAM )LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON6),IMAGE_ICON,16,16,0)); - SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, ( LPARAM )LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON3),IMAGE_ICON,16,16,0)); - SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, ( LPARAM )LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON4),IMAGE_ICON,16,16,0)); - SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, ( LPARAM )LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON5),IMAGE_ICON,16,16,0)); + SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON6),IMAGE_ICON,16,16,0)); + SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON3),IMAGE_ICON,16,16,0)); + SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON4),IMAGE_ICON,16,16,0)); + SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON5),IMAGE_ICON,16,16,0)); // initialise and fill listbox hwndList = GetDlgItem(hwndDlg, IDC_STATUS); ListView_DeleteAllItems(hwndList); @@ -350,7 +350,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar // items. lvI.mask = LVIF_TEXT; for(int i = 0; i < STATUS_COUNT; i++) { - lvI.pszText= (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(ID_STATUS_ONLINE + i), GSMDF_TCHAR); + lvI.pszText = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, ID_STATUS_ONLINE+i, GSMDF_TCHAR); lvI.iItem = i; ListView_InsertItem(hwndList, &lvI); ListView_SetCheckState(hwndList, i, settingStatus[i]); diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 0f9e45726e..b8d08b20d4 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -181,8 +181,8 @@ INT_PTR CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch ( msg ) { case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); { - TranslateDialogDefault(hwndDlg); for(int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, (LPARAM)0); hw = GetDlgItem(hwndDlg, IDC_COMBO_DESTSTAT); diff --git a/plugins/TipperYM/src/common.h b/plugins/TipperYM/src/common.h index 4e263bc11b..e3fc85c62b 100644 --- a/plugins/TipperYM/src/common.h +++ b/plugins/TipperYM/src/common.h @@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. #include #include #include +#include #include #include #include diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 17574293d6..441db0effa 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -120,7 +120,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } - TCHAR *swzText = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, wStatus, GSMDF_TCHAR); + TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); if (swzText) AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false); @@ -1563,7 +1563,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_STATUS) { - TCHAR *swzText = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, wStatus, GSMDF_TCHAR); + TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0); if (swzText) AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false); } diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 76a50680b1..c3161b17dc 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -37,6 +37,7 @@ HANDLE hReloadFonts = NULL; HANDLE hFolderChanged, hSkinFolder; TCHAR SKIN_FOLDER[256]; +CLIST_INTERFACE *pcli = NULL; FI_INTERFACE *fii = NULL; TIME_API tmi; int hLangpack; @@ -59,7 +60,7 @@ PLUGININFOEX pluginInfoEx = bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { hInst = hinstDLL; - return TRUE; + return TRUE; } extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) @@ -92,7 +93,6 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) return 0; } - // hack to hide tip when clist hides from timeout int SettingChanged(WPARAM wParam, LPARAM lParam) { @@ -304,8 +304,9 @@ HANDLE hEventPreShutdown, hEventModulesLoaded; extern "C" int __declspec(dllexport) Load(void) { CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii); - mir_getTMI(&tmi); mir_getLP(&pluginInfoEx); + mir_getCLI(); + mir_getTMI(&tmi); if (ServiceExists(MS_LANGPACK_GETCODEPAGE)) iCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 39b32434a5..c037fe8035 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -159,9 +159,8 @@ TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE); - TCHAR *szStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, GSMDF_TCHAR); - _tcsncpy(buff,szStatus, bufflen); - buff[bufflen - 1] = 0; + TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0); + _tcsncpy_s(buff, bufflen, szStatus, _TRUNCATE); return buff; } diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 3aca1cc6e2..fc24eac81a 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -885,7 +885,7 @@ TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize { if((iStatus>=ID_STATUS_OFFLINE) && (iStatus<=ID_STATUS_OUTTOLUNCH)) { - lstrcpyn(szStatus, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,iStatus,GSMDF_TCHAR), iBufSize); + lstrcpyn(szStatus, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,iStatus,GSMDF_TCHAR), iBufSize); } else { diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index 497bbc4b18..25685a25d6 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -177,15 +177,12 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // items. lvI.mask = LVIF_TEXT; - char *strptr; int i = 0; for (; i < 10; i++) { - strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(ID_STATUS_OFFLINE + i), 0); - lvI.pszText = mir_a2t(strptr); + lvI.pszText = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, ID_STATUS_OFFLINE + i, GSMDF_TCHAR); lvI.iItem = i; ListView_InsertItem(hwndList, &lvI); ListView_SetCheckState(hwndList, i, options.disable_status[i]); - mir_free(lvI.pszText); } lvI.pszText = TranslateT("Full-screen app running"); lvI.iItem = i; -- cgit v1.2.3