mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 14:35:46 +02:00
When removing a library from calibre, allow undoing the action
This commit is contained in:
parent
ecb64743eb
commit
058a61912c
1 changed files with 8 additions and 5 deletions
|
|
@ -413,14 +413,17 @@ def rename_requested(self, name, location):
|
|||
|
||||
def delete_requested(self, name, location):
|
||||
loc = location.replace('/', os.sep)
|
||||
if not question_dialog(
|
||||
self.gui, _('Library removed'), _(
|
||||
'The library %s has been removed from calibre. '
|
||||
'The files remain on your computer, if you want '
|
||||
'to delete them, you will have to do so manually.') % ('<code>%s</code>' % loc),
|
||||
override_icon='dialog_information.png',
|
||||
yes_text=_('&OK'), no_text=_('&Undo'), yes_icon='ok.png', no_icon='edit-undo.png'):
|
||||
return
|
||||
self.stats.remove(location)
|
||||
self.build_menus()
|
||||
self.gui.iactions['Copy To Library'].build_menus()
|
||||
info_dialog(self.gui, _('Library removed'),
|
||||
_('The library %s has been removed from calibre. '
|
||||
'The files remain on your computer, if you want '
|
||||
'to delete them, you will have to do so manually.') % loc,
|
||||
show=True)
|
||||
if os.path.exists(loc):
|
||||
open_local_file(loc)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue