diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index f2fc49277e..37729bd04d 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -855,6 +855,12 @@ class ActionBrowseAnnotations(InterfaceActionBase): description = _('Browse highlights and bookmarks from all books in the library') +class ActionBrowseNotes(InterfaceActionBase): + name = 'Browse Notes' + actual_plugin = 'calibre.gui2.actions.browse_notes:BrowseNotesAction' + description = _('Browse notes for authors, tags, etc. in the library') + + class ActionFullTextSearch(InterfaceActionBase): name = 'Full Text Search' actual_plugin = 'calibre.gui2.actions.fts:FullTextSearchAction' @@ -1133,7 +1139,7 @@ plugins += [ActionAdd, ActionFetchAnnotations, ActionGenerateCatalog, ActionMarkBooks, ActionEmbed, ActionTemplateTester, ActionTagMapper, ActionAuthorMapper, ActionVirtualLibrary, ActionBrowseAnnotations, ActionTemplateFunctions, ActionAutoscrollBooks, ActionFullTextSearch, ActionManageCategories, ActionBooklistContextMenu, ActionSavedSearches, - ActionLayoutActions] + ActionLayoutActions, ActionBrowseNotes,] # }}} diff --git a/src/calibre/gui2/actions/browse_notes.py b/src/calibre/gui2/actions/browse_notes.py new file mode 100644 index 0000000000..8f7677a7f1 --- /dev/null +++ b/src/calibre/gui2/actions/browse_notes.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# License: GPL v3 Copyright: 2020, Kovid Goyal + + +from calibre.gui2.actions import InterfaceAction + + +class BrowseNotesAction(InterfaceAction): + + name = 'Browse Notes' + action_spec = (_('Browse notes'), 'notes.png', + _('Browse notes for authors, tags, etc. in the library'), _('Ctrl+Shift+N')) + dont_add_to = frozenset(('context-menu-device',)) + action_type = 'current' + + def genesis(self): + self.d = None + self.qaction.triggered.connect(self.show_browser) + + def show_browser(self): + if self.d is not None and self.d.isVisible(): + self.d.raise_() + self.d.activateWindow() + else: + from calibre.gui2.library.notes import NotesBrowser + self.d = NotesBrowser(self.gui) + self.d.show()