From 957bfeb8418920f7ac3872ee775b2c199581bff9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Jul 2014 09:39:55 +0530 Subject: [PATCH] Add a parameter to control marking book as modified when calling apply_container_update_to_gui() --- src/calibre/gui2/tweak_book/boss.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index b72fc511c5..09601657c6 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -324,12 +324,18 @@ class Boss(QObject): container = current_container() self.gui.file_list.build(container) - def apply_container_update_to_gui(self): - ' Update all the components of the user interface to reflect the latest data in the current book container ' + def apply_container_update_to_gui(self, mark_as_modified=True): + ''' + Update all the components of the user interface to reflect the latest data in the current book container. + + :param mark_as_modified: If True, the book will be marked as modified, so the user will be prompted to save it + when quitting. + ''' self.refresh_file_list() self.update_global_history_actions() self.update_editors_from_container() - self.set_modified() + if mark_as_modified: + self.set_modified() self.gui.toc_view.update_if_visible() @in_thread_job