[chirp_devel] [PATCH] Provides an option for the user to toggle cloning instructions from the help

K. Arvanitis
Sat Mar 12 01:43:40 PST 2016


# HG changeset patch
# User K. Arvanitis <kosta at alumni.uvic.ca>
# Date 1457775747 28800
#      Sat Mar 12 01:42:27 2016 -0800
# Node ID 86fcbefbcf670ca1ace59c34262550c5cae4a792
# Parent  30fd4d736864b0dd5becc6264236193bd85b6d0a
Provides an option for the user to toggle cloning instructions from the help
menu.  This allows for the ability to re-enable the instructions once they have
been disabled.

Bug #3437

diff -r 30fd4d736864 -r 86fcbefbcf67 chirp/ui/mainapp.py
--- a/chirp/ui/mainapp.py	Sat Mar 05 12:05:39 2016 -0500
+++ b/chirp/ui/mainapp.py	Sat Mar 12 01:42:27 2016 -0800
@@ -633,6 +633,8 @@
         again = gtk.CheckButton(
             _("Don't show instructions for any radio again"))
         again.show()
+        again.connect("toggled", lambda action:
+            self.clonemenu.set_active(not action.get_active()))
         d.vbox.pack_start(again, 0, 0, 0)
         h_button_box = d.vbox.get_children()[2]
         try:
@@ -644,7 +646,7 @@
             pass
         d.run()
         d.destroy()
-        CONF.set_bool("clone_instructions", again.get_active(), "noconfirm")
+
 
     def do_download(self, port=None, rtype=None):
         d = clone.CloneSettingsDialog(parent=self)
@@ -1349,6 +1351,9 @@
             devaction = self.menu_ag.get_action(name)
             devaction.set_visible(action.get_active())
 
+    def do_toggle_clone_instructions(self, action):
+        CONF.set_bool("clone_instructions", not action.get_active(), "noconfirm")
+
     def do_change_language(self):
         langs = ["Auto", "English", "Polish", "Italian", "Dutch", "German",
                  "Hungarian", "Russian", "Portuguese (BR)", "French"]
@@ -1440,6 +1445,8 @@
             self.do_toggle_no_smart_tmode(_action)
         elif action == "developer":
             self.do_toggle_developer(_action)
+        elif action == "clone_instructions":
+            self.do_toggle_clone_instructions(_action)
         elif action in ["cut", "copy", "paste", "delete",
                         "move_up", "move_dn", "exchange", "all",
                         "devshowraw", "devdiffraw", "properties"]:
@@ -1524,6 +1531,7 @@
       <menuitem action="gethelp"/>
       <separator/>
       <menuitem action="report"/>
+      <menuitem action="clone_instructions"/>
       <menuitem action="developer"/>
       <separator/>
       <menuitem action="about"/>
@@ -1601,14 +1609,17 @@
         re = not conf.get_bool("no_report")
         hu = conf.get_bool("hide_unused", "memedit", default=True)
         dv = conf.get_bool("developer", "state")
+        ci = not conf.get_bool("clone_instructions", "noconfirm")
         st = not conf.get_bool("no_smart_tmode", "memedit")
 
-        toggles = [('report', None, _("Report statistics"),
+        toggles = [('report', None, _("Report Statistics"),
                     None, None, self.mh, re),
                    ('hide_unused', None, _("Hide Unused Fields"),
                     None, None, self.mh, hu),
                    ('no_smart_tmode', None, _("Smart Tone Modes"),
                     None, None, self.mh, st),
+                   ('clone_instructions', None, _("Show Instructions"),
+                    None, None, self.mh, ci),
                    ('developer', None, _("Enable Developer Functions"),
                     None, None, self.mh, dv),
                    ]
@@ -1623,7 +1634,7 @@
 
         self.add_accel_group(self.menu_uim.get_accel_group())
 
-        self.recentmenu = self.menu_uim.get_widget("/MenuBar/file/recent")
+        self.clonemenu = self.menu_uim.get_widget("/MenuBar/help/clone_instructions")
 
         # Initialize
         self.do_toggle_developer(self.menu_ag.get_action("developer"))



More information about the chirp_devel mailing list