summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-10 15:39:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-10 15:39:44 +0000
commit624a4190048b1205488f5973e121615c76171ae3 (patch)
tree5ecf810bc7bef4dda71a5791c2aa0fa2ffb29fa1
parent45a5b1f9b7709f8d93b57abea7ba46b44eac5707 (diff)
even less calls of MS_CLIST_GETSTATUSMODEDESCRIPTION
git-svn-id: http://svn.miranda-ng.org/main/trunk@6429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/delphi/m_clist.inc1
-rw-r--r--plugins/BossKeyPlus/src/Options.cpp4
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp10
-rw-r--r--plugins/Ping/src/options.cpp2
-rw-r--r--plugins/TipperYM/src/common.h1
-rw-r--r--plugins/TipperYM/src/popwin.cpp4
-rw-r--r--plugins/TipperYM/src/tipper.cpp7
-rw-r--r--plugins/TipperYM/src/translations.cpp5
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp2
-rw-r--r--plugins/YAPP/src/options.cpp5
-rw-r--r--protocols/Tlen/src/tlen.cpp3
-rw-r--r--protocols/Tlen/src/tlen.h1
-rw-r--r--protocols/Tlen/src/tlen_opt.cpp13
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp6
14 files changed, 31 insertions, 33 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index 294f7fd0d9..86a4a74be5 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -33,7 +33,6 @@ const
}
MS_CLIST_GETSTATUSMODE:PAnsiChar = 'CList/GetStatusMode';
- GSMDF_PREFIXONLINE = 1; // prefix "Online :" for online submodes, e.g. 'away'
GSMDF_UNICODE = 2; // will return TCHAR* instead of AnsiChar*
GSMDF_UNTRANSLATED = 4;
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 <newpluginapi.h>
#include <m_avatars.h>
#include <m_awaymsg.h>
+#include <m_clistint.h>
#include <m_clc.h>
#include <m_clui.h>
#include <m_cluiframes.h>
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;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index ed149cf861..92bd5d28d8 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_genmenu.h>
#include "m_mucc.h"
-
+CLIST_INTERFACE *pcli;
int hLangpack;
HINSTANCE hInst;
HANDLE hMainThread;
@@ -393,6 +393,7 @@ static int tlenProtoUninit(TlenProtocol* ppro)
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP( &pluginInfo );
+ mir_getCLI();
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h
index f794e8432e..ddcf6ba3c5 100644
--- a/protocols/Tlen/src/tlen.h
+++ b/protocols/Tlen/src/tlen.h
@@ -69,6 +69,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_protoint.h>
#include <m_contacts.h>
#include <m_clist.h>
+#include <m_clistint.h>
#include <m_clui.h>
#include <m_options.h>
#include <m_userinfo.h>
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp
index 4d58c572db..d8c47e0859 100644
--- a/protocols/Tlen/src/tlen_opt.cpp
+++ b/protocols/Tlen/src/tlen_opt.cpp
@@ -239,13 +239,12 @@ static INT_PTR CALLBACK TlenBasicOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
SendDlgItemMessage(hwndDlg, IDC_IMAGE_POLICY, CB_SETCURSEL, proto->tlenOptions.imagePolicy, 0);
SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Last message>"));
- //SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Ask me>"));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_ONLINE,GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_AWAY,GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_NA,GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_DND,GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_FREECHAT,GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,ID_STATUS_INVISIBLE,GSMDF_TCHAR));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE, 0));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_AWAY, 0));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_NA, 0));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_DND, 0));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_FREECHAT, 0));
+ SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_INVISIBLE, 0));
SendDlgItemMessage(hwndDlg, IDC_OFFLINE_MESSAGE_OPTION, CB_SETCURSEL, proto->tlenOptions.offlineMessageOption, 0);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_EDIT_USERNAME), TlenValidateUsernameWndProc);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 4b2c68c1b6..218a9d80a1 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1149,7 +1149,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else
SetDlgItemText(hwndDlg, IDC_NAME, contactName);
- szStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), GSMDF_TCHAR);
+ szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
if (statusIcon)
mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s - %s"), contactName, TranslateTS(pszNewTitleEnd));
else
@@ -1167,8 +1167,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TCHAR buffer[200];
int iLen;
- TCHAR *szOldStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM) dat->wOldStatus, GSMDF_TCHAR);
- TCHAR *szNewStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM) dat->wStatus, GSMDF_TCHAR);
+ TCHAR *szOldStatus = pcli->pfnGetStatusModeDescription(dat->wOldStatus, 0);
+ TCHAR *szNewStatus = pcli->pfnGetStatusModeDescription(dat->wStatus, 0);
if (dat->wStatus == ID_STATUS_OFFLINE) {
iLen = mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("signed off (was %s)"), szOldStatus);