diff options
author | George Hazan <george.hazan@gmail.com> | 2024-02-19 18:17:50 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-02-19 18:17:50 +0300 |
commit | 58f9f9dea0865f900fa0c1e6e2ef8ffc18ecef74 (patch) | |
tree | 1e946e089f86b28b685516e668dd7727bd37499c | |
parent | 8995252e28a74bdb8ec2e616b991abd9b92b9655 (diff) |
Revert "fixes #4208 (NewStory: добавить настройку цвета даты)"
This reverts commit 2ce03c8195193380d133300fdf487ce6f78be963.
-rw-r--r-- | plugins/NewStory/src/fonts.cpp | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/fonts.h | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 35 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.h | 1 |
4 files changed, 12 insertions, 27 deletions
diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp index b0924ea535..844f5d0f62 100644 --- a/plugins/NewStory/src/fonts.cpp +++ b/plugins/NewStory/src/fonts.cpp @@ -22,7 +22,6 @@ MyColourID g_colorTable[COLOR_COUNT] = { { LPGEN("Incoming name"), "ColorNickIn", RGB(0x00, 0x00, 0x00) }, { LPGEN("Outgoing name"), "ColorNickOut", RGB(0x00, 0x00, 0x00) }, - { LPGEN("Date color"), "ColorDate", RGB(0x00, 0x00, 0x00) }, { LPGEN("Incoming messages"), "ColorMsgIn", RGB(0xd6, 0xf5, 0xc0) }, { LPGEN("Outgoing messages"), "ColorMsgOut", RGB(0xf5, 0xe7, 0xd8) }, diff --git a/plugins/NewStory/src/fonts.h b/plugins/NewStory/src/fonts.h index 60b55f1292..0a441c1931 100644 --- a/plugins/NewStory/src/fonts.h +++ b/plugins/NewStory/src/fonts.h @@ -5,7 +5,7 @@ enum { - COLOR_INNICK, COLOR_OUTNICK, COLOR_DATE, + COLOR_INNICK, COLOR_OUTNICK, COLOR_INMSG, COLOR_OUTMSG, COLOR_INFILE, COLOR_OUTFILE, COLOR_STATUS, diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 2d7d4fc1d6..b4e7438b4e 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -106,8 +106,6 @@ CMStringA ItemData::formatRtf(const wchar_t *pwszStr) COLORREF cr = F.cl; buf.AppendFormat("{\\colortbl \\red%u\\green%u\\blue%u;", GetRValue(cr), GetGValue(cr), GetBValue(cr)); cr = g_colorTable[(dbe.flags & DBEF_SENT) ? COLOR_OUTNICK : COLOR_INNICK].cl; - buf.AppendFormat("\\red%u\\green%u\\blue%u;", GetRValue(cr), GetGValue(cr), GetBValue(cr)); - cr = g_colorTable[COLOR_DATE].cl; buf.AppendFormat("\\red%u\\green%u\\blue%u;}", GetRValue(cr), GetGValue(cr), GetBValue(cr)); buf.AppendFormat("\\uc1\\pard \\cf0\\f0\\b0\\i0\\fs%d ", GetFontHeight(F.lf)); @@ -266,44 +264,44 @@ void vfEvent(TemplateVars *vars, MCONTACT, ItemData *item) GetDateFormatW(iLocale, 0, &st, L"dd.MM.yyyy, ", buf, _countof(buf)); GetTimeFormatW(iLocale, 0, &st, L"HH:mm", buf + 12, _countof(buf)); - vars->SetDate('t', buf); + vars->SetVar('t', buf, true); // %h: hour (24 hour format, 0-23) GetTimeFormatW(iLocale, 0, &st, L"HH", buf, _countof(buf)); - vars->SetDate('h', buf); + vars->SetVar('h', buf, true); // %a: hour (12 hour format) GetTimeFormatW(iLocale, 0, &st, L"hh", buf, _countof(buf)); - vars->SetDate('a', buf); + vars->SetVar('a', buf, true); // %m: minute GetTimeFormatW(iLocale, 0, &st, L"mm", buf, _countof(buf)); - vars->SetDate('m', buf); + vars->SetVar('m', buf, true); // %s: second GetTimeFormatW(iLocale, 0, &st, L"ss", buf, _countof(buf)); - vars->SetDate('s', buf); + vars->SetVar('s', buf, true); // %o: month GetDateFormatW(iLocale, 0, &st, L"MM", buf, _countof(buf)); - vars->SetDate('o', buf); + vars->SetVar('o', buf, true); // %d: day of month GetDateFormatW(iLocale, 0, &st, L"dd", buf, _countof(buf)); - vars->SetDate('d', buf); + vars->SetVar('d', buf, true); // %y: year GetDateFormatW(iLocale, 0, &st, L"yyyy", buf, _countof(buf)); - vars->SetDate('y', buf); + vars->SetVar('y', buf, true); // %w: day of week (Sunday, Monday... translatable) - vars->SetDate('w', TranslateW(weekDays[st.wDayOfWeek])); + vars->SetVar('w', TranslateW(weekDays[st.wDayOfWeek]), false); // %p: AM/PM symbol - vars->SetDate('p', (st.wHour > 11) ? L"PM" : L"AM"); + vars->SetVar('p', (st.wHour > 11) ? L"PM" : L"AM", false); // %O: Name of month, translatable - vars->SetDate('O', TranslateW(months[st.wMonth-1])); + vars->SetVar('O', TranslateW(months[st.wMonth-1]), false); } } @@ -353,17 +351,6 @@ void vfOther(TemplateVars *vars, MCONTACT, ItemData *item) ///////////////////////////////////////////////////////////////////////////////////////// -void TemplateVars::SetDate(char option, const wchar_t *v) -{ - CMStringW wszDate(FORMAT, L"[c2]%s[c0]", v); - - auto &V = vars[option]; - if (V.del) - mir_free(V.val); - V.val = wszDate.Detach(); - V.del = true; -} - void TemplateVars::SetNick(wchar_t *v) { CMStringW wszNick(FORMAT, L"[c1]%s[c0]", v); diff --git a/plugins/NewStory/src/templates.h b/plugins/NewStory/src/templates.h index 62fd15ac1f..ffe904c16e 100644 --- a/plugins/NewStory/src/templates.h +++ b/plugins/NewStory/src/templates.h @@ -16,7 +16,6 @@ struct TemplateVars return vars[id].val; } - void SetDate(char option, const wchar_t *v); void SetNick(wchar_t *v); void SetVar(uint8_t id, wchar_t *v, bool d); }; |