diff options
-rw-r--r-- | plugins/DbEditorPP/src/settinglist.cpp | 35 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/version.h | 2 |
2 files changed, 29 insertions, 8 deletions
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 96264fd906..be155a86c8 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -126,25 +126,46 @@ void DeleteSettingsFromList(MCONTACT hContact, const char *module, const char *s if (g_plugin.bWarnOnDelete) {
wchar_t text[MSG_SIZE];
- mir_snwprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
+ if (info.hContact == 0)
+ mir_snwprintf(text, TranslateT("Are you sure you want to delete %d contact(s)?"), count);
+ else
+ mir_snwprintf(text, TranslateT("Are you sure you want to delete %d setting(s)?"), count);
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return;
}
- if (count == 1)
- db_unset(hContact, module, setting);
- else {
+ if (hContact == 0) {
int items = ListView_GetItemCount(hwnd2List);
for (int i = 0; i < items;) {
if (ListView_GetItemState(hwnd2List, i, LVIS_SELECTED)) {
- char text[FLD_SIZE];
- if (ListView_GetItemTextA(hwnd2List, i, 0, text, _countof(text)))
- db_unset(hContact, module, text);
+ LVITEM lvi = {};
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = i;
+ if (ListView_GetItem(hwnd2List, &lvi)) {
+ db_delete_contact(MCONTACT(lvi.lParam));
+ ListView_DeleteItem(hwnd2List, i);
+ }
items--;
}
else i++;
}
}
+ else {
+ if (count == 1)
+ db_unset(hContact, module, setting);
+ else {
+ int items = ListView_GetItemCount(hwnd2List);
+ for (int i = 0; i < items;) {
+ if (ListView_GetItemState(hwnd2List, i, LVIS_SELECTED)) {
+ char text[FLD_SIZE];
+ if (ListView_GetItemTextA(hwnd2List, i, 0, text, _countof(text)))
+ db_unset(hContact, module, text);
+ items--;
+ }
+ else i++;
+ }
+ }
+ }
if (ListView_GetItemCount(hwnd2List) == 0)
replaceTreeItem(hContact, module, nullptr);
diff --git a/plugins/DbEditorPP/src/version.h b/plugins/DbEditorPP/src/version.h index f731cc7a12..5d41638d3e 100644 --- a/plugins/DbEditorPP/src/version.h +++ b/plugins/DbEditorPP/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 4 #define __MINOR_VERSION 0 #define __RELEASE_NUM 2 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include <stdver.h> |