[chirp_devel] [PATCH] Updated Memory Edit View

Kosta Arvanitis
Sat Jan 31 00:37:07 PST 2015


# HG changeset patch
# User K. Arvanitis <kosta at alumni.uvic.ca>
# Date 1422692399 28800
# Parent  cfa8a356cf3867cb3df35c7d73193285cc2b50d1
[PATCH] Updated Memory Edit View
This patch helps addres a concern some individuals were having
accessing the memory property page which contains some "extra"
memory settings which are not editable on the main treeview.
This change 1) modified the memory editor taskbar to include a button
which connects to the memory property page as well as icons for the
remaining buttons, 2) reogranized the menu system to include a few
more items, such as "select all" and a accel ('r') to properties,
and 3) renamed a few memory entries and dialogs to be more slightly
more consitent.
Access to the memory property page should now be slightly improved and
more accessible to those people whom are not used to functioning with
a 2-button mouse button.

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


More information about the chirp_devel mailing list