Edit book: Save the state of the current book when opening a new book via File->Open book

This commit is contained in:
Kovid Goyal 2024-05-17 08:38:14 +05:30
parent 988515665f
commit 0c231f4c1c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)