Skip to content

Commit

Permalink
Edit book: Save the state of the current book when opening a new book…
Browse files Browse the repository at this point in the history
… via File->Open book
  • Loading branch information
kovidgoyal committed May 17, 2024
1 parent 9885156 commit 0c231f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/calibre/gui2/tweak_book/boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def open_book(self, path=None, edit_file=None, clear_notify_data=True, open_fold
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)
Expand Down

0 comments on commit 0c231f4

Please sign in to comment.