From b25724a8eaa713797f543b2c3321ba3c382970a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Oct 2011 16:34:57 +0530 Subject: [PATCH] Device drivers: Add a prepare_addable_books API method --- src/calibre/devices/interface.py | 6 ++++++ src/calibre/gui2/actions/add.py | 1 + 2 files changed, 7 insertions(+) diff --git a/src/calibre/devices/interface.py b/src/calibre/devices/interface.py index 56c950bd16..ad21632a50 100644 --- a/src/calibre/devices/interface.py +++ b/src/calibre/devices/interface.py @@ -518,3 +518,9 @@ class BookList(list): ''' raise NotImplementedError() + def prepare_addable_books(self, paths): + ''' + Given a list of paths, returns another list of paths. These paths + point to addable versions of the books. + ''' + return paths diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index 08385f4f3f..dc709f221e 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -397,6 +397,7 @@ class AddAction(InterfaceAction): d = error_dialog(self.gui, _('Add to library'), _('No book files found')) d.exec_() return + paths = self.gui.device_manager.device.prepare_addable_books(paths) from calibre.gui2.add import Adder self.__adder_func = partial(self._add_from_device_adder, on_card=None, model=view.model())