summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/column_chatduration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HistoryStats/src/column_chatduration.cpp')
-rw-r--r--plugins/HistoryStats/src/column_chatduration.cpp89
1 files changed, 41 insertions, 48 deletions
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("<div style=\"width: 70px;\"></div>") : muT("")), row, 1, rowSpan);
+ ext::string szLong = TranslateTS(szVisModeDesc[m_nVisMode]);
+ writeRowspanTD(tos, getCustomTitle(TranslateT("Chat duration"), szLong + (m_bGraph ? _T("<div style=\"width: 70px;\"></div>") : _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("<td class=\"") << m_CSS;
+ tos << _T("<td class=\"") << m_CSS;
}
else
{
- tos << muT("<td class=\"num");
+ tos << _T("<td class=\"num");
}
// read and format data
ext::string strAll[4] = {
- i18n(muT("(unknown)")), // min
- i18n(muT("(unknown)")), // avg
- i18n(muT("(unknown)")), // max
+ TranslateT("(unknown)"), // min
+ TranslateT("(unknown)"), // avg
+ TranslateT("(unknown)"), // max
utils::durationToString(contact.getChatDurSum()), // sum
};
@@ -171,11 +164,11 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con
// output tooltip
if (m_bDetail)
{
- static const mu_text* szPrefixes[] = {
- I18N(muT("[Min] #{amount}")),
- I18N(muT("[Avg] #{amount}")),
- I18N(muT("[Max] #{amount}")),
- I18N(muT("[Sum] #{amount}")),
+ static const TCHAR* szPrefixes[] = {
+ LPGENT("[Min] #{amount}"),
+ LPGENT("[Avg] #{amount}"),
+ LPGENT("[Max] #{amount}"),
+ LPGENT("[Sum] #{amount}"),
};
ext::string strTooltip;
@@ -185,26 +178,26 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con
{
if (i != m_nVisMode)
{
- strTooltip += ext::str(ext::kformat(i18n(szPrefixes[i])) % muT("#{amount}") * strAll[i]);
+ strTooltip += ext::str(ext::kformat(TranslateTS(szPrefixes[i])) % _T("#{amount}") * strAll[i]);
++nSegments;
if (nSegments < 3)
{
- strTooltip += muT(" / ");
+ strTooltip += _T(" / ");
}
}
}
- tos << muT("\" title=\"") << utils::htmlEscape(strTooltip) << muT("\">");
+ tos << _T("\" title=\"") << utils::htmlEscape(strTooltip) << _T("\">");
}
else
{
- tos << muT("\">");
+ tos << _T("\">");
}
if (m_bGraph)
{
- tos << muT("<div class=\"n\">")
+ tos << _T("<div class=\"n\">")
<< 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("<br/><img src=\"") << strFinalFile << muT("\"/>");
+ tos << _T("<br/><img src=\"") << strFinalFile << _T("\"/>");
}
}
else
{
- tos << muT("</div>")
- << muT("<div class=\"") << m_CSS << muT("\">")
- << muT("<div style=\"width: ") << barW << muT("px;\"></div>");
+ tos << _T("</div>")
+ << _T("<div class=\"") << m_CSS << _T("\">")
+ << _T("<div style=\"width: ") << barW << _T("px;\"></div>");
}
}
- tos << muT("</div>");
+ tos << _T("</div>");
}
else
{
tos << utils::htmlEscape(strAll[m_nVisMode]);
}
- tos << muT("</td>") << ext::endl;
+ tos << _T("</td>") << ext::endl;
}