<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'># HG changeset patch<br># User K. Arvanitis <<a href="mailto:kosta@alumni.uvic.ca">kosta@alumni.uvic.ca</a>><br># Date 1422692399 28800<br># Parent cfa8a356cf3867cb3df35c7d73193285cc2b50d1<br>[PATCH] Updated Memory Edit View<BR>This patch helps addres a concern some individuals were having<br>accessing the memory property page which contains some "extra"<br>memory settings which are not editable on the main treeview.<BR>This change 1) modified the memory editor taskbar to include a button<br>which connects to the memory property page as well as icons for the<br>remaining buttons, 2) reogranized the menu system to include a few<br>more items, such as "select all" and a accel ('r') to properties,<br>and 3) renamed a few memory entries and dialogs to be more slightly<br>more consitent.<BR>Access to the memory property page should now be slightly improved and<br>more accessible to those people whom are not used to functioning with<br>a 2-button mouse button.<BR><br>Feature #2273<BR>diff -r cfa8a356cf38 -r 5e6f8509ab1d chirpui/mainapp.py<br>--- a/chirpui/mainapp.py Thu Jan 29 07:14:39 2015 -0800<br>+++ b/chirpui/mainapp.py Sat Jan 31 00:19:59 2015 -0800<br>@@ -112,7 +112,8 @@<br> <br> for i in ["export", "close", "columns", "irbook", "irfinder",<br> "move_up", "move_dn", "exchange", "iradioreference",<br>- "cut", "copy", "paste", "delete", "viewdeveloper"]:<br>+ "cut", "copy", "paste", "delete", "viewdeveloper",<br>+ "all", "properties"]:<br> set_action_sensitive(i, eset is not None)<br> <br> def ev_status(self, editorset, msg):<br>@@ -1219,7 +1220,7 @@<br> radio_name = "%s %s %s" % (eset.rthread.radio.VENDOR,<br> eset.rthread.radio.MODEL,<br> eset.rthread.radio.VARIANT)<br>- d = gtk.Dialog(title=_("Select Columns"),<br>+ d = gtk.Dialog(title=_("Choose Columns"),<br> parent=self,<br> buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,<br> gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))<br>@@ -1418,8 +1419,8 @@<br> self.do_toggle_no_smart_tmode(_action)<br> elif action == "developer":<br> self.do_toggle_developer(_action)<br>- elif action in ["cut", "copy", "paste", "delete",<br>- "move_up", "move_dn", "exchange",<br>+ elif action in ["cut", "copy", "paste", "delete", "all",<br>+ "move_up", "move_dn", "exchange", "properties",<br> "devshowraw", "devdiffraw"]:<br> self.get_current_editorset().get_current_editor().hotkey(_action)<br> elif action == "devdifftab":<br>@@ -1458,12 +1459,17 @@<br> <menuitem action="paste"/><br> <menuitem action="delete"/><br> <separator/><br>+ <menuitem action="all"/><br>+ <separator/><br> <menuitem action="move_up"/><br> <menuitem action="move_dn"/><br> <menuitem action="exchange"/><br>+ <separator/><br>+ <menuitem action="properties"/><br> </menu><br> <menu action="view"><br> <menuitem action="columns"/><br>+ <separator/><br> <menuitem action="hide_unused"/><br> <menuitem action="no_smart_tmode"/><br> <menu action="viewdeveloper"><br>@@ -1471,11 +1477,13 @@<br> <menuitem action="devdiffraw"/><br> <menuitem action="devdifftab"/><br> </menu><br>+ <separator/><br> <menuitem action="language"/><br> </menu><br> <menu action="radio" name="radio"><br> <menuitem action="download"/><br> <menuitem action="upload"/><br>+ <separator/><br> <menu action="importsrc" name="importsrc"><br> <menuitem action="iradioreference"/><br> <menuitem action="irbook"/><br>@@ -1509,11 +1517,11 @@<br> ('file', None, _("_File"), None, None, self.mh),<br> ('new', gtk.STOCK_NEW, None, None, None, self.mh),<br> ('open', gtk.STOCK_OPEN, None, None, None, self.mh),<br>- ('openstock', None, _("Open stock config"), None, None, self.mh),<br>+ ('openstock', None, _("Open Stock Config"), None, None, self.mh),<br> ('recent', None, _("_Recent"), None, None, self.mh),<br> ('save', gtk.STOCK_SAVE, None, None, None, self.mh),<br> ('saveas', gtk.STOCK_SAVE_AS, None, None, None, self.mh),<br>- ('loadmod', None, _("Load Module"), None, None, self.mh),<br>+ ('loadmod', None, _("Load Module..."), None, None, self.mh),<br> ('close', gtk.STOCK_CLOSE, None, None, None, self.mh),<br> ('quit', gtk.STOCK_QUIT, None, None, None, self.mh),<br> ('edit', None, _("_Edit"), None, None, self.mh),<br>@@ -1521,27 +1529,29 @@<br> ('copy', None, _("_Copy"), "<Ctrl>c", None, self.mh),<br> ('paste', None, _("_Paste"), "<Ctrl>v", None, self.mh),<br> ('delete', None, _("_Delete"), "Delete", None, self.mh),<br>+ ('all', None, _("Select _All"), None, None, self.mh),<br> ('move_up', None, _("Move _Up"), "<Control>Up", None, self.mh),<br> ('move_dn', None, _("Move Dow_n"), "<Control>Down", None, self.mh),<br> ('exchange', None, _("E_xchange"), "<Control><Shift>x", None, self.mh),<br>+ ('properties', None, _("P_roperties"), None, None, self.mh),<br> ('view', None, _("_View"), None, None, self.mh),<br>- ('columns', None, _("Columns"), None, None, self.mh),<br>+ ('columns', None, _("C_hoose Columns..."), None, None, self.mh),<br> ('viewdeveloper', None, _("Developer"), None, None, self.mh),<br> ('devshowraw', None, _('Show raw memory'), "<Control><Shift>r", None, self.mh),<br> ('devdiffraw', None, _("Diff raw memories"), "<Control><Shift>d", None, self.mh),<br> ('devdifftab', None, _("Diff tabs"), "<Control><Shift>t", None, self.mh),<br>- ('language', None, _("Change language"), None, None, self.mh),<br>+ ('language', None, _("Change Language..."), None, None, self.mh),<br> ('radio', None, _("_Radio"), None, None, self.mh),<br> ('download', None, _("Download From Radio"), "<Alt>d", None, self.mh),<br> ('upload', None, _("Upload To Radio"), "<Alt>u", None, self.mh),<br>- ('import', None, _("Import"), "<Alt>i", None, self.mh),<br>- ('export', None, _("Export"), "<Alt>x", None, self.mh),<br>- ('importsrc', None, _("Import from data source"), None, None, self.mh),<br>+ ('import', None, _("Import..."), "<Alt>i", None, self.mh),<br>+ ('export', None, _("Export..."), "<Alt>x", None, self.mh),<br>+ ('importsrc', None, _("Import Data Source"), None, None, self.mh),<br> ('iradioreference', None, _("RadioReference.com"), None, None, self.mh),<br> ('irfinder', None, _("RFinder"), None, None, self.mh),<br> ('irbook', None, _("RepeaterBook"), None, None, self.mh),<br> ('ipr', None, _("przemienniki.net"), None, None, self.mh),<br>- ('querysrc', None, _("Query data source"), None, None, self.mh),<br>+ ('querysrc', None, _("Query Data Source"), None, None, self.mh),<br> ('qradioreference', None, _("RadioReference.com"), None, None, self.mh),<br> ('qrfinder', None, _("RFinder"), None, None, self.mh),<br> ('qpr', None, _("przemienniki.net"), None, None, self.mh),<br>@@ -1549,7 +1559,7 @@<br> ('export_chirp', None, _("CHIRP Native File"), None, None, self.mh),<br> ('export_csv', None, _("CSV File"), None, None, self.mh),<br> ('stock', None, _("Import from stock config"), None, None, self.mh),<br>- ('channel_defaults', None, _("Channel defaults"), None, None, self.mh),<br>+ ('channel_defaults', None, _("Reset Channel Defaults"), None, None, self.mh),<br> ('cancelq', gtk.STOCK_STOP, None, "Escape", None, self.mh),<br> ('help', None, _('Help'), None, None, self.mh),<br> ('about', gtk.STOCK_ABOUT, None, None, None, self.mh),<br>diff -r cfa8a356cf38 -r 5e6f8509ab1d chirpui/memdetail.py<br>--- a/chirpui/memdetail.py Thu Jan 29 07:14:39 2015 -0800<br>+++ b/chirpui/memdetail.py Sat Jan 31 00:19:59 2015 -0800<br>@@ -193,8 +193,6 @@<br> self.vbox.pack_start(sw, 1, 1, 1)<br> tab.show()<br> <br>- row = 0<br>-<br> def _err(name, msg):<br> try:<br> _img = self._editors[name][2]<br>@@ -210,6 +208,7 @@<br> self.set_response_sensitive(gtk.RESPONSE_OK,<br> True not in self._errors)<br> <br>+ row = 0<br> for name in self._order:<br> labeltxt, editorcls, data = self._elements[name]<br> <br>@@ -235,13 +234,10 @@<br> row += 1<br> self._order.append(name)<br> <br>- def _title(self):<br>- return _("Edit Memory #{num}").format(num=self._memory.number)<br>-<br> def __init__(self, features, memory, parent=None):<br> self._memory = memory<br> gtk.Dialog.__init__(self,<br>- title=self._title(),<br>+ title="Memory Properties",<br> flags=gtk.DIALOG_MODAL,<br> parent=parent,<br> buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,<br>@@ -327,7 +323,7 @@<br> if isinstance(msg, chirp_common.ValidationError):<br> errors.append(msg)<br> if errors:<br>- common.show_error_text(_("Memory validation failed:"),<br>+ common.show_error_text(_("Memory Validation Failed:"),<br> os.linesep +<br> os.linesep.join(errors))<br> self.emit_stop_by_name('response')<br>@@ -337,9 +333,6 @@<br> return self._memory<br> <br> class MultiMemoryDetailEditor(MemoryDetailEditor):<br>- def _title(self):<br>- return _("Edit Multiple Memories")<br>-<br> def __init__(self, features, memory, parent=None):<br> self._selections = dict()<br> super(MultiMemoryDetailEditor, self).__init__(features, memory, parent)<br>diff -r cfa8a356cf38 -r 5e6f8509ab1d chirpui/memedit.py<br>--- a/chirpui/memedit.py Thu Jan 29 07:14:39 2015 -0800<br>+++ b/chirpui/memedit.py Sat Jan 31 00:19:59 2015 -0800<br>@@ -524,7 +524,7 @@<br> <br> return True # We changed memories<br> <br>- def _delete_rows_and_shift(self, paths, all=False):<br>+ def _remove_rows_and_shift(self, paths, all=False):<br> iter = self.store.get_iter(paths[0])<br> starting_loc, = self.store.get(iter, self.col(_("Loc")))<br> for i in range(0, len(paths)):<br>@@ -780,9 +780,9 @@<br> elif action == "delete":<br> changed = self._delete_rows(paths)<br> elif action == "delete_s":<br>- changed = self._delete_rows_and_shift(paths)<br>+ changed = self._remove_rows_and_shift(paths)<br> elif action == "delete_sall":<br>- changed = self._delete_rows_and_shift(paths, all=True)<br>+ changed = self._remove_rows_and_shift(paths, all=True)<br> elif action in ["move_up", "move_dn"]:<br> changed = self._move_up_down(paths, action)<br> elif action == "exchange":<br>@@ -791,11 +791,13 @@<br> changed = self.copy_selection(action=="cut")<br> elif action == "paste":<br> changed = self.paste_selection()<br>+ elif action == "all":<br>+ self._select_all()<br> elif action == "devshowraw":<br> self._show_raw(cur_pos)<br> elif action == "devdiffraw":<br> self._diff_raw(paths)<br>- elif action == "edit":<br>+ elif action == "properties":<br> job = common.RadioJob(self.edit_memory, "get_memory", cur_pos)<br> job.set_cb_args(selected)<br> self.rthread.submit(job)<br>@@ -828,11 +830,18 @@<br> menu_xml = """<br> <ui><br> <popup name="Menu"> <br>- <menuitem action="edit"/><br>- <menuitem action="insert_prev"/><br>- <menuitem action="insert_next"/><br>- <menu action="deletes"><br>- <menuitem action="delete"/><br>+ <menuitem action="cut"/><br>+ <menuitem action="copy"/><br>+ <menuitem action="paste"/><br>+ <menuitem action="delete"/><br>+ <separator/><br>+ <menuitem action="all"/><br>+ <separator/><br>+ <menu action="insert"><br>+ <menuitem action="insert_prev"/><br>+ <menuitem action="insert_next"/><br>+ </menu><br>+ <menu action="remove"><br> <menuitem action="delete_s"/><br> <menuitem action="delete_sall"/><br> </menu><br>@@ -840,9 +849,7 @@<br> <menuitem action="move_dn"/><br> <menuitem action="exchange"/><br> <separator/><br>- <menuitem action="cut"/><br>- <menuitem action="copy"/><br>- <menuitem action="paste"/><br>+ <menuitem action="properties"/><br> %s<br> </popup><br> </ui><br>@@ -854,19 +861,21 @@<br> istwo = len(paths) == 2<br> <br> actions = [<br>- ("edit", _("Edit")),<br>- ("insert_prev", _("Insert row above")),<br>- ("insert_next", _("Insert row below")),<br>- ("deletes", _("Delete")),<br>- ("delete", issingle and _("this memory") or _("these memories")),<br>+ ("properties", _("P_roperties")),<br>+ ("insert", _("Insert")),<br>+ ("insert_prev", _("Row Above")),<br>+ ("insert_next", _("Row Below")),<br>+ ("remove", _("Remove")),<br> ("delete_s", _("...and shift block up")),<br> ("delete_sall", _("...and shift all memories up")),<br>- ("move_up", _("Move up")),<br>- ("move_dn", _("Move down")),<br>- ("exchange", _("Exchange memories")),<br>+ ("move_up", _("Move Up")),<br>+ ("move_dn", _("Move Down")),<br>+ ("exchange", _("Exchange Memories")),<br> ("cut", _("Cut")),<br> ("copy", _("Copy")),<br> ("paste", _("Paste")),<br>+ ("delete", _("Delete")),<br>+ ("all", _("Select All")),<br> ("devshowraw", _("Show Raw Memory")),<br> ("devdiffraw", _("Diff Raw Memories")),<br> ]<br>@@ -1153,7 +1162,7 @@<br> def make_controls(self, min, max):<br> hbox = gtk.HBox(False, 2)<br> <br>- lab = gtk.Label(_("Memory range:"))<br>+ lab = gtk.Label(_("Memory Range:"))<br> lab.show()<br> hbox.pack_start(lab, 0, 0, 0)<br> <br>@@ -1180,11 +1189,22 @@<br> hi.show()<br> hbox.pack_start(hi, 0, 0, 0)<br> <br>- refresh = gtk.Button(_("Go"))<br>+ refresh = gtk.Button()<br>+ refresh.set_relief(gtk.RELIEF_NONE)<br>+ image = gtk.Image()<br>+ image.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_MENU)<br>+ image.show()<br>+ label = gtk.Label(_("Refresh"))<br>+ label.show()<br>+ box = gtk.HBox(False, 2)<br>+ box.pack_start(image, 0, 0, 0)<br>+ box.pack_start(label, 0, 0, 0)<br>+ box.show()<br>+ refresh.add(box)<br>+ refresh.connect("clicked", lambda x: self.prefill())<br> refresh.show()<br>- refresh.connect("clicked", lambda x: self.prefill())<br> hbox.pack_start(refresh, 0, 0, 0)<br>-<br>+ <br> def activate_go(widget):<br> refresh.clicked()<br> <br>@@ -1200,23 +1220,44 @@<br> <br> sep = gtk.VSeparator()<br> sep.show()<br>- sep.set_size_request(20, -1)<br>- hbox.pack_start(sep, 0, 0, 0)<br>+ hbox.pack_start(sep, 0, 0, 2)<br> <br>- showspecial = gtk.CheckButton(_("Special Channels"))<br>+ showspecial = gtk.ToggleButton(_("Special Channels"))<br>+ showspecial.set_relief(gtk.RELIEF_NONE)<br> showspecial.set_active(self.show_special)<br> showspecial.connect("toggled",<br> lambda x: self.set_show_special(x.get_active()))<br> showspecial.show()<br> hbox.pack_start(showspecial, 0, 0, 0)<br>-<br>- showempty = gtk.CheckButton(_("Show Empty"))<br>+ <br>+ showempty = gtk.ToggleButton(_("Show Empty"))<br>+ showempty.set_relief(gtk.RELIEF_NONE)<br> showempty.set_active(self.show_empty);<br> showempty.connect("toggled",<br> lambda x: self.set_show_empty(x.get_active()))<br> showempty.show()<br> hbox.pack_start(showempty, 0, 0, 0)<br> <br>+ sep = gtk.VSeparator()<br>+ sep.show()<br>+ hbox.pack_start(sep, 0, 0, 2)<br>+<br>+ edit = gtk.Button()<br>+ edit.set_relief(gtk.RELIEF_NONE)<br>+ image = gtk.Image()<br>+ image.set_from_stock(gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU)<br>+ image.show()<br>+ label = gtk.Label(_("Properties"))<br>+ label.show()<br>+ box = gtk.HBox(False, 2)<br>+ box.pack_start(image, 0, 0, 0)<br>+ box.pack_start(label, 0, 0, 0)<br>+ box.show()<br>+ edit.add(box)<br>+ edit.connect("clicked", lambda x: self.hotkey(gtk.Action("properties", "", "", 0)))<br>+ edit.show()<br>+ hbox.pack_start(edit, 0, 0, 0)<br>+<br> hbox.show()<br> <br> return hbox<br>@@ -1485,6 +1526,9 @@<br> clipboard = gtk.Clipboard(selection="PRIMARY")<br> clipboard.request_text(self._paste_selection)<br> <br>+ def _select_all(self):<br>+ self.view.get_selection().select_all()<br>+<br> def prepare_close(self):<br> cols = self.view.get_columns()<br> self._config.set("column_order_%s" % self.__class__.__name__,<br> <BR>                                            </div></body>
</html>