From 0c231f4c1c9ae7c8683f99f34e586835c53c6e81 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 17 May 2024 08:38:14 +0530 Subject: [PATCH] Edit book: Save the state of the current book when opening a new book via File->Open book --- 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 eb297da47e..a4a97b78d9 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -350,6 +350,8 @@ class Boss(QObject): if self.file_was_readonly: warning_dialog(self.gui, _('Read-only file'), _( 'The file {} is read-only. Saving changes to it will either fail or cause its permissions to be reset.').format(path), show=True) + with self.editor_cache: + self.save_book_edit_state() for name in tuple(editors): self.close_editor(name)