mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
A nicer error message when a no longer existing link is activated
This commit is contained in:
parent
8fc809ae0c
commit
6a4d56c839
@ -710,7 +710,14 @@ class Boss(QObject):
|
|||||||
editor = editors[name]
|
editor = editors[name]
|
||||||
self.gui.central.show_editor(editor)
|
self.gui.central.show_editor(editor)
|
||||||
else:
|
else:
|
||||||
syntax = syntax_from_mime(name, current_container().mime_map[name])
|
try:
|
||||||
|
mt = current_container().mime_map[name]
|
||||||
|
except KeyError:
|
||||||
|
return error_dialog(self.gui, _('Does not exist'), _(
|
||||||
|
'The file %s does not exist. If you were trying to click a'
|
||||||
|
' link in the preview panel or the Table of Contents, you may'
|
||||||
|
' need to refresh them by right-clicking and choosing "Refresh".') % name, show=True)
|
||||||
|
syntax = syntax_from_mime(name, mt)
|
||||||
editor = self.edit_file(name, syntax)
|
editor = self.edit_file(name, syntax)
|
||||||
if anchor:
|
if anchor:
|
||||||
editor.go_to_anchor(anchor)
|
editor.go_to_anchor(anchor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user