Hide annots UI behind develop mode in preparation for merge into master

This commit is contained in:
Kovid Goyal 2020-06-26 17:35:42 +05:30
parent c9fe151075
commit 067e82083f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 24 additions and 19 deletions

View File

@ -1101,7 +1101,9 @@ plugins += [ActionAdd, ActionFetchAnnotations, ActionGenerateCatalog,
ActionCopyToLibrary, ActionTweakEpub, ActionUnpackBook, ActionNextMatch, ActionStore,
ActionPluginUpdater, ActionPickRandom, ActionEditToC, ActionSortBy,
ActionMarkBooks, ActionEmbed, ActionTemplateTester, ActionTagMapper, ActionAuthorMapper,
ActionVirtualLibrary, ActionBrowseAnnotations]
ActionVirtualLibrary]
if os.environ.get('CALIBRE_ENABLE_DEVELOP_MODE') == '1':
plugins.append(ActionBrowseAnnotations)
# }}}

View File

@ -318,12 +318,13 @@ class MainOverlay: # {{{
actions_div.appendChild(E.ul(
ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'),
def(): self.overlay.hide(), ui_operations.toggle_lookup();, 'library')
,
highlight_action,
ac(_('Browse highlights'), _('Browse all highlights'),
def(): self.overlay.hide(), ui_operations.toggle_highlights();, 'image')
,
))
if runtime.in_develop_mode:
actions_div.lastChild.appendChild(highlight_action)
actions_div.lastChild.appendChild(
ac(_('Browse highlights'), _('Browse all highlights'),
def(): self.overlay.hide(), ui_operations.toggle_highlights();, 'image')
)
copy_actions = E.ul()
if self.overlay.view.currently_showing.selected_text:
copy_actions.appendChild(ac(_('Copy selection'), _('Copy the current selection'), def():
@ -352,7 +353,8 @@ class MainOverlay: # {{{
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
))
else:
actions_div.appendChild(E.ul(highlight_action))
if runtime.in_develop_mode:
actions_div.appendChild(E.ul(highlight_action))
container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section
onclick=def (evt):evt.stopPropagation();,

View File

@ -3,6 +3,7 @@
from __python__ import bound_methods, hash_literals
from gettext import gettext as _
from read_book.globals import runtime
def parse_key_repr(sc):
@ -328,14 +329,13 @@ def shortcuts_definition():
_('Auto scroll slower'),
),
'create_annotation': desc(
"Ctrl+h",
'ui',
_('Create a highlight'),
),
}
if runtime.in_develop_mode:
ans.create_annotation = desc(
"Ctrl+h",
'ui',
_('Create a highlight'),
)
return ans
@ -395,11 +395,12 @@ def add_standalone_viewer_shortcuts():
'ui',
_('Toggle the toolbar'),
)
sc['toggle_highlights'] = desc(
"Ctrl+Alt+h",
'ui',
_('Toggle the highlights panel')
)
if runtime.in_develop_mode:
sc['toggle_highlights'] = desc(
"Ctrl+Alt+h",
'ui',
_('Toggle the highlights panel')
)
def create_shortcut_map(custom_shortcuts):