Edit Book: Add the reports tool to the toolbar by default

Also do not raise an exception when running reports with no book open.
This commit is contained in:
Kovid Goyal 2015-04-11 09:42:43 +05:30
parent 8ec93d806f
commit bb8dc6d095
2 changed files with 7 additions and 1 deletions

View File

@ -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']

View File

@ -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_()