mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
bcfb519afb
@ -320,7 +320,7 @@ def mi_to_html(
|
|||||||
sidx=fmt_sidx(sidx, use_roman=use_roman_numbers), cls="series_name",
|
sidx=fmt_sidx(sidx, use_roman=use_roman_numbers), cls="series_name",
|
||||||
series=p(series), href=search_action_with_data(st, series, book_id, field),
|
series=p(series), href=search_action_with_data(st, series, book_id, field),
|
||||||
tt=p(_('Click to see books in this series')))
|
tt=p(_('Click to see books in this series')))
|
||||||
val += add_other_link('series', mi.series)
|
val += add_other_link(field, series)
|
||||||
elif metadata['datatype'] == 'datetime':
|
elif metadata['datatype'] == 'datetime':
|
||||||
aval = getattr(mi, field)
|
aval = getattr(mi, field)
|
||||||
if is_date_undefined(aval):
|
if is_date_undefined(aval):
|
||||||
|
@ -451,9 +451,12 @@ def create_copy_links(menu, data=None):
|
|||||||
library_id = '_hex_-' + library_id.encode('utf-8').hex()
|
library_id = '_hex_-' + library_id.encode('utf-8').hex()
|
||||||
book_id = get_gui().library_view.current_id
|
book_id = get_gui().library_view.current_id
|
||||||
|
|
||||||
|
all_links = []
|
||||||
def link(text, url):
|
def link(text, url):
|
||||||
def doit():
|
def doit():
|
||||||
QApplication.instance().clipboard().setText(url)
|
QApplication.instance().clipboard().setText(url)
|
||||||
|
nonlocal all_links
|
||||||
|
all_links.append(url)
|
||||||
menu.addAction(QIcon.ic('edit-copy.png'), text, doit)
|
menu.addAction(QIcon.ic('edit-copy.png'), text, doit)
|
||||||
|
|
||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
@ -473,6 +476,13 @@ def create_copy_links(menu, data=None):
|
|||||||
fmt = fmt.upper()
|
fmt = fmt.upper()
|
||||||
link(_('Link to view {} format of book').format(fmt.upper()), f'calibre://view-book/{library_id}/{book_id}/{fmt}')
|
link(_('Link to view {} format of book').format(fmt.upper()), f'calibre://view-book/{library_id}/{book_id}/{fmt}')
|
||||||
|
|
||||||
|
if all_links:
|
||||||
|
menu.addSeparator()
|
||||||
|
mi = db.new_api.get_proxy_metadata(book_id)
|
||||||
|
all_links.insert(0, '')
|
||||||
|
all_links.insert(0, mi.get('title') + ' - ' + ' & '.join(mi.get('authors')))
|
||||||
|
link(_('Copy all the above links'), '\n'.join(all_links))
|
||||||
|
|
||||||
|
|
||||||
def details_context_menu_event(view, ev, book_info, add_popup_action=False, edit_metadata=None):
|
def details_context_menu_event(view, ev, book_info, add_popup_action=False, edit_metadata=None):
|
||||||
url = view.anchorAt(ev.pos())
|
url = view.anchorAt(ev.pos())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user