Implement #6392 (Save to disk to be forbidden into library)

This commit is contained in:
Kovid Goyal 2010-08-05 13:32:00 -06:00
parent 47e56e8cbe
commit 62c4b2860d

View File

@ -927,6 +927,14 @@ class SaveToDiskAction(object): # {{{
_('Choose destination directory'))
if not path:
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:
from calibre.gui2.add import Saver