mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #6392 (Save to disk to be forbidden into library)
This commit is contained in:
parent
47e56e8cbe
commit
62c4b2860d
@ -927,6 +927,14 @@ class SaveToDiskAction(object): # {{{
|
|||||||
_('Choose destination directory'))
|
_('Choose destination directory'))
|
||||||
if not path:
|
if not path:
|
||||||
return
|
return
|
||||||
|
dpath = os.path.abspath(path).replace('/', os.sep)
|
||||||
|
lpath = self.library_view.model().db.library_path.replace('/', os.sep)
|
||||||
|
if dpath.startswith(lpath):
|
||||||
|
return error_dialog(self, _('Not allowed'),
|
||||||
|
_('You are tying to save files into the calibre '
|
||||||
|
'library. This can cause corruption of your '
|
||||||
|
'library. Save to disk is meant to export '
|
||||||
|
'files from your calibre library elsewhere.'), show=True)
|
||||||
|
|
||||||
if self.current_view() is self.library_view:
|
if self.current_view() is self.library_view:
|
||||||
from calibre.gui2.add import Saver
|
from calibre.gui2.add import Saver
|
||||||
|
Loading…
x
Reference in New Issue
Block a user