summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-07 18:53:03 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-07 18:53:03 +0300
commit03d8ca472d6d868907c58162086a3d7d513a4f0d (patch)
treee027dc0c3c6c5eee22c475bba804035ba36235fb /plugins/NewXstatusNotify/src
parent0ae12122c221c4f467a2dabd247794f5a0e4a101 (diff)
fixes #3814 (NewXStatusNotify: пропал перевод статусов)
Diffstat (limited to 'plugins/NewXstatusNotify/src')
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp5
-rw-r--r--plugins/NewXstatusNotify/src/options.cpp22
-rw-r--r--plugins/NewXstatusNotify/src/popup.h2
3 files changed, 12 insertions, 17 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index f0317beacb..70fba89f5f 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -302,12 +302,11 @@ void GetStatusText(MCONTACT hContact, uint16_t newStatus, uint16_t oldStatus, wc
break;
}
}
- else
- wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
+ else wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
if (opt.ShowPreviousStatus) {
wchar_t buff[MAX_STATUSTEXT];
- mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
+ mir_snwprintf(buff, TranslateT("(was %s)"), StatusList[Index(oldStatus)].lpzStandardText);
mir_wstrcat(mir_wstrcat(stzStatusText, L" "), buff);
}
}
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp
index 3bca081936..fcd5c307d8 100644
--- a/plugins/NewXstatusNotify/src/options.cpp
+++ b/plugins/NewXstatusNotify/src/options.cpp
@@ -377,31 +377,29 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_PREVIEW:
- wchar_t str[MAX_SECONDLINE];
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
- str[0] = 0;
+ auto &pStatus = StatusList[Index(i)];
+ CMStringW buf;
if (opt.ShowStatus) {
if (opt.UseAlternativeText == 1)
- wcsncpy(str, StatusList[Index(i)].lpzUStatusText, _countof(str));
+ buf.Append(TranslateW(pStatus.lpzUStatusText));
else
- wcsncpy(str, StatusList[Index(i)].lpzStandardText, _countof(str));
+ buf.Append(TranslateW(pStatus.lpzStandardText));
if (opt.ShowPreviousStatus) {
- wchar_t buff[MAX_STATUSTEXT];
- mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
- mir_wstrcat(str, L" ");
- mir_wstrcat(str, buff);
+ buf.AppendChar(' ');
+ buf.AppendFormat(TranslateT("(was %s)"), pStatus.lpzStandardText);
}
}
if (opt.ReadAwayMsg) {
- if (str[0])
- mir_wstrcat(str, L"\n");
- mir_wstrcat(str, TranslateT("This is status message"));
+ if (!buf.IsEmpty())
+ buf += L"\n";
+ buf += TranslateT("This is status message");
}
- ShowChangePopup(NULL, Skin_LoadProtoIcon(nullptr, i), i, str);
+ ShowChangePopup(NULL, Skin_LoadProtoIcon(nullptr, i), i, buf);
}
ShowChangePopup(NULL, Skin_LoadProtoIcon(nullptr, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, TranslateT("This is extra status"));
diff --git a/plugins/NewXstatusNotify/src/popup.h b/plugins/NewXstatusNotify/src/popup.h
index aa067c80b0..917c756309 100644
--- a/plugins/NewXstatusNotify/src/popup.h
+++ b/plugins/NewXstatusNotify/src/popup.h
@@ -35,8 +35,6 @@
#define PCA_OPENHISTORY 4 // open contact history
#define PCA_DONOTHING 5 // do nothing
-#define STRING_SHOWPREVIOUSSTATUS LPGENW("(was %s)")
-
typedef struct tagPLUGINDATA
{
uint16_t newStatus;