Apply changes to dictionary settings even if the user clicks cancel on the preferences dialog

This commit is contained in:
Kovid Goyal 2014-04-18 20:48:07 +05:30
parent 0f09f5670e
commit 7281b0a316

View File

@ -117,14 +117,16 @@ class Boss(QObject):
def preferences(self): def preferences(self):
p = Preferences(self.gui) p = Preferences(self.gui)
if p.exec_() == p.Accepted: ret = p.exec_()
if p.dictionaries_changed: if p.dictionaries_changed:
dictionaries.clear_caches() dictionaries.clear_caches()
dictionaries.initialize(force=True) # Reread user dictionaries dictionaries.initialize(force=True) # Reread user dictionaries
for ed in editors.itervalues(): if ret == p.Accepted:
ed.apply_settings(dictionaries_changed=p.dictionaries_changed)
setup_cssutils_serialization() setup_cssutils_serialization()
self.gui.apply_settings() 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): def mark_requested(self, name, action):
self.commit_dirty_opf() self.commit_dirty_opf()