diff options
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 54 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/options.cpp | 22 |
2 files changed, 38 insertions, 38 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 0b5bbc73e8..cc3b479be4 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -253,7 +253,7 @@ bool isContactGoneFor(MCONTACT hContact, int days) return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
-void ReturnNotify(MCONTACT hContact, TCHAR *message)
+void ReturnNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -265,8 +265,8 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -284,15 +284,15 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) cle.pszService = "BuddyExpectator/actionReturned";
cle.flags = CLEF_TCHAR;
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
pcli->pfnAddEvent(&cle);
}
}
-void GoneNotify(MCONTACT hContact, TCHAR *message)
+void GoneNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -302,8 +302,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -321,8 +321,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
@@ -435,9 +435,9 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
- Menu_ModifyItem(hContactMenu, LPGENT("Disable Miss You"), iconList[1].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Disable Miss You"), iconList[1].hIcolib);
else
- Menu_ModifyItem(hContactMenu, LPGENT("Enable Miss You"), iconList[2].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Enable Miss You"), iconList[2].hIcolib);
Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
@@ -485,8 +485,8 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -517,17 +517,17 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod)) {
- TCHAR* message = TranslateT("has returned after a long absence.");
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t* message = TranslateT("has returned after a long absence.");
+ wchar_t tmpBuf[251] = { 0 };
time_t tmpTime = getLastSeen(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else {
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -551,13 +551,13 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
SkinPlaySound("buddyExpectatorStillAbsent");
- TCHAR* message = TranslateT("has not returned after a long absence.");
+ wchar_t* message = TranslateT("has not returned after a long absence.");
time_t tmpTime;
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t tmpBuf[251] = { 0 };
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else
@@ -565,7 +565,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -593,10 +593,10 @@ int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
- SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
- SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
- SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
- SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));
+ SkinAddNewSoundExT("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
+ SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
+ SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
+ SkinAddNewSoundExT("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
@@ -612,7 +612,7 @@ int ModulesLoaded(WPARAM, LPARAM) mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[2].hIcolib;
mi.position = 200000;
- mi.name.t = LPGENT("Enable Miss You");
+ mi.name.w = LPGENW("Enable Miss You");
mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 107eae10f4..b0be57b26e 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -325,10 +325,10 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchContact = NULL;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
- TCHAR szPreviewText[250];
+ wcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ wchar_t szPreviewText[250];
mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
- _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
@@ -433,15 +433,15 @@ static int OptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
+ odp.pwszGroup = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
- odp.ptszTitle = LPGENT("Buddy Expectator");
+ odp.pwszTitle = LPGENW("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPPANEL);
odp.pfnDlgProc = PopupOptionsFrameProc;
Options_AddPage(wParam, &odp);
@@ -456,12 +456,12 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_INITDIALOG:
{
time_t tmpTime;
- TCHAR tmpBuf[51] = { 0 };
+ wchar_t tmpBuf[51] = { 0 };
tmpTime = getLastSeen((MCONTACT)lparam);
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
}
@@ -469,7 +469,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
@@ -532,7 +532,7 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) uip.hInstance = hInst;
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.flags = ODPF_TCHAR;
- uip.ptszTitle = LPGENT("Buddy Expectator");
+ uip.pwszTitle = LPGENW("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);
}
|