mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the highlight shortcuts always available
This commit is contained in:
parent
dbc9700329
commit
8e2ff38dd5
@ -197,19 +197,19 @@ def main(args=sys.argv):
|
||||
QWebEngineUrlScheme.registerScheme(scheme)
|
||||
override = 'calibre-ebook-viewer' if islinux else None
|
||||
processed_args = []
|
||||
internal_book_data = None
|
||||
internal_book_data = internal_book_data_path = None
|
||||
for arg in args:
|
||||
if arg.startswith('--internal-book-data='):
|
||||
internal_book_data = arg.split('=', 1)[1]
|
||||
internal_book_data_path = arg.split('=', 1)[1]
|
||||
continue
|
||||
processed_args.append(arg)
|
||||
if internal_book_data:
|
||||
if internal_book_data_path:
|
||||
try:
|
||||
with lopen(internal_book_data, 'rb') as f:
|
||||
with lopen(internal_book_data_path, 'rb') as f:
|
||||
internal_book_data = json.load(f)
|
||||
finally:
|
||||
try:
|
||||
os.remove(internal_book_data)
|
||||
os.remove(internal_book_data_path)
|
||||
except EnvironmentError:
|
||||
pass
|
||||
args = processed_args
|
||||
|
@ -4,8 +4,6 @@ from __python__ import bound_methods, hash_literals
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
from read_book.globals import runtime
|
||||
|
||||
|
||||
def parse_key_repr(sc):
|
||||
parts = sc.split('+')
|
||||
@ -330,13 +328,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
|
||||
|
||||
@ -397,12 +395,11 @@ def add_standalone_viewer_shortcuts():
|
||||
'ui',
|
||||
_('Toggle the toolbar'),
|
||||
)
|
||||
if runtime.in_develop_mode:
|
||||
sc['toggle_highlights'] = desc(
|
||||
"Ctrl+Alt+h",
|
||||
'ui',
|
||||
_('Toggle the highlights panel')
|
||||
)
|
||||
sc['toggle_highlights'] = desc(
|
||||
"Ctrl+Alt+h",
|
||||
'ui',
|
||||
_('Toggle the highlights panel')
|
||||
)
|
||||
|
||||
|
||||
def create_shortcut_map(custom_shortcuts):
|
||||
|
Loading…
x
Reference in New Issue
Block a user