From 592a4198fa38d089e72e4059e4e23c58288a8e03 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 19 May 2024 19:49:50 +0300 Subject: =?UTF-8?q?fixes=20#4427=20(NewStory:=20=D0=BF=D0=BE=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BE=D0=BB=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D1=82=D0=B2=D0=BE=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D1=8F=D0=B5=D0=BC=D1=8B=D1=85=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/res/resource.rc | 2 +- plugins/NewStory/src/history_control.cpp | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'plugins') 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; -- cgit v1.2.3