From cad142847a376ed303fa596fba319a9ce0c1ac1c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Feb 2022 08:23:56 +0530 Subject: [PATCH] Fix #1960586 [[Enhancement] Remove multiple email address at once](https://bugs.launchpad.net/calibre/+bug/1960586) --- src/calibre/gui2/preferences/email.ui | 4 ++-- src/calibre/gui2/preferences/emailp.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/preferences/email.ui b/src/calibre/gui2/preferences/email.ui index 515855aa79..58f2b714b5 100644 --- a/src/calibre/gui2/preferences/email.ui +++ b/src/calibre/gui2/preferences/email.ui @@ -17,7 +17,7 @@ - <p>calibre can send your books to you (or your reader) by email. Emails will be automatically sent for downloaded news to all email addresses that have <i>Auto send</i> checked. + <p>calibre can send your books to you (or your reader) by email. Emails will be automatically sent for downloaded news to all email addresses that have <i>Auto send</i> checked. true @@ -29,7 +29,7 @@ - QAbstractItemView::SingleSelection + QAbstractItemView::MultiSelection QAbstractItemView::SelectRows diff --git a/src/calibre/gui2/preferences/emailp.py b/src/calibre/gui2/preferences/emailp.py index 79c8492961..74c2526263 100644 --- a/src/calibre/gui2/preferences/emailp.py +++ b/src/calibre/gui2/preferences/emailp.py @@ -270,8 +270,11 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self.changed_signal.emit() def remove_email_account(self, *args): - idx = self.email_view.currentIndex() - self._email_accounts.remove(idx) + row_map = {} + for idx in self.email_view.selectionModel().selectedIndexes(): + row_map[idx.row()] = idx + for idx in sorted(row_map.values(), reverse=True): + self._email_accounts.remove(idx) self.changed_signal.emit() def refresh_gui(self, gui):