[chirp_devel] [PATCH] [th9800] change name/freq display behavior to be automatic #1353
Jens Jensen
Thu Jan 29 05:24:52 PST 2015
# HG changeset patch
# User Jens Jensen <af5mi at yahoo.com>
# Date 1422537841 21600
# Thu Jan 29 07:24:01 2015 -0600
# Node ID f1e77e243ab445a8d0e0b44f6d76fde39c2c180c
# Parent ebeb7fdb70a7b00b5424394b0a7731b379ea997b
[th9800] change name/freq display behavior to be automatic #1353
Add automatic behavior so that channel name is displayed if it is set, and
freq is show if name is blank. Still allows manual override by user.
diff -r ebeb7fdb70a7 -r f1e77e243ab4 chirp/th9800.py
--- a/chirp/th9800.py Sun Jan 25 08:38:55 2015 -0600
+++ b/chirp/th9800.py Thu Jan 29 07:24:01 2015 -0600
@@ -359,6 +359,21 @@
_mem.name = mem.name.ljust(6, "\xFF")
+ # autoset display to name if filled, else show frequency
+ if mem.extra:
+ # mem.extra only seems to be populated when called from edit panel
+ display = mem.extra["display"]
+ else:
+ display = None
+ if mem.name:
+ _mem.display = True
+ if display and not display.changed():
+ display.value = "Name"
+ else:
+ _mem.display = False
+ if display and not display.changed():
+ display.value = "Frequency"
+
_mem.scan = SCAN_MODES.index(mem.skip)
if mem.mode == "AM":
@@ -372,6 +387,8 @@
_mem.step = STEPS.index(mem.tuning_step)
for setting in mem.extra:
+ if CHIRP_DEBUG:
+ print "@set_mem:", setting.get_name(), setting.value
setattr(_mem, setting.get_name(), setting.value)
def get_settings(self):
More information about the chirp_devel
mailing list