mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow specifying a non-existent folder when creating a new library. The folder is automatically created
This commit is contained in:
parent
b41c55e811
commit
581d15d8eb
@ -180,8 +180,11 @@ class ChooseLibrary(QDialog, Ui_Dialog):
|
|||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST:
|
||||||
raise
|
raise
|
||||||
if not loc or not os.path.exists(loc) or not os.path.isdir(loc):
|
if not loc or not os.path.exists(loc) or not os.path.isdir(loc):
|
||||||
return error_dialog(self, _('Bad location'),
|
if action == 'new' and not os.path.exists(loc):
|
||||||
_('%s is not an existing folder')%loc, show=True)
|
os.makedirs(loc)
|
||||||
|
else:
|
||||||
|
return error_dialog(self, _('Bad location'),
|
||||||
|
_('%s is not an existing folder')%loc, show=True)
|
||||||
if not self.check_action(action, loc):
|
if not self.check_action(action, loc):
|
||||||
return
|
return
|
||||||
self.location.save_history()
|
self.location.save_history()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user