Finer grain defaults.* change reporting
authorJack Miller <jack@codezen.org>
Tue, 17 Mar 2015 16:41:12 +0000 (11:41 -0500)
committerJack Miller <jack@codezen.org>
Tue, 17 Mar 2015 16:41:12 +0000 (11:41 -0500)
canto_curses/config.py

index 06561a6..16591d3 100644 (file)
@@ -814,14 +814,21 @@ class CantoCursesConfig(SubThread):
 
         if "defaults" in given:
 
-            # We don't honor any default settings, so just record them
-            # and pass them on to the daemon if write
+            changes = {}
+
+            for key in given["defaults"]:
+                if key in self.daemon_defaults:
+                    if given["defaults"][key] != self.daemon_defaults[key]:
+                        changes[key] = given["defaults"][key]
+                else:
+                    changes[key] = given["defaults"][key]
+
+            self.daemon_defaults.update(changes)
 
-            self.daemon_defaults.update(given["defaults"])
             if write:
                 self.write("SETCONFIGS", { "defaults" : self.daemon_defaults })
 
-            call_hook("curses_def_opt_change", [ given["defaults"] ])
+            call_hook("curses_def_opt_change", [ changes ])
 
         if "feeds" in given: