diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index bdb3b695f0..ccc74956dd 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -51,7 +51,10 @@ d['custom_themes'] = {} d['remove_unused_classes'] = False d['global_book_toolbar'] = [ 'new-file', 'open-book', 'save-book', None, 'global-undo', 'global-redo', 'create-checkpoint', None, 'donate', 'user-manual'] -d['global_tools_toolbar'] = ['check-book', 'spell-check-book', 'edit-toc', 'insert-character', 'manage-fonts', 'smarten-punctuation', 'remove-unused-css'] +d['global_tools_toolbar'] = [ + 'check-book', 'spell-check-book', 'edit-toc', 'insert-character', + 'manage-fonts', 'smarten-punctuation', 'remove-unused-css', 'show-reports' +] d['global_plugins_toolbar'] = [] d['editor_common_toolbar'] = [('editor-' + x) if x else None for x in ('undo', 'redo', None, 'cut', 'copy', 'paste')] d['editor_css_toolbar'] = ['pretty-current', 'insert-image'] diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index e5e9cb5358..4667337bc3 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1165,6 +1165,9 @@ class Boss(QObject): self.gui.image_browser.raise_() def show_reports(self): + if current_container() is None: + return error_dialog(self.gui, _('No book open'), _( + 'You must first open a book in order to see the report.'), show=True) self.gui.reports.refresh() self.gui.reports.show() self.gui.reports.raise_()