# HG changeset patch
# User Dan Smith <dsmith@danplanet.com>
# Date 1363140169 25200
# Node ID 39add30a1ee5ea0c652f5ff4a310bcb1c0426eca
# Parent 443ea98c0840de12f8ee149ccd8eecc78bb69a51
Fix logic error preventing auto repeater setting in some cases
If autorpt is enabled and you enter a frequency into a blank channel
that is the same as was previously just entered, the new item defaulting
code fools ed_freq() into thinking that the frequency field was unchanged,
and thus that the auto repeater logic should not be applied. This
enhances the logic that determines if the frequency was changed to avoid
this problem.
Fixes #683
diff -r 443ea98c0840 -r 39add30a1ee5 chirpui/memedit.py
--- a/chirpui/memedit.py Tue Mar 05 09:49:47 2013 -0800
+++ b/chirpui/memedit.py Tue Mar 12 19:02:49 2013 -0700
@@ -123,7 +123,7 @@
def ed_freq(self, _foo, path, new, colnum):
iter = self.store.get_iter(path)
- prev, = self.store.get(iter, colnum)
+ was_filled, prev = self.store.get(iter, self.col("_filled"), colnum)
def set_offset(path, offset):
if offset > 0:
@@ -154,7 +154,8 @@
if not self._features.has_nostep_tuning:
set_ts(chirp_common.required_step(new))
- if new and self._config.get_bool("autorpt") and new != prev:
+ is_changed = new != prev if was_filled else True
+ if new and self._config.get_bool("autorpt") and is_changed:
try:
band = chirp_common.freq_to_band(new)
set_offset(path, 0)
_______________________________________________
chirp_devel mailing list
chirp_devel@intrepid.danplanet.com
http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers