From 4da01b6a9e9cfcf7f5d7f2103b866b7ddf7e37c1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 19 May 2024 18:52:51 +0300 Subject: Clist_GroupDelete: bool bSilent parameter added not to ask stupid questions --- include/m_clist.h | 2 +- libs/win32/mir_app.lib | Bin 295310 -> 295310 bytes src/mir_app/src/clistgroups.cpp | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/m_clist.h b/include/m_clist.h index 7b9f0bf4c4..87976056ae 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -367,7 +367,7 @@ EXTERN_C MIR_APP_DLL(void) Clist_GroupAdded(MGROUP hGroup); // deletes a group and calls CLUI to display the change // returns 0 on success, nonzero on failure -EXTERN_C MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup); +EXTERN_C MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent = false); ///////////////////////////////////////////////////////////////////////////////////////// // renames a group diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index 9b35266f66..37b8b0a798 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index f4cb7f43ac..52d331fa16 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -204,14 +204,14 @@ static bool isParentOf(const CMStringW &pParent, const wchar_t *p) } } -MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) +MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent) { // get the name CGroupInternal *pGroup = FindGroup(hGroup-1); if (pGroup == nullptr) return 1; - if (Clist::ConfirmDelete) { + if (!bSilent && Clist::ConfirmDelete) { wchar_t szQuestion[256 + 100]; mir_snwprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), pGroup->groupName); if (MessageBoxW(g_clistApi.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO) -- cgit v1.2.3