mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 02:23:10 +02:00
Add a confirmation when deleting covers
This commit is contained in:
parent
eea263f744
commit
44283cdb79
1 changed files with 7 additions and 0 deletions
|
|
@ -316,6 +316,13 @@ def delete_covers(self, *args):
|
|||
ids = self._get_selected_ids()
|
||||
if not ids:
|
||||
return
|
||||
if not confirm('<p>'+ngettext(
|
||||
'The cover from the selected book will be <b>permanently deleted</b>. Are you sure?',
|
||||
'The covers from the {} selected books will be <b>permanently deleted</b>. '
|
||||
'Are you sure?', len(ids)).format(len(ids)),
|
||||
'library_delete_covers', self.gui):
|
||||
return
|
||||
|
||||
for id in ids:
|
||||
self.gui.library_view.model().db.remove_cover(id)
|
||||
self.gui.library_view.model().refresh_ids(ids)
|
||||
|
|
|
|||
Loading…
Reference in a new issue