From 5da59094c93ddd515eff3afabf176177c1eda3c8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Feb 2014 15:28:14 +0530 Subject: [PATCH] Show an error message if the user tries to edit books on the device instead of editing the last selected book in the library --- src/calibre/gui2/actions/tweak_epub.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/actions/tweak_epub.py b/src/calibre/gui2/actions/tweak_epub.py index 375917c620..ca6ed9a460 100755 --- a/src/calibre/gui2/actions/tweak_epub.py +++ b/src/calibre/gui2/actions/tweak_epub.py @@ -97,6 +97,9 @@ class TweakEpubAction(InterfaceAction): self.do_tweak(book_id) def do_tweak(self, book_id): + if self.gui.current_view() is not self.gui.library_view: + return error_dialog(self.gui, _('Cannot Edit Book'), _( + 'Editing of books on the device is not supported'), show=True) from calibre.ebooks.oeb.polish.main import SUPPORTED db = self.gui.library_view.model().db fmts = db.formats(book_id, index_is_id=True) or ''