mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 19:03:39 +02:00
...
This commit is contained in:
parent
20b2b0d5d4
commit
7af7fcf561
1 changed files with 9 additions and 8 deletions
|
|
@ -399,14 +399,15 @@ def contextMenuEvent(self, ev):
|
|||
url = data.mediaUrl()
|
||||
if url.scheme() == FAKE_PROTOCOL:
|
||||
href = url.path().lstrip('/')
|
||||
c = current_container()
|
||||
resource_name = c.href_to_name(href)
|
||||
if resource_name and c.exists(resource_name) and resource_name not in c.names_that_must_not_be_changed:
|
||||
self.add_open_with_actions(menu, resource_name)
|
||||
if data.mediaType() == data.MediaTypeImage:
|
||||
mime = c.mime_map[resource_name]
|
||||
if mime.startswith('image/'):
|
||||
menu.addAction(_('Edit %s') % resource_name, partial(self.edit_image, resource_name))
|
||||
if href:
|
||||
c = current_container()
|
||||
resource_name = c.href_to_name(href)
|
||||
if resource_name and c.exists(resource_name) and resource_name not in c.names_that_must_not_be_changed:
|
||||
self.add_open_with_actions(menu, resource_name)
|
||||
if data.mediaType() == data.MediaTypeImage:
|
||||
mime = c.mime_map[resource_name]
|
||||
if mime.startswith('image/'):
|
||||
menu.addAction(_('Edit %s') % resource_name, partial(self.edit_image, resource_name))
|
||||
menu.exec_(ev.globalPos())
|
||||
|
||||
def open_with(self, file_name, fmt, entry):
|
||||
|
|
|
|||
Loading…
Reference in a new issue