summaryrefslogtreecommitdiff
path: root/plugins/Nudge/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/Nudge/src
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Nudge/src')
-rw-r--r--plugins/Nudge/src/main.cpp28
-rw-r--r--plugins/Nudge/src/nudge.cpp16
-rw-r--r--plugins/Nudge/src/nudge.h6
-rw-r--r--plugins/Nudge/src/options.cpp4
-rw-r--r--plugins/Nudge/src/stdafx.h2
5 files changed, 28 insertions, 28 deletions
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 0c8bff05f9..c474591f69 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -50,7 +50,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam)
char *protoName = GetContactProto(hContact);
int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
- TCHAR msg[500];
+ wchar_t msg[500];
mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
@@ -250,7 +250,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM)
{
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = "Nudge";
- bbd.ptszTooltip = LPGENT("Send Nudge");
+ bbd.ptszTooltip = LPGENW("Send Nudge");
bbd.dwDefPos = 300;
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
@@ -341,7 +341,7 @@ extern "C" int __declspec(dllexport) Load(void)
mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
mi.position = -500050004;
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("Send &Nudge");
+ mi.name.w = LPGENW("Send &Nudge");
mi.pszService = MS_NUDGE_SEND;
g_hContactMenu = Menu_AddContactMenuItem(&mi);
@@ -393,7 +393,7 @@ void LoadPopupClass()
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
- ppc.ptszDescription = LPGENT("Show Nudge");
+ ppc.ptszDescription = LPGENW("Show Nudge");
ppc.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
@@ -442,17 +442,17 @@ int Preview()
return 0;
}
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message)
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, wchar_t * Message)
{
hContact = db_mc_tryMeta(hContact);
- TCHAR *lpzContactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lpzContactName = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
POPUPDATACLASS NudgePopup = { 0 };
NudgePopup.cbSize = sizeof(NudgePopup);
NudgePopup.hContact = hContact;
- NudgePopup.ptszText = Message;
- NudgePopup.ptszTitle = lpzContactName;
+ NudgePopup.pwszText = Message;
+ NudgePopup.pwszTitle = lpzContactName;
NudgePopup.pszClassName = "nudge";
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&NudgePopup);
}
@@ -466,8 +466,8 @@ void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message)
NudgePopup.PluginWindowProc = NudgePopupProc;
NudgePopup.PluginData = (void *)1;
- _tcscpy_s(NudgePopup.lptzText, Message);
- _tcscpy_s(NudgePopup.lptzContactName, lpzContactName);
+ wcscpy_s(NudgePopup.lptzText, Message);
+ wcscpy_s(NudgePopup.lptzContactName, lpzContactName);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&NudgePopup, 0);
}
@@ -517,14 +517,14 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);
strcpy_s(p->ProtocolName, proto->szModuleName);
- _tcscpy_s(p->AccountName, proto->tszAccountName);
+ wcscpy_s(p->AccountName, proto->tszAccountName);
p->Load();
p->hEvent = hevent;
- TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
- SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);
+ wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
+ mir_sntprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
+ SkinAddNewSoundExT(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
arNudges.insert(p);
}
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp
index 1e0d6a0576..7c0ac3646b 100644
--- a/plugins/Nudge/src/nudge.cpp
+++ b/plugins/Nudge/src/nudge.cpp
@@ -82,19 +82,19 @@ void CNudgeElement::Load(void)
mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->recText) < 1)
- _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ wcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->recText) < 1)
+ wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ else wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->senText) < 1)
- _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ wcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->senText) < 1)
+ wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ else wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
}
diff --git a/plugins/Nudge/src/nudge.h b/plugins/Nudge/src/nudge.h
index 71b3bcd366..d1fd358795 100644
--- a/plugins/Nudge/src/nudge.h
+++ b/plugins/Nudge/src/nudge.h
@@ -31,10 +31,10 @@ struct CNudge
struct CNudgeElement : public MZeroedObject
{
char ProtocolName[64];
- TCHAR AccountName[128];
+ wchar_t AccountName[128];
char NudgeSoundname[100];
- TCHAR recText[TEXT_LEN];
- TCHAR senText[TEXT_LEN];
+ wchar_t recText[TEXT_LEN];
+ wchar_t senText[TEXT_LEN];
bool showPopup;
bool showStatus;
bool openMessageWindow;
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp
index eca4c9d061..57dcaf9c0a 100644
--- a/plugins/Nudge/src/options.cpp
+++ b/plugins/Nudge/src/options.cpp
@@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
mir_sntprintf(szBuf, L"%d", shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
mir_sntprintf(szBuf, L"%d", shake.nMoveChat);
@@ -130,7 +130,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT)
|| (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CHAT))
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
mir_sntprintf(szBuf, L"%d", dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
diff --git a/plugins/Nudge/src/stdafx.h b/plugins/Nudge/src/stdafx.h
index 80422dd571..0ee06f2245 100644
--- a/plugins/Nudge/src/stdafx.h
+++ b/plugins/Nudge/src/stdafx.h
@@ -42,7 +42,7 @@ int Preview();
/*
*
****************************/
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT, TCHAR *);
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT, wchar_t *);
/*
*