diff options
| author | Bdale Garbee <bdale@gag.com> | 2013-08-07 22:37:45 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2013-08-07 22:37:45 -0600 |
| commit | 717fcf5fd76d3c672c609f336c80a675a548c4c6 (patch) | |
| tree | cdb56ea5d00234b1ceca05957da1c557cbcb2deb /chirpui/shiftdialog.py | |
| parent | ef2d5b20453b00acc8c343c169138afd7940d3cc (diff) | |
Imported Upstream version 0.3.1upstream/0.3.1
Diffstat (limited to 'chirpui/shiftdialog.py')
| -rw-r--r-- | chirpui/shiftdialog.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chirpui/shiftdialog.py b/chirpui/shiftdialog.py index 10554d3..f35802e 100644 --- a/chirpui/shiftdialog.py +++ b/chirpui/shiftdialog.py @@ -70,7 +70,7 @@ class ShiftDialog(gtk.Dialog): return int(count) - def _get_mems_until_hole(self, start): + def _get_mems_until_hole(self, start, endokay=False): mems = [] llimit, ulimit = self.rthread.radio.get_features().memory_bounds @@ -89,7 +89,7 @@ class ShiftDialog(gtk.Dialog): mems.append(mem) pos += 1 - if pos > ulimit: + if pos > ulimit and not endokay: raise errors.InvalidMemoryLocation(_("No space to insert a row")) print "Found a hole: %i" % pos @@ -110,7 +110,8 @@ class ShiftDialog(gtk.Dialog): return 0 def _delete_hole(self, start): - mems = self._get_mems_until_hole(start+1) + mems = self._get_mems_until_hole(start+1, endokay=True) + if mems: count = self._shift_memories(-1, mems) self.rthread.radio.erase_memory(count+start) |
