Book Details: Do not show the "Copy link" context menu item unless there is an actual link at the cursor location. Fixes #1605594 [Comments right click menu](https://bugs.launchpad.net/calibre/+bug/1605594)

This commit is contained in:
Kovid Goyal 2016-07-23 08:00:06 +05:30
parent 5323f39aa5
commit e1c3d4afb1

View File

@ -180,7 +180,7 @@ def details_context_menu_event(view, ev, book_info): # {{{
el = r.linkElement() el = r.linkElement()
data = el.attribute('data-item') data = el.attribute('data-item')
author = el.toPlainText() if unicode(el.attribute('calibre-data')) == u'authors' else None author = el.toPlainText() if unicode(el.attribute('calibre-data')) == u'authors' else None
if not url.startswith('search:'): if url and not url.startswith('search:'):
for a, t in [('copy', _('&Copy Link')), for a, t in [('copy', _('&Copy Link')),
]: ]:
ac = getattr(book_info, '%s_link_action'%a) ac = getattr(book_info, '%s_link_action'%a)