Show error message if user selects non existing folder in choose library dialog

This commit is contained in:
Kovid Goyal 2010-08-13 14:09:58 -06:00
parent 78f14b5500
commit 8dbced9063

View File

@ -80,8 +80,10 @@ class ChooseLibrary(QDialog, Ui_Dialog):
return error_dialog(self, _('No location'), _('No location selected'), return error_dialog(self, _('No location'), _('No location selected'),
show=True) show=True)
loc = os.path.abspath(text) loc = os.path.abspath(text)
if not loc or not os.path.exists(loc) or not self.check_action(action, if not loc or not os.path.exists(loc) or not os.path.isdir(loc):
loc): return error_dialog(self, _('Bad location'),
_('%s is not an existing folder')%loc, show=True)
if not self.check_action(action, loc):
return return
QDialog.accept(self) QDialog.accept(self)
self.location.save_history() self.location.save_history()