summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-05-19 19:49:50 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-05-19 19:49:50 +0300
commit592a4198fa38d089e72e4059e4e23c58288a8e03 (patch)
treed9e841fb9182739b870877eea50c03e252a25fc3
parent886bb2f274b00560771483117dac0a4d940b4145 (diff)
fixes #4427 (NewStory: показывать количество удаляемых событий)
-rw-r--r--plugins/NewStory/res/resource.rc2
-rw-r--r--plugins/NewStory/src/history_control.cpp16
2 files changed, 15 insertions, 3 deletions
diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc
index 30bcff5f33..5e7865b697 100644
--- a/plugins/NewStory/res/resource.rc
+++ b/plugins/NewStory/res/resource.rc
@@ -191,7 +191,7 @@ EXSTYLE WS_EX_CONTROLPARENT
CAPTION "Empty history"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Are you sure to remove selected event(s)?",IDC_TOPLINE,
+ CONTROL "Do you really want to delete selected item?",IDC_TOPLINE,
"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8
CONTROL "Remove server history",IDC_DELSERVERHISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,37,280,8
CONTROL "Remove history for everyone",IDC_BOTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,50,260,8
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index e0f8c3b591..6dcbe71252 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -324,15 +324,17 @@ void NewstoryListData::CopyUrl()
class CDeleteEventsDlg : public CDlgBase
{
+ int m_iNumEvents;
MCONTACT m_hContact;
CCtrlCheck chkDelHistory, chkForEveryone;
public:
bool bDelHistory = false, bForEveryone = false;
- CDeleteEventsDlg(MCONTACT hContact) :
+ CDeleteEventsDlg(MCONTACT hContact, int nEvents) :
CDlgBase(g_plugin, IDD_EMPTYHISTORY),
m_hContact(hContact),
+ m_iNumEvents(nEvents),
chkDelHistory(this, IDC_DELSERVERHISTORY),
chkForEveryone(this, IDC_BOTH)
{
@@ -351,6 +353,11 @@ public:
chkForEveryone.SetState(!bEnabled);
chkForEveryone.Enable(bEnabled);
+ if (m_iNumEvents > 1) {
+ CMStringW wszText(FORMAT, TranslateT("Do you really want to delete selected items (%d)?"), m_iNumEvents);
+ SetDlgItemTextW(m_hwnd, IDC_TOPLINE, wszText);
+ }
+
LOGFONT lf;
HFONT hFont = (HFONT)SendDlgItemMessage(m_hwnd, IDOK, WM_GETFONT, 0, 0);
GetObject(hFont, sizeof(lf), &lf);
@@ -377,7 +384,12 @@ public:
void NewstoryListData::DeleteItems(void)
{
- CDeleteEventsDlg dlg(m_hContact);
+ int nSelected = 0;
+ for (int i = totalCount - 1; i >= 0; i--)
+ if (GetItem(i)->m_bSelected)
+ nSelected++;
+
+ CDeleteEventsDlg dlg(m_hContact, nSelected);
if (IDOK != dlg.DoModal())
return;