diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index 32460b6bec..f96a261790 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import os, shutil +import os from functools import partial from PyQt4.Qt import QMenu, Qt, QInputDialog, QToolButton @@ -14,7 +14,7 @@ from calibre import isbytestring from calibre.constants import filesystem_encoding, iswindows from calibre.utils.config import prefs from calibre.gui2 import (gprefs, warning_dialog, Dispatcher, error_dialog, - question_dialog, info_dialog) + question_dialog, info_dialog, open_local_file) from calibre.library.database2 import LibraryDatabase2 from calibre.gui2.actions import InterfaceAction @@ -107,7 +107,7 @@ class ChooseLibraryAction(InterfaceAction): self.quick_menu_action = self.choose_menu.addMenu(self.quick_menu) self.rename_menu = QMenu(_('Rename library')) self.rename_menu_action = self.choose_menu.addMenu(self.rename_menu) - self.delete_menu = QMenu(_('Delete library')) + self.delete_menu = QMenu(_('Remove library')) self.delete_menu_action = self.choose_menu.addMenu(self.delete_menu) ac = self.create_action(spec=(_('Pick a random book'), 'catalog.png', @@ -252,22 +252,15 @@ class ChooseLibraryAction(InterfaceAction): def delete_requested(self, name, location): loc = location.replace('/', os.sep) - if not question_dialog(self.gui, _('Are you sure?'), - _('

WARNING

')+ - _('All files (not just ebooks) ' - 'from

%s

will be ' - 'permanently deleted. Are you sure?') % loc, - show_copy_button=False, default_yes=False): - return - exists = self.gui.library_view.model().db.exists_at(loc) - if exists: - try: - shutil.rmtree(loc, ignore_errors=True) - except: - pass 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) + open_local_file(loc) def backup_status(self, location): dirty_text = 'no'