summaryrefslogtreecommitdiff
path: root/chirpui
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2013-08-07 22:37:45 -0600
committerBdale Garbee <bdale@gag.com>2013-08-07 22:37:45 -0600
commit717fcf5fd76d3c672c609f336c80a675a548c4c6 (patch)
treecdb56ea5d00234b1ceca05957da1c557cbcb2deb /chirpui
parentef2d5b20453b00acc8c343c169138afd7940d3cc (diff)
Imported Upstream version 0.3.1upstream/0.3.1
Diffstat (limited to 'chirpui')
-rw-r--r--chirpui/clone.py4
-rw-r--r--chirpui/mainapp.py6
-rw-r--r--chirpui/memedit.py45
-rw-r--r--chirpui/shiftdialog.py7
4 files changed, 46 insertions, 16 deletions
diff --git a/chirpui/clone.py b/chirpui/clone.py
index 70db9ac..0786e1e 100644
--- a/chirpui/clone.py
+++ b/chirpui/clone.py
@@ -57,9 +57,9 @@ class CloneSettingsDialog(gtk.Dialog):
elif ports:
port = ports[0]
if not port in ports:
- ports.append(port)
+ ports.insert(0, port)
- return miscwidgets.make_choice(sorted(ports), True, port)
+ return miscwidgets.make_choice(ports, True, port)
def __make_model(self):
return miscwidgets.make_choice([], False)
diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py
index 27c4b3c..e3b2eb1 100644
--- a/chirpui/mainapp.py
+++ b/chirpui/mainapp.py
@@ -1128,7 +1128,11 @@ If you think that it is valid, you can select a radio model below to force an op
def do_hide_unused(self, action):
eset = self.get_current_editorset()
- eset.editors["memedit"].set_hide_unused(action.get_active())
+ if eset is None:
+ conf = config.get("memedit")
+ conf.set_bool("hide_unused", action.get_active())
+ else:
+ eset.editors["memedit"].set_hide_unused(action.get_active())
def do_clearq(self):
eset = self.get_current_editorset()
diff --git a/chirpui/memedit.py b/chirpui/memedit.py
index c598624..5764ee0 100644
--- a/chirpui/memedit.py
+++ b/chirpui/memedit.py
@@ -202,40 +202,56 @@ class MemoryEditor(common.Editor):
return new
def _get_cols_to_hide(self, iter):
- tmode, duplex = self.store.get(iter,
- self.col(_("Tone Mode")),
- self.col(_("Duplex")))
+ tmode, duplex, cmode = self.store.get(iter,
+ self.col(_("Tone Mode")),
+ self.col(_("Duplex")),
+ self.col(_("Cross Mode")))
hide = []
+ txmode, rxmode = cmode.split("->")
if tmode == "Tone":
hide += [self.col(_("ToneSql")),
self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
elif tmode == "TSQL":
if self._features.has_ctone:
hide += [self.col(_("Tone"))]
hide += [self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
elif tmode == "DTCS":
- if self._features.has_rx_dtcs:
- hide += [self.col(_("DTCS Code"))]
-
hide += [self.col(_("Tone")),
- self.col(_("ToneSql"))]
+ self.col(_("ToneSql")),
+ self.col(_("Cross Mode")),
+ self.col(_("DTCS Rx Code"))]
elif tmode == "" or tmode == "(None)":
hide += [self.col(_("Tone")),
self.col(_("ToneSql")),
self.col(_("DTCS Code")),
self.col(_("DTCS Rx Code")),
- self.col(_("DTCS Pol"))]
+ self.col(_("DTCS Pol")),
+ self.col(_("Cross Mode"))]
+ elif tmode == "Cross":
+ if txmode != "Tone":
+ hide += [self.col(_("Tone"))]
+ if txmode != "DTCS":
+ hide += [self.col(_("DTCS Code"))]
+ if rxmode != "Tone":
+ hide += [self.col(_("ToneSql"))]
+ if rxmode != "DTCS":
+ hide += [self.col(_("DTCS Rx Code"))]
+ if "DTCS" not in cmode:
+ hide += [self.col(_("DTCS Pol"))]
if duplex == "" or duplex == "(None)":
hide += [self.col(_("Offset"))]
+
return hide
def maybe_hide_cols(self, iter):
@@ -757,6 +773,12 @@ class MemoryEditor(common.Editor):
a.set_sensitive(istwo)
ag.add_action(a)
+ if issingle:
+ iter = store.get_iter(paths[0])
+ cur_pos, = store.get(iter, self.col(_("Loc")))
+ if cur_pos == self._features.memory_bounds[1]:
+ ag.get_action("delete_s").set_sensitive(False)
+
uim = gtk.UIManager()
uim.insert_action_group(ag, 0)
uim.add_ui_from_string(menu_xml)
@@ -1284,6 +1306,9 @@ class MemoryEditor(common.Editor):
return
for mem in mem_list:
+ if mem.empty:
+ iter = self.store.iter_next(iter)
+ continue
loc, filled = store.get(iter,
self.col(_("Loc")), self.col("_filled"))
if filled and not always:
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)