From 3576b67db9fa0a3d8d5c1747cc3560504d31d125 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 5 Mar 2014 12:52:30 +0000 Subject: - adaptation for standard Windows ways of handling Unicode; - obsoleted code removed; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8407 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryStats/src/column_chatduration.cpp | 89 +++++++++++------------- 1 file changed, 41 insertions(+), 48 deletions(-) (limited to 'plugins/HistoryStats/src/column_chatduration.cpp') diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp index b21dc451b4..9965686fab 100644 --- a/plugins/HistoryStats/src/column_chatduration.cpp +++ b/plugins/HistoryStats/src/column_chatduration.cpp @@ -38,13 +38,13 @@ void ColChatDuration::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup { OptionsCtrl::Item hTemp; - /**/hTemp = Opt.insertGroup(hGroup, i18n(muT("Chat duration type"))); - /**/ m_hVisMode = Opt.insertRadio(hTemp, NULL, i18n(muT("Minimum"))); - /**/ Opt.insertRadio(hTemp, m_hVisMode, i18n(muT("Average"))); - /**/ Opt.insertRadio(hTemp, m_hVisMode, i18n(muT("Maximum"))); - /**/ Opt.insertRadio(hTemp, m_hVisMode, i18n(muT("Total (sum of all chats)"))); - /**/m_hGraph = Opt.insertCheck(hGroup, i18n(muT("Show bar graph for chat duration type"))); - /**/m_hDetail = Opt.insertCheck(hGroup, i18n(muT("Other information in tooltip"))); + hTemp = Opt.insertGroup(hGroup, TranslateT("Chat duration type")); + m_hVisMode = Opt.insertRadio(hTemp, NULL, TranslateT("Minimum")); + Opt.insertRadio(hTemp, m_hVisMode, TranslateT("Average")); + Opt.insertRadio(hTemp, m_hVisMode, TranslateT("Maximum")); + Opt.insertRadio(hTemp, m_hVisMode, TranslateT("Total (sum of all chats)")); + m_hGraph = Opt.insertCheck(hGroup, TranslateT("Show bar graph for chat duration type")); + m_hDetail = Opt.insertCheck(hGroup, TranslateT("Other information in tooltip")); Opt.setRadioChecked(m_hVisMode, m_nVisMode); Opt.checkItem (m_hGraph , m_bGraph ); @@ -66,13 +66,13 @@ Column::StyleList ColChatDuration::impl_outputGetAdditionalStyles(IDProvider& id { m_CSS = idp.getID(); - l.push_back(StylePair(muT("td.") + m_CSS, muT("vertical-align: middle; padding: 2px 2px 2px 2px;"))); - l.push_back(StylePair(muT("td.") + m_CSS + muT(" div.n"), muT("text-align: center;"))); + l.push_back(StylePair(_T("td.") + m_CSS, _T("vertical-align: middle; padding: 2px 2px 2px 2px;"))); + l.push_back(StylePair(_T("td.") + m_CSS + _T(" div.n"), _T("text-align: center;"))); if (!usePNG()) { - l.push_back(StylePair(muT("div.") + m_CSS, muT("position: relative; left: 50%; margin-left: -35px; width: 70px; height: 15px; background-color: ") + utils::colorToHTML(con::ColorBarBack) + muT(";"))); - l.push_back(StylePair(muT("div.") + m_CSS + muT(" div"), muT("position: absolute; top: 0px; left: 0px; height: 15px; overflow: hidden; background-color: ") + utils::colorToHTML(con::ColorBar) + muT(";"))); + l.push_back(StylePair(_T("div.") + m_CSS, _T("position: relative; left: 50%; margin-left: -35px; width: 70px; height: 15px; background-color: ") + utils::colorToHTML(con::ColorBarBack) + _T(";"))); + l.push_back(StylePair(_T("div.") + m_CSS + _T(" div"), _T("position: absolute; top: 0px; left: 0px; height: 15px; overflow: hidden; background-color: ") + utils::colorToHTML(con::ColorBar) + _T(";"))); } } @@ -81,16 +81,17 @@ Column::StyleList ColChatDuration::impl_outputGetAdditionalStyles(IDProvider& id void ColChatDuration::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const { - static const mu_text* szVisModeDesc[] = { - I18N(muT("Minimum chat duration")), - I18N(muT("Average chat duration")), - I18N(muT("Maximum chat duration")), - I18N(muT("Total chat duration")), + static const TCHAR* szVisModeDesc[] = { + LPGENT("Minimum chat duration"), + LPGENT("Average chat duration"), + LPGENT("Maximum chat duration"), + LPGENT("Total chat duration"), }; if (row == 1) { - writeRowspanTD(tos, getCustomTitle(i18n(muT("Chat duration")), i18n(szVisModeDesc[m_nVisMode])) + (m_bGraph ? muT("
") : muT("")), row, 1, rowSpan); + ext::string szLong = TranslateTS(szVisModeDesc[m_nVisMode]); + writeRowspanTD(tos, getCustomTitle(TranslateT("Chat duration"), szLong + (m_bGraph ? _T("
") : _T(""))), row, 1, rowSpan); } } @@ -98,8 +99,7 @@ void ColChatDuration::impl_columnDataAfterOmit() { // AFTER, i.e. contacts are trimmed to what user will see - if (m_bGraph) - { + if (m_bGraph) { static DWORD (Contact::*getChatDurX[4])() const = { &Contact::getChatDurMin, &Contact::getChatDurAvg, @@ -114,22 +114,15 @@ void ColChatDuration::impl_columnDataAfterOmit() const Contact& cur = getStatistic()->getContact(i); if (cur.isChatDurValid()) - { m_nMaxForGraph = max(m_nMaxForGraph, (cur.*getChatDurX[m_nVisMode])()); - } } - if (m_nVisMode != 3) - { + if (m_nVisMode != 3) { if (getStatistic()->hasOmitted() && getStatistic()->getOmitted().isChatDurValid()) - { m_nMaxForGraph = max(m_nMaxForGraph, (getStatistic()->getOmitted().*getChatDurX[m_nVisMode])()); - } if (getStatistic()->hasTotals() && getStatistic()->getTotals().isChatDurValid()) - { m_nMaxForGraph = max(m_nMaxForGraph, (getStatistic()->getTotals().*getChatDurX[m_nVisMode])()); - } } } } @@ -146,18 +139,18 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con // begin output if (m_bGraph) { - tos << muT(""); + tos << _T("\" title=\"") << utils::htmlEscape(strTooltip) << _T("\">"); } else { - tos << muT("\">"); + tos << _T("\">"); } if (m_bGraph) { - tos << muT("
") + tos << _T("
") << utils::htmlEscape(strAll[m_nVisMode]); if (display == asContact || m_nVisMode != 3) @@ -235,23 +228,23 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con if (getStatistic()->newFilePNG(canvas, strFinalFile)) { - tos << muT("
"); + tos << _T("
"); } } else { - tos << muT("
") - << muT("
") - << muT("
"); + tos << _T("
") + << _T("
") + << _T("
"); } } - tos << muT("
"); + tos << _T("
"); } else { tos << utils::htmlEscape(strAll[m_nVisMode]); } - tos << muT("") << ext::endl; + tos << _T("") << ext::endl; } -- cgit v1.2.3