[chirp_devel] Info Prompt 2.0

Rick DeWitt
Fri Jun 22 06:45:14 PDT 2018


OK, here is the new mainapp patch, and the other ones needed to 
implement the Information prompt.
This version prompts after a File Open/Recent and after (actually 
during) a Radio Download.
The two driver patches have info prompts for testing.

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

-------------- 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 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 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
-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1529674679 25200
#      Fri Jun 22 06:37:59 2018 -0700
# Node ID 75003987e9901b461d668ea5a238b9372a9825e4
# Parent  b08fbd75a49999f7f8054a054d7ae6a8cc45c684
[mainapp] Add Information Prompt per #5889



This patch places the prompt after a File Open and after Radio Download

diff -r b08fbd75a499 -r 75003987e990 chirp/ui/mainapp.py
--- a/chirp/ui/mainapp.py	Wed Jun 13 06:14:11 2018 -0700
+++ b/chirp/ui/mainapp.py	Fri Jun 22 06:37:59 2018 -0700
@@ -385,6 +385,7 @@
                 num=len(eset.rthread.radio.errors))
             common.show_error_text(msg,
                                    "\r\n".join(eset.rthread.radio.errors))
+        self._show_information(radio)
 
     def do_live_warning(self, radio):
         d = gtk.MessageDialog(parent=self, buttons=gtk.BUTTONS_OK)
@@ -626,6 +627,37 @@
             CONF.set_bool(sql_key, not squelch, "state")
         return resp == gtk.RESPONSE_YES
 
+    def _show_information(self, radio):
+        message = radio.get_prompts().info
+        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)
+        d.format_secondary_markup(msg)
+
+        again = gtk.CheckButton(
+            _("Don't show information for any radio again"))
+        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
@@ -695,6 +727,7 @@
             ct.start()
         else:
             self.do_open_live(radio)
+        self._show_information(rclass)          # show Info prompt now
 
     def do_upload(self, port=None, rtype=None):
         eset = self.get_current_editorset()
@@ -1520,6 +1553,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 +1657,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 +1753,7 @@
       <menuitem action="gethelp"/>
       <separator/>
       <menuitem action="report"/>
+      <menuitem action="clone_information"/>
       <menuitem action="clone_instructions"/>
       <menuitem action="developer"/>
       <separator/>
@@ -1809,6 +1849,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 +1859,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 +1877,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")
 


More information about the chirp_devel mailing list