From 5c92a9ab45e01304df62f5767708319f2bdb61a7 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 18 Jun 2010 12:35:23 +0100 Subject: [PATCH] Check if no paths were found. Shouldn't happen, but worth the check. --- src/calibre/gui2/actions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/actions.py b/src/calibre/gui2/actions.py index ccceb96f91..f838e9c1fe 100644 --- a/src/calibre/gui2/actions.py +++ b/src/calibre/gui2/actions.py @@ -428,6 +428,10 @@ class AddAction(object): # {{{ d.exec_() return paths = [p for p in view._model.paths(rows) if p is not None] + if not paths or len(paths) == 0: + d = error_dialog(self, _('Add to library'), _('No book files found')) + d.exec_() + return from calibre.gui2.add import Adder self.__adder_func = partial(self._add_from_device_adder, on_card=None, model=view._model)