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)
|
QWebEngineUrlScheme.registerScheme(scheme)
|
||||||
override = 'calibre-ebook-viewer' if islinux else None
|
override = 'calibre-ebook-viewer' if islinux else None
|
||||||
processed_args = []
|
processed_args = []
|
||||||
internal_book_data = None
|
internal_book_data = internal_book_data_path = None
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.startswith('--internal-book-data='):
|
if arg.startswith('--internal-book-data='):
|
||||||
internal_book_data = arg.split('=', 1)[1]
|
internal_book_data_path = arg.split('=', 1)[1]
|
||||||
continue
|
continue
|
||||||
processed_args.append(arg)
|
processed_args.append(arg)
|
||||||
if internal_book_data:
|
if internal_book_data_path:
|
||||||
try:
|
try:
|
||||||
with lopen(internal_book_data, 'rb') as f:
|
with lopen(internal_book_data_path, 'rb') as f:
|
||||||
internal_book_data = json.load(f)
|
internal_book_data = json.load(f)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
os.remove(internal_book_data)
|
os.remove(internal_book_data_path)
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
pass
|
pass
|
||||||
args = processed_args
|
args = processed_args
|
||||||
|
@ -4,8 +4,6 @@ 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):
|
||||||
parts = sc.split('+')
|
parts = sc.split('+')
|
||||||
@ -330,13 +328,13 @@ def shortcuts_definition():
|
|||||||
_('Auto scroll slower'),
|
_('Auto scroll slower'),
|
||||||
),
|
),
|
||||||
|
|
||||||
}
|
'create_annotation': desc(
|
||||||
if runtime.in_develop_mode:
|
|
||||||
ans.create_annotation = desc(
|
|
||||||
"Ctrl+h",
|
"Ctrl+h",
|
||||||
'ui',
|
'ui',
|
||||||
_('Create a highlight'),
|
_('Create a highlight'),
|
||||||
)
|
),
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
@ -397,7 +395,6 @@ def add_standalone_viewer_shortcuts():
|
|||||||
'ui',
|
'ui',
|
||||||
_('Toggle the toolbar'),
|
_('Toggle the toolbar'),
|
||||||
)
|
)
|
||||||
if runtime.in_develop_mode:
|
|
||||||
sc['toggle_highlights'] = desc(
|
sc['toggle_highlights'] = desc(
|
||||||
"Ctrl+Alt+h",
|
"Ctrl+Alt+h",
|
||||||
'ui',
|
'ui',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user