Fix #1934685 [[Enhancement - Content server] Add shortcuts to actions in the Book details page and display them in the tooltips](https://bugs.launchpad.net/calibre/+bug/1934685)

This commit is contained in:
Kovid Goyal 2021-07-08 08:44:11 +05:30
parent 99fbccc8a1
commit 8702b759b1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -556,8 +556,8 @@ def add_top_bar_buttons(container_id):
container = document.getElementById(container_id) container = document.getElementById(container_id)
if container: if container:
clear_buttons(container) clear_buttons(container)
add_button(container, 'convert', action=convert_book, tooltip=_('Convert this book to another format')) add_button(container, 'convert', action=convert_book, tooltip=_('Convert this book to another format [C]'))
add_button(container, 'edit', action=edit_metadata, tooltip=_('Edit the metadata for this book')) add_button(container, 'edit', action=edit_metadata, tooltip=_('Edit the metadata for this book [E]'))
add_button(container, 'trash', action=delete_book, tooltip=_('Delete this book')) add_button(container, 'trash', action=delete_book, tooltip=_('Delete this book'))
book_id = parse_url_params().book_id book_id = parse_url_params().book_id
if book_id is '0': if book_id is '0':
@ -724,6 +724,10 @@ def onkeydown(container_id, close_action, ev):
delete_book() delete_book()
elif ev.key is 'v' or ev.key is 'V': elif ev.key is 'v' or ev.key is 'V':
read_book(render_book.book_id) read_book(render_book.book_id)
elif ev.key is 'c' or ev.key is 'C':
convert_book()
elif ev.key is 'e' or ev.key is 'E':
edit_metadata()
def init(container_id): def init(container_id):