From 7281b0a316c883cb48df1c98450e60a6aa0daca1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Apr 2014 20:48:07 +0530 Subject: [PATCH] Apply changes to dictionary settings even if the user clicks cancel on the preferences dialog --- src/calibre/gui2/tweak_book/boss.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 3e4cb85c25..424a4bd4da 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -117,14 +117,16 @@ class Boss(QObject): def preferences(self): p = Preferences(self.gui) - if p.exec_() == p.Accepted: - if p.dictionaries_changed: - dictionaries.clear_caches() - dictionaries.initialize(force=True) # Reread user dictionaries - for ed in editors.itervalues(): - ed.apply_settings(dictionaries_changed=p.dictionaries_changed) + ret = p.exec_() + if p.dictionaries_changed: + dictionaries.clear_caches() + dictionaries.initialize(force=True) # Reread user dictionaries + if ret == p.Accepted: setup_cssutils_serialization() self.gui.apply_settings() + if ret == p.Accepted or p.dictionaries_changed: + for ed in editors.itervalues(): + ed.apply_settings(dictionaries_changed=p.dictionaries_changed) def mark_requested(self, name, action): self.commit_dirty_opf()