[chirp_devel] [PATCH] [UI] Update default for "Hide Unused Fields" - 2nd attempt

Jim Unroe
Wed Jul 23 16:04:07 PDT 2014


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1406156626 14400
# Node ID c25cf3d1d11bc910d72dc2965623f2a3182ae4ce
# Parent  832afc1a783c279c9567c09fa2eeae89396b3c02
[UI] Update default for "Hide Unused Fields" - 2nd attempt

Set "Hide Unused Fields" to be enabled by default

#1779

diff -r 832afc1a783c -r c25cf3d1d11b chirpui/config.py
--- a/chirpui/config.py	Tue Jul 22 19:31:33 2014 -0400
+++ b/chirpui/config.py	Wed Jul 23 19:03:46 2014 -0400
@@ -96,8 +96,12 @@
 
         self.set(key, "%i" % value, section)
        
-    def get_bool(self, key, section=None):
-        return self.get(key, section) == "True"
+    def get_bool(self, key, section=None, default=False):
+        val = self.get(key, section)
+        if val is None:
+            return default
+        else:
+            return val == "True"
 
     def set_bool(self, key, value, section=None):
         self.set(key, str(bool(value)), section)
diff -r 832afc1a783c -r c25cf3d1d11b chirpui/mainapp.py
--- a/chirpui/mainapp.py	Tue Jul 22 19:31:33 2014 -0400
+++ b/chirpui/mainapp.py	Wed Jul 23 19:03:46 2014 -0400
@@ -1555,7 +1555,7 @@
 
         conf = config.get()
         re = not conf.get_bool("no_report");
-        hu = conf.get_bool("hide_unused", "memedit")
+        hu = conf.get_bool("hide_unused", "memedit", default=True)
         dv = conf.get_bool("developer", "state")
         st = not conf.get_bool("no_smart_tmode", "memedit")
 



More information about the chirp_devel mailing list