mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add an action to show the notes browser
This commit is contained in:
parent
6106cab7ee
commit
b07873586a
@ -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,]
|
||||
|
||||
# }}}
|
||||
|
||||
|
27
src/calibre/gui2/actions/browse_notes.py
Normal file
27
src/calibre/gui2/actions/browse_notes.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
# License: GPL v3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
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()
|
Loading…
x
Reference in New Issue
Block a user