From 8dbced9063f1d2a8381ad862f62ae56b50cba7b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Aug 2010 14:09:58 -0600 Subject: [PATCH] Show error message if user selects non existing folder in choose library dialog --- src/calibre/gui2/dialogs/choose_library.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/dialogs/choose_library.py b/src/calibre/gui2/dialogs/choose_library.py index bf1741cd87..32d45c6043 100644 --- a/src/calibre/gui2/dialogs/choose_library.py +++ b/src/calibre/gui2/dialogs/choose_library.py @@ -80,8 +80,10 @@ class ChooseLibrary(QDialog, Ui_Dialog): return error_dialog(self, _('No location'), _('No location selected'), show=True) loc = os.path.abspath(text) - if not loc or not os.path.exists(loc) or not self.check_action(action, - loc): + if not loc or not os.path.exists(loc) or not os.path.isdir(loc): + return error_dialog(self, _('Bad location'), + _('%s is not an existing folder')%loc, show=True) + if not self.check_action(action, loc): return QDialog.accept(self) self.location.save_history()