[chirp_devel] Info Prompt

Rick DeWitt
Thu Jun 21 09:50:32 PDT 2018


OK, found the problem was with EOL chars; marked all lines as changed. 
So here are the patch files for the new Information Prompt and the two 
drivers effected so far....

-- 
Rick DeWitt
AA0RD
Sequim, Washington, USA
360-681-3494

-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1529599413 25200
#      Thu Jun 21 09:43:33 2018 -0700
# Node ID a232e3e57d23ad5d67f14ea8ac4b145658a7a628
# Parent  8b1b394fd9a66633e5bacd480affdcd501dc7dad
[mainapp] Add Information prompt per #5889

Adds new config boolean, new help tab toggle and show_information method.

diff -r 8b1b394fd9a6 -r a232e3e57d23 chirp/ui/mainapp.py
--- a/chirp/ui/mainapp.py	Thu Jun 21 09:39:30 2018 -0700
+++ b/chirp/ui/mainapp.py	Thu Jun 21 09:43:33 2018 -0700
@@ -626,6 +626,37 @@
             CONF.set_bool(sql_key, not squelch, "state")
         return resp == gtk.RESPONSE_YES
 
+    def _show_information(self, radio, message):
+        if message is None:
+            return
+
+        if CONF.get_bool("clone_information", "noconfirm"):
+            return
+
+        d = gtk.MessageDialog(parent=self, buttons=gtk.BUTTONS_OK)
+        d.set_markup("<big><b>" + _("{name} Information").format(
+                 name=radio.get_name()) + "</b></big>")
+        msg = _("{information}").format(information=message)
+        _again_msg = "Don't show information for any radio again"
+
+        d.format_secondary_markup(msg)
+
+        again = gtk.CheckButton(_(_again_msg))
+        again.show()
+        again.connect("toggled", lambda action:
+                      self.infomenu.set_active(not action.get_active()))
+        d.vbox.pack_start(again, 0, 0, 0)
+        h_button_box = d.vbox.get_children()[2]
+        try:
+            ok_button = h_button_box.get_children()[0]
+            ok_button.grab_default()
+            ok_button.grab_focus()
+        except AttributeError:
+            # don't grab focus on GTK+ 2.0
+            pass
+        d.run()
+        d.destroy()
+
     def _show_instructions(self, radio, message):
         if message is None:
             return
@@ -635,12 +666,13 @@
 
         d = gtk.MessageDialog(parent=self, buttons=gtk.BUTTONS_OK)
         d.set_markup("<big><b>" + _("{name} Instructions").format(
-                     name=radio.get_name()) + "</b></big>")
+                 name=radio.get_name()) + "</b></big>")
         msg = _("{instructions}").format(instructions=message)
+        _again_msg = "Don't show instructions for any radio again"
+
         d.format_secondary_markup(msg)
 
-        again = gtk.CheckButton(
-            _("Don't show instructions for any radio again"))
+        again = gtk.CheckButton(_(_again_msg))
         again.show()
         again.connect("toggled", lambda action:
                       self.clonemenu.set_active(not action.get_active()))
@@ -669,6 +701,9 @@
             # User does not want to proceed with experimental driver
             return
 
+        if rclass.get_prompts().display_info is True:
+            self._show_information(rclass, rclass.get_prompts().info)
+
         self._show_instructions(rclass, rclass.get_prompts().pre_download)
 
         LOG.debug("User selected %s %s on port %s" %
@@ -1520,6 +1555,10 @@
             devaction = self.menu_ag.get_action(name)
             devaction.set_visible(action.get_active())
 
+    def do_toggle_clone_information(self, action):
+        CONF.set_bool("clone_information",
+                      not action.get_active(), "noconfirm")
+
     def do_toggle_clone_instructions(self, action):
         CONF.set_bool("clone_instructions",
                       not action.get_active(), "noconfirm")
@@ -1620,6 +1659,8 @@
             self.do_toggle_no_smart_tmode(_action)
         elif action == "developer":
             self.do_toggle_developer(_action)
+        elif action == "clone_information":
+            self.do_toggle_clone_information(_action)
         elif action == "clone_instructions":
             self.do_toggle_clone_instructions(_action)
         elif action in ["cut", "copy", "paste", "delete",
@@ -1714,6 +1755,7 @@
       <menuitem action="gethelp"/>
       <separator/>
       <menuitem action="report"/>
+      <menuitem action="clone_information"/>
       <menuitem action="clone_instructions"/>
       <menuitem action="developer"/>
       <separator/>
@@ -1809,6 +1851,7 @@
         re = not conf.get_bool("no_report")
         hu = conf.get_bool("hide_unused", "memedit", default=True)
         dv = conf.get_bool("developer", "state")
+        cf = not conf.get_bool("clone_information", "noconfirm")
         ci = not conf.get_bool("clone_instructions", "noconfirm")
         st = not conf.get_bool("no_smart_tmode", "memedit")
 
@@ -1818,6 +1861,8 @@
                     None, None, self.mh, hu),
                    ('no_smart_tmode', None, _("Smart Tone Modes"),
                     None, None, self.mh, st),
+                   ('clone_information', None, _("Show Information"),
+                    None, None, self.mh, cf),
                    ('clone_instructions', None, _("Show Instructions"),
                     None, None, self.mh, ci),
                    ('developer', None, _("Enable Developer Functions"),
@@ -1834,6 +1879,9 @@
 
         self.add_accel_group(self.menu_uim.get_accel_group())
 
+        self.infomenu = self.menu_uim.get_widget(
+            "/MenuBar/help/clone_information")
+
         self.clonemenu = self.menu_uim.get_widget(
             "/MenuBar/help/clone_instructions")
 
-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1529599170 25200
#      Thu Jun 21 09:39:30 2018 -0700
# Node ID 8b1b394fd9a66633e5bacd480affdcd501dc7dad
# Parent  b08fbd75a49999f7f8054a054d7ae6a8cc45c684
[lt725uv] and variants; add Information prompt info per #5893

diff -r b08fbd75a499 -r 8b1b394fd9a6 chirp/drivers/lt725uv.py
--- a/chirp/drivers/lt725uv.py	Wed Jun 13 06:14:11 2018 -0700
+++ b/chirp/drivers/lt725uv.py	Thu Jun 21 09:39:30 2018 -0700
@@ -417,8 +417,7 @@
 
 
 @directory.register
-class LT725UV(chirp_common.CloneModeRadio,
-              chirp_common.ExperimentalRadio):
+class LT725UV(chirp_common.CloneModeRadio):
     """LUITON LT-725UV Radio"""
     VENDOR = "LUITON"
     MODEL = "LT-725UV"
@@ -438,7 +437,7 @@
     @classmethod
     def get_prompts(cls):
         rp = chirp_common.RadioPrompts()
-        rp.experimental = \
+        rp.info = \
             ('Some notes about POWER settings:\n'
              '- The individual channel power settings are ignored'
              ' by the radio.\n'
@@ -448,7 +447,7 @@
              ' entire upper or lower band.\n'
              '- Tri-power radio models will set and download the three'
              ' band-power'
-             ' levels, but they are\n  converted to just Low and High at'
+             ' levels, but they are converted to just Low and High at'
              ' upload.'
              ' The Mid setting reverts to Low.'
              )
-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1529599609 25200
#      Thu Jun 21 09:46:49 2018 -0700
# Node ID 76e4dfd57861502b3c767fbc4264a96b7292a18e
# Parent  a232e3e57d23ad5d67f14ea8ac4b145658a7a628
[chirp_common] Add new Info prompt to prompt class per #5889

diff -r a232e3e57d23 -r 76e4dfd57861 chirp/chirp_common.py
--- a/chirp/chirp_common.py	Thu Jun 21 09:43:33 2018 -0700
+++ b/chirp/chirp_common.py	Thu Jun 21 09:46:49 2018 -0700
@@ -675,6 +675,8 @@
 
 class RadioPrompts:
     """Radio prompt strings"""
+    info = None
+    display_info = True
     experimental = None
     pre_download = None
     pre_upload = None
-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1529500236 25200
#      Wed Jun 20 06:10:36 2018 -0700
# Node ID e541c17589d345e52b239bac6e565f21e3cc1576
# Parent  b08fbd75a49999f7f8054a054d7ae6a8cc45c684
[ft450d] Add verbage for new Information prompt, issue #5891

diff -r b08fbd75a499 -r e541c17589d3 chirp/drivers/ft450d.py
--- a/chirp/drivers/ft450d.py	Wed Jun 13 06:14:11 2018 -0700
+++ b/chirp/drivers/ft450d.py	Wed Jun 20 06:10:36 2018 -0700
@@ -370,9 +370,20 @@
     @classmethod
     def get_prompts(cls):
         rp = chirp_common.RadioPrompts()
+        rp.info = _(dedent("""
+            The FT-450 radio driver loads the 'Special Channels' tab
+            with the PMS scanning range memories (group 11), 60meter
+            channels (group 12), the QMB (STO/RCL) memory, the HF and
+            50m HOME memories and all the A and B VFO memories.
+            There are VFO memories for the last frequency dialed in
+            each band. The last mem-tune config is also stored.
+            These Special Channels allow limited field editting.
+            This driver also populates the 'Other' tab in the channel
+            memory Properties window. This tab contains values for
+            those channel memory settings that don't fall under the
+            standard Chirp display columns.
+            """))
         rp.pre_download = _(dedent("""\
-            Note that this radio has 'Special Channels' and generates an
-            'Other' tab in the channel memory Properties window...
             1. Turn radio off.
             2. Connect cable to ACC jack.
             3. Press and hold in the [MODE &lt;] and [MODE &gt;] keys while


More information about the chirp_devel mailing list