mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix incorrect check for no open editor
This commit is contained in:
parent
0f7bcb432d
commit
89b7207ecf
@ -1340,15 +1340,17 @@ class Boss(QObject):
|
|||||||
try:
|
try:
|
||||||
mt = current_container().mime_map[name]
|
mt = current_container().mime_map[name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return error_dialog(self.gui, _('Does not exist'), _(
|
error_dialog(self.gui, _('Does not exist'), _(
|
||||||
'The file %s does not exist. If you were trying to click an item in'
|
'The file %s does not exist. If you were trying to click an item in'
|
||||||
' the Table of Contents, you may'
|
' the Table of Contents, you may'
|
||||||
' need to refresh it by right-clicking and choosing "Refresh".') % name, show=True)
|
' need to refresh it by right-clicking and choosing "Refresh".') % name, show=True)
|
||||||
|
return None
|
||||||
syntax = syntax_from_mime(name, mt)
|
syntax = syntax_from_mime(name, mt)
|
||||||
if not syntax:
|
if not syntax:
|
||||||
return error_dialog(
|
error_dialog(
|
||||||
self.gui, _('Unsupported file format'),
|
self.gui, _('Unsupported file format'),
|
||||||
_('Editing files of type %s is not supported') % mt, show=True)
|
_('Editing files of type %s is not supported') % mt, show=True)
|
||||||
|
return None
|
||||||
editor = self.edit_file(name, syntax)
|
editor = self.edit_file(name, syntax)
|
||||||
return editor
|
return editor
|
||||||
|
|
||||||
@ -1356,7 +1358,7 @@ class Boss(QObject):
|
|||||||
if not name:
|
if not name:
|
||||||
return
|
return
|
||||||
editor = self.open_editor_for_name(name)
|
editor = self.open_editor_for_name(name)
|
||||||
if anchor and editor is not None:
|
if anchor and hasattr(editor, 'go_to_anchor') :
|
||||||
if editor.go_to_anchor(anchor):
|
if editor.go_to_anchor(anchor):
|
||||||
self.gui.preview.pending_go_to_anchor = anchor
|
self.gui.preview.pending_go_to_anchor = anchor
|
||||||
elif show_anchor_not_found:
|
elif show_anchor_not_found:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user