From c0d1be63730d987257c495438aec8a5687047b47 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Sun, 8 Sep 2024 13:13:33 -0700 Subject: [PATCH] rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528rt470: Fix out-of-range setting handling Fixes #11528 --- chirp/drivers/tdh8.py | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/chirp/drivers/tdh8.py b/chirp/drivers/tdh8.py index 2dd48677..03ab43ac 100644 --- a/chirp/drivers/tdh8.py +++ b/chirp/drivers/tdh8.py @@ -1594,38 +1594,43 @@ def _filter(name): rs = RadioSetting("ligcon", "Light Control", RadioSettingValueList( LIGHT730_LIST, - LIGHT730_LIST[_settings.ligcon])) + current_index=_settings.ligcon)) basic.append(rs) rs = RadioSetting("tot", "Time-out Timer", RadioSettingValueList( - TIMEOUT730_LIST, TIMEOUT730_LIST[ - _settings.tot])) + TIMEOUT730_LIST, + current_index=_settings.tot)) basic.append(rs) rs = RadioSetting("press.rogerprompt", "Roger", RadioSettingValueList( - PTTID_LIST, PTTID_LIST[_press.rogerprompt])) + PTTID_LIST, + current_index=_press.rogerprompt)) basic.append(rs) rs = RadioSetting("lang", "Language", RadioSettingValueList( - LANG_LIST, LANG_LIST[_settings.lang])) + LANG_LIST, + current_index=_settings.lang)) basic.append(rs) rs = RadioSetting("save", "Battery Save", RadioSettingValueList( - OFFON_LIST, OFFON_LIST[_settings.save])) + OFFON_LIST, + current_index=_settings.save)) basic.append(rs) rs = RadioSetting("mdfa", "Channel Names", RadioSettingValueList( - OFFON_LIST, OFFON_LIST[_settings.mdfa])) + OFFON_LIST, + current_index=_settings.mdfa)) basic.append(rs) rs = RadioSetting("hoptype", "Hop Type", RadioSettingValueList( - HOP_LIST, HOP_LIST[_settings.hoptype])) + HOP_LIST, + current_index=_settings.hoptype)) basic.append(rs) rs = RadioSetting("tailclean", "QT/DQT Tail", @@ -1634,35 +1639,35 @@ def _filter(name): rs = RadioSetting("press.ssidekey1", "PF1 Key(Short)", RadioSettingValueList( - SHORT_KEY730_LIST, SHORT_KEY730_LIST[ - _press.ssidekey1])) + SHORT_KEY730_LIST, + current_index=_press.ssidekey1)) basic.append(rs) rs = RadioSetting("press.lsidekey1", "PF1 Key(Long)", RadioSettingValueList( LONG_KEY730_LIST, - LONG_KEY730_LIST[_press.lsidekey1])) + current_index=_press.lsidekey1)) basic.append(rs) rs = RadioSetting("press.ssidekey2", "PF2 Key(Short)", RadioSettingValueList( - SHORT_KEY730_LIST, SHORT_KEY730_LIST[ - _press.ssidekey2])) + SHORT_KEY730_LIST, + current_index=_press.ssidekey2)) basic.append(rs) rs = RadioSetting("press.lsidekey2", "PF2 Key(Long)", RadioSettingValueList( LONG_KEY730_LIST, - LONG_KEY730_LIST[_press.lsidekey2])) + current_index=_press.lsidekey2)) basic.append(rs) rs = RadioSetting("voxgain", "VOX Gain", RadioSettingValueList( VOX_GAIN730, - VOX_GAIN730[_settings.voxgain])) + current_index=_settings.voxgain)) basic.append(rs) rs = RadioSetting("voxdelay", "VOX Delay", RadioSettingValueList( VOX_DELAY730, - VOX_DELAY730[_settings.voxdelay])) + current_index=_settings.voxdelay)) basic.append(rs) if self.MODEL != "RT-730":