diff options
author | George Hazan <george.hazan@gmail.com> | 2024-05-19 19:49:50 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-05-19 19:49:50 +0300 |
commit | 592a4198fa38d089e72e4059e4e23c58288a8e03 (patch) | |
tree | d9e841fb9182739b870877eea50c03e252a25fc3 /plugins/NewStory/src | |
parent | 886bb2f274b00560771483117dac0a4d940b4145 (diff) |
fixes #4427 (NewStory: показывать количество удаляемых событий)
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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;
|