Fix #1960586 [[Enhancement] Remove multiple email address at once](https://bugs.launchpad.net/calibre/+bug/1960586)

This commit is contained in:
Kovid Goyal 2022-02-16 08:23:56 +05:30
parent ff2bc6ecf7
commit cad142847a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 4 deletions

View File

@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="label_22">
<property name="text">
<string>&lt;p&gt;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 &lt;i&gt;Auto send&lt;/i&gt; checked.</string>
<string>&lt;p&gt;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 &lt;i&gt;Auto send&lt;/i&gt; checked.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -29,7 +29,7 @@
<item>
<widget class="QTableView" name="email_view">
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>

View File

@ -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):