From 9b60f3cae6ee80801deb96fcfc762ba49a1202db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Dec 2013 22:36:11 +0530 Subject: [PATCH] Edit book: Fix error when renaming the html file currently displayed in the preview panel and that file is not the file being currently edited --- src/calibre/gui2/tweak_book/boss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index b7601577d8..54ea0b0a30 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -373,6 +373,8 @@ class Boss(QObject): if oldname in editors: editors[newname] = editors.pop(oldname) self.gui.central.rename_editor(editors[newname], newname) + if self.gui.preview.current_name == oldname: + self.gui.preview.current_name = newname self.apply_container_update_to_gui() # }}}