summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-05 16:02:43 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-05 16:02:43 +0300
commit38733b435d68429add3aa500f15ad2a59c9c659f (patch)
tree33bd701c254138c54b4e4a9f5a8f52acffb4bff2 /plugins/NewStory
parent0f8f4280e75d59bfc2bbaade8449b3d6f46deebd (diff)
fixes #2418 (NewStory: add event count to system history)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history.cpp30
-rw-r--r--plugins/NewStory/src/templates.cpp2
2 files changed, 11 insertions, 21 deletions
diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp
index 9711c9770e..e825bc789b 100644
--- a/plugins/NewStory/src/history.cpp
+++ b/plugins/NewStory/src/history.cpp
@@ -328,12 +328,10 @@ class CHistoryDlg : public CDlgBase
void UpdateTitle()
{
- if (m_hContact && m_hContact != INVALID_CONTACT_ID)
+ if (m_hContact != INVALID_CONTACT_ID)
SetWindowText(m_hwnd, ptrW(TplFormatString(TPL_TITLE, m_hContact, 0)));
- else if (m_hContact == INVALID_CONTACT_ID)
+ else
SetWindowText(m_hwnd, TranslateT("History search results"));
- else
- SetWindowText(m_hwnd, TranslateT("System history"));
}
void TimeTreeBuild()
@@ -446,22 +444,14 @@ public:
TranslateMenu(m_hMenu);
HMENU hMenu = GetSubMenu(m_hMenu, 0);
- CheckMenuItem(hMenu, ID_FILTER_INCOMING,
- showFlags & HIST_SHOW_IN ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_OUTGOING,
- showFlags & HIST_SHOW_OUT ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_MESSAGES,
- showFlags & HIST_SHOW_MSGS ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_FILES,
- showFlags & HIST_SHOW_FILES ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_URLS,
- showFlags & HIST_SHOW_URLS ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_STATUS,
- showFlags & HIST_SHOW_STATUS ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_OTHER,
- showFlags & HIST_SHOW_OTHER ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, ID_FILTER_AUTO,
- showFlags & HIST_AUTO_FILTER ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_INCOMING, (showFlags & HIST_SHOW_IN) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_OUTGOING, (showFlags & HIST_SHOW_OUT) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_MESSAGES, (showFlags & HIST_SHOW_MSGS) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_FILES, (showFlags & HIST_SHOW_FILES) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_URLS, (showFlags & HIST_SHOW_URLS) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_STATUS, (showFlags & HIST_SHOW_STATUS) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_OTHER, (showFlags & HIST_SHOW_OTHER) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(hMenu, ID_FILTER_AUTO, (showFlags & HIST_AUTO_FILTER) ? MF_CHECKED : MF_UNCHECKED);
}
bool OnInitDialog() override
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index 82b3244d91..b247a37efa 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -127,7 +127,7 @@ void vfGlobal(int, TemplateVars *vars, MCONTACT hContact, ItemData *)
void vfContact(int, TemplateVars *vars, MCONTACT hContact, ItemData *)
{
// %N: buddy's nick (not for messages)
- wchar_t *nick = Clist_GetContactDisplayName(hContact, 0);
+ wchar_t *nick = (hContact == 0) ? TranslateT("System history") : Clist_GetContactDisplayName(hContact, 0);
vars->SetVar('N', nick, false);
wchar_t buf[20];