mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Hide annots UI behind develop mode in preparation for merge into master
This commit is contained in:
parent
c9fe151075
commit
067e82083f
@ -1101,7 +1101,9 @@ plugins += [ActionAdd, ActionFetchAnnotations, ActionGenerateCatalog,
|
|||||||
ActionCopyToLibrary, ActionTweakEpub, ActionUnpackBook, ActionNextMatch, ActionStore,
|
ActionCopyToLibrary, ActionTweakEpub, ActionUnpackBook, ActionNextMatch, ActionStore,
|
||||||
ActionPluginUpdater, ActionPickRandom, ActionEditToC, ActionSortBy,
|
ActionPluginUpdater, ActionPickRandom, ActionEditToC, ActionSortBy,
|
||||||
ActionMarkBooks, ActionEmbed, ActionTemplateTester, ActionTagMapper, ActionAuthorMapper,
|
ActionMarkBooks, ActionEmbed, ActionTemplateTester, ActionTagMapper, ActionAuthorMapper,
|
||||||
ActionVirtualLibrary, ActionBrowseAnnotations]
|
ActionVirtualLibrary]
|
||||||
|
if os.environ.get('CALIBRE_ENABLE_DEVELOP_MODE') == '1':
|
||||||
|
plugins.append(ActionBrowseAnnotations)
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
@ -318,12 +318,13 @@ class MainOverlay: # {{{
|
|||||||
actions_div.appendChild(E.ul(
|
actions_div.appendChild(E.ul(
|
||||||
ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'),
|
ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'),
|
||||||
def(): self.overlay.hide(), ui_operations.toggle_lookup();, 'library')
|
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()
|
copy_actions = E.ul()
|
||||||
if self.overlay.view.currently_showing.selected_text:
|
if self.overlay.view.currently_showing.selected_text:
|
||||||
copy_actions.appendChild(ac(_('Copy selection'), _('Copy the current selection'), def():
|
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'),
|
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
|
||||||
))
|
))
|
||||||
else:
|
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
|
container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section
|
||||||
onclick=def (evt):evt.stopPropagation();,
|
onclick=def (evt):evt.stopPropagation();,
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
from __python__ import bound_methods, hash_literals
|
from __python__ import bound_methods, hash_literals
|
||||||
|
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
from read_book.globals import runtime
|
||||||
|
|
||||||
|
|
||||||
def parse_key_repr(sc):
|
def parse_key_repr(sc):
|
||||||
@ -328,14 +329,13 @@ def shortcuts_definition():
|
|||||||
_('Auto scroll slower'),
|
_('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
|
return ans
|
||||||
|
|
||||||
|
|
||||||
@ -395,11 +395,12 @@ def add_standalone_viewer_shortcuts():
|
|||||||
'ui',
|
'ui',
|
||||||
_('Toggle the toolbar'),
|
_('Toggle the toolbar'),
|
||||||
)
|
)
|
||||||
sc['toggle_highlights'] = desc(
|
if runtime.in_develop_mode:
|
||||||
"Ctrl+Alt+h",
|
sc['toggle_highlights'] = desc(
|
||||||
'ui',
|
"Ctrl+Alt+h",
|
||||||
_('Toggle the highlights panel')
|
'ui',
|
||||||
)
|
_('Toggle the highlights panel')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_shortcut_map(custom_shortcuts):
|
def create_shortcut_map(custom_shortcuts):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user