diff options
Diffstat (limited to 'plugins/StatusPlugins')
-rw-r--r-- | plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp | 2 | ||||
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 34 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/options.cpp | 20 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/profiles.cpp | 4 | ||||
-rw-r--r-- | plugins/StatusPlugins/commonstatus.cpp | 10 | ||||
-rw-r--r-- | plugins/StatusPlugins/confirmdialog.cpp | 18 |
6 files changed, 44 insertions, 44 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 818631c5dc..1941273470 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
else {
- ptrT msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L"");
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 413c8f0f54..54cb3028d4 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -224,7 +224,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wch log_infoA("KeepStatus: assigning status %d to %s", cs->status, cs->szName); - if (szMsg != NULL && mir_tstrcmp(szMsg, cs->szMsg)) { + if (szMsg != NULL && mir_wstrcmp(szMsg, cs->szMsg)) { if (cs->szMsg != NULL) free(cs->szMsg); @@ -897,7 +897,7 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); + mir_snwprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto @@ -906,9 +906,9 @@ static int ProcessPopup(int reason, LPARAM lParam) hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) - mir_sntprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); + mir_snwprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - mir_sntprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + mir_snwprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; @@ -919,9 +919,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { // Указатель на имя модуля. hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); + mir_snwprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); } - else mir_sntprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); + else mir_snwprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** @@ -932,22 +932,22 @@ static int ProcessPopup(int reason, LPARAM lParam) wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE]; memset(protoInfoLine, '\0', sizeof(protoInfoLine)); memset(protoInfo, '\0', sizeof(protoInfo)); - mir_tstrcpy(protoInfo, L"\r\n"); + mir_wstrcpy(protoInfo, L"\r\n"); for (int i = 0; i < connectionSettings.getCount(); i++) { - if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { + if (mir_wstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); - mir_tstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_tstrlen(protoInfo) - 1); + mir_snwprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); + mir_wstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_wstrlen(protoInfo) - 1); } } } hIcon = Skin_LoadProtoIcon(ps[0]->szName, SKINICON_STATUS_OFFLINE); - rtrimt(protoInfo); + rtrimw(protoInfo); if (retryCount == (maxRetries - 1)) - mir_sntprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); + mir_snwprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); else - mir_sntprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); + mir_snwprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); } break; @@ -956,9 +956,9 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; if (retryCount == maxRetries - 1) - mir_sntprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); + mir_snwprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); else - mir_sntprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); + mir_snwprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes @@ -967,9 +967,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { hIcon = Skin_LoadIcon(SKINICON_STATUS_ONLINE); - mir_sntprintf(text, TranslateT("Status was set ok")); + mir_snwprintf(text, TranslateT("Status was set ok")); } - else mir_sntprintf(text, TranslateT("Giving up")); + else mir_snwprintf(text, TranslateT("Giving up")); break; } if (hIcon == NULL) diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 389b7a4d66..31d8324e22 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -156,16 +156,16 @@ static wchar_t* GetLinkDescription(TSettingsList& protoSettings) result.Append(status);
}
- return mir_tstrndup(result, result.GetLength());
+ return mir_wstrndup(result, result.GetLength());
}
HRESULT CreateLink(TSettingsList& protoSettings)
{
wchar_t savePath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
- wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
+ wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_wstrlen(savePath));
else
- mir_sntprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
+ mir_snwprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
// Get a pointer to the IShellLink interface.
IShellLink *psl;
@@ -324,12 +324,12 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa }
else {
wchar_t text[128];
- mir_sntprintf(text, TranslateT("size: %d x %d"),
+ mir_snwprintf(text, TranslateT("size: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0));
SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text);
- mir_sntprintf(text, TranslateT("loc: %d x %d"),
+ mir_snwprintf(text, TranslateT("loc: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0));
SetDlgItemText(hwndDlg, IDC_CURWINLOC, text);
@@ -529,9 +529,9 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP if ( GetProfile(i, ar) == -1) {
/* create an empty profile */
if (i == defProfile)
- ppo->tszName = mir_tstrdup( TranslateT("default"));
+ ppo->tszName = mir_wstrdup( TranslateT("default"));
else
- ppo->tszName = mir_tstrdup( TranslateT("unknown"));
+ ppo->tszName = mir_wstrdup( TranslateT("unknown"));
}
else {
for (int j=0; j < ar.getCount(); j++)
@@ -541,9 +541,9 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP ppo->tszName = db_get_tsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
if (ppo->tszName == NULL) {
if (i == defProfile)
- ppo->tszName = mir_tstrdup( TranslateT("default"));
+ ppo->tszName = mir_wstrdup( TranslateT("default"));
else
- ppo->tszName = mir_tstrdup( TranslateT("unknown"));
+ ppo->tszName = mir_wstrdup( TranslateT("unknown"));
}
ppo->createTtb = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), 0);
ppo->showDialog = db_get_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), 0);
@@ -665,7 +665,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP break;
PROFILEOPTIONS* ppo = new PROFILEOPTIONS;
- ppo->tszName = mir_tstrdup(tszName);
+ ppo->tszName = mir_wstrdup(tszName);
ppo->ps = GetCurrentProtoSettings();
arProfiles.insert(ppo);
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index d370e53999..6cb631e3cb 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -139,9 +139,9 @@ wchar_t *GetStatusMessage(int profile, char *szProto) if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db - pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_tstrlen(dbv.ptszVal) + 1)); + pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_wstrlen(dbv.ptszVal) + 1)); if (pce[i].msg != NULL) { - mir_tstrcpy(pce[i].msg, dbv.ptszVal); + mir_wstrcpy(pce[i].msg, dbv.ptszVal); } db_free(&dbv); } diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 19411d9938..c04f8ab085 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -117,7 +117,7 @@ wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) {
if (ps->szMsg != NULL) {// custom message set
log_infoA("CommonStatus: Status message set by calling plugin");
- return mir_tstrdup(ps->szMsg);
+ return mir_wstrdup(ps->szMsg);
}
wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
@@ -184,10 +184,10 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) else
continue;
- if (mir_tstrlen(substituteStr) > 6)
- tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
- memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_tstrlen(tszMsg) - j - 5));
- memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_tstrlen(substituteStr));
+ if (mir_wstrlen(substituteStr) > 6)
+ tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_wstrlen(tszMsg) + 1 + mir_wstrlen(substituteStr) - 6));
+ memmove(tszMsg + j + mir_wstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_wstrlen(tszMsg) - j - 5));
+ memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_wstrlen(substituteStr));
}
wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 34b82714a8..e19b1d0a55 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -69,7 +69,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
wchar_t desc[512];
- mir_sntprintf(desc, TranslateT("Set %s message for %s."),
+ mir_snwprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
}
@@ -127,11 +127,11 @@ static int SetStatusList(HWND hwndDlg) wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
switch ((*confirmSettings)[i].status) {
case ID_STATUS_LAST:
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
case ID_STATUS_CURRENT:
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<current>"), status);
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<current>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
default:
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // start timer
if (timeOut > 0) {
wchar_t text[32];
- mir_sntprintf(text, TranslateT("Closing in %d"), timeOut);
+ mir_snwprintf(text, TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
}
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
{
wchar_t text[32];
- mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1);
+ mir_snwprintf(text, TranslateT("Closing in %d"), timeOut - 1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
KillTimer(hwndDlg, TIMER_ID);
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // LAST STATUS
if (proto->status == ID_STATUS_LAST) {
wchar_t last[80];
- mir_sntprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_snwprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
}
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
wchar_t current[80];
- mir_sntprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_snwprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
}
@@ -344,7 +344,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // last
wchar_t buf[100];
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST);
if (proto->status == ID_STATUS_LAST) {
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // current
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
- mir_sntprintf(buf, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_snwprintf(buf, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT);
if (proto->status == ID_STATUS_CURRENT) {
|