# HG changeset patch
# User K. Arvanitis <kosta@alumni.uvic.ca>
# Date 1422736039 28800
# Parent  05767e5dabb45d0a99ca63df5705bc799e1858a3
[PATCH] Updated Memory Edit View #1
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 modified the memory editor taskbar to include a button
which connects to the memory property page as well as adding a properties
menu item to the vie menu and memory editor context menu.
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 05767e5dabb4 chirpui/mainapp.py
--- a/chirpui/mainapp.py Thu Jan 29 07:24:01 2015 -0600
+++ b/chirpui/mainapp.py Sat Jan 31 12:30:12 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",
+                  "properties"]:
             set_action_sensitive(i, eset is not None)
 
     def ev_status(self, editorset, msg):
@@ -1420,7 +1421,7 @@
             self.do_toggle_developer(_action)
         elif action in ["cut", "copy", "paste", "delete",
                         "move_up", "move_dn", "exchange",
-                        "devshowraw", "devdiffraw"]:
+                        "devshowraw", "devdiffraw", "properties"]:
             self.get_current_editorset().get_current_editor().hotkey(_action)
         elif action == "devdifftab":
             self.do_diff_radio()
@@ -1461,6 +1462,8 @@
       <menuitem action="move_up"/>
       <menuitem action="move_dn"/>
       <menuitem action="exchange"/>
+      <separator/>
+      <menuitem action="properties"/>
     </menu>
     <menu action="view">
       <menuitem action="columns"/>
@@ -1524,6 +1527,7 @@
             ('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),
             ('viewdeveloper', None, _("Developer"), None, None, self.mh),
diff -r 05767e5dabb4 chirpui/memdetail.py
--- a/chirpui/memdetail.py Thu Jan 29 07:24:01 2015 -0600
+++ b/chirpui/memdetail.py Sat Jan 31 12:30:12 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,
@@ -337,8 +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()
diff -r 05767e5dabb4 chirpui/memedit.py
--- a/chirpui/memedit.py Thu Jan 29 07:24:01 2015 -0600
+++ b/chirpui/memedit.py Sat Jan 31 12:30:12 2015 -0800
@@ -795,7 +795,7 @@
             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,7 +828,10 @@
         menu_xml = """
 <ui>
   <popup name="Menu">
-    <menuitem action="edit"/>
+    <menuitem action="cut"/>
+    <menuitem action="copy"/>
+    <menuitem action="paste"/>
+    <separator/>
     <menuitem action="insert_prev"/>
     <menuitem action="insert_next"/>
     <menu action="deletes">
@@ -840,9 +843,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,7 +855,9 @@
         istwo = len(paths) == 2
 
         actions = [
-            ("edit", _("Edit")),
+            ("cut", _("Cut")),
+            ("copy", _("Copy")),
+            ("paste", _("Paste")),
             ("insert_prev", _("Insert row above")),
             ("insert_next", _("Insert row below")),
             ("deletes", _("Delete")),
@@ -864,9 +867,7 @@
             ("move_up", _("Move up")),
             ("move_dn", _("Move down")),
             ("exchange", _("Exchange memories")),
-            ("cut", _("Cut")),
-            ("copy", _("Copy")),
-            ("paste", _("Paste")),
+            ("properties", _("P_roperties")),
             ("devshowraw", _("Show Raw Memory")),
             ("devdiffraw", _("Diff Raw Memories")),
             ]
@@ -1153,7 +1154,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,9 +1181,10 @@
         hi.show()
         hbox.pack_start(hi, 0, 0, 0)
 
-        refresh = gtk.Button(_("Go"))
+        refresh = gtk.Button(_("Refresh"))
+        refresh.set_relief(gtk.RELIEF_NONE)
+        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):
@@ -1200,23 +1202,34 @@
 
         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)
+
+        props = gtk.Button(_("Properties"))
+        props.set_relief(gtk.RELIEF_NONE)
+        props.connect("clicked", lambda x: self.hotkey(gtk.Action("properties", "", "", 0)))
+        props.show()
+        hbox.pack_start(props, 0, 0, 0)
+
         hbox.show()
 
         return hbox