From 3cb0d291705a85c06c0f1a5061d01bf6e881faaf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 18 May 2014 08:01:32 +0530 Subject: [PATCH] Dont show an error message when trying to use quick open with no book open --- src/calibre/gui2/tweak_book/boss.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 15b8e39c20..3e352fb0e0 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1093,6 +1093,9 @@ class Boss(QObject): def quick_open(self): c = current_container() + if c is None: + return error_dialog(self.gui, _('No open book'), _( + 'No book is currently open. You must first open a book to edit.'), show=True) files = [name for name, mime in c.mime_map.iteritems() if c.exists(name) and syntax_from_mime(name, mime) is not None] d = QuickOpen(files, parent=self.gui) if d.exec_() == d.Accepted and d.selected_result is not None: