[chirp_devel] [PATCH 2 of 6] Add instructions for clone mode radios. #1163
Tom Hayward
Tue Oct 8 13:29:45 PDT 2013
# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1381264007 25200
# Node ID 17aa6b70b1b31926157becda152e2afd652d3b21
# Parent 4f5c50bf03253205ce13e9cbc9e73d139140426b
Add instructions for clone mode radios. #1163
diff -r 4f5c50bf0325 -r 17aa6b70b1b3 chirpui/mainapp.py
--- a/chirpui/mainapp.py Tue Oct 08 13:16:40 2013 -0700
+++ b/chirpui/mainapp.py Tue Oct 08 13:26:47 2013 -0700
@@ -564,7 +564,7 @@
return True
title = _("Proceed with experimental driver?")
- text = rclass.get_experimental_warning()
+ text = rclass.get_prompts().experimental
msg = _("This radio's driver is experimental. "
"Do you want to proceed?")
resp, squelch = common.show_warning(msg, text,
@@ -575,6 +575,26 @@
CONF.set_bool(sql_key, not squelch, "state")
return resp == gtk.RESPONSE_YES
+ def _show_instructions(self, radio, message):
+ if message is None:
+ return
+
+ if CONF.get_bool("clone_instructions", "noconfirm"):
+ return
+
+ d = gtk.MessageDialog(parent=self, buttons=gtk.BUTTONS_OK)
+ d.set_markup("<big><b>" + _("{name} Instructions").format(
+ name=radio.get_name()) + "</b></big>")
+ msg = _("{instructions}").format(instructions=message)
+ d.format_secondary_markup(msg)
+
+ again = gtk.CheckButton(_("Don't show instructions for any radio again"))
+ again.show()
+ d.vbox.pack_start(again, 0, 0, 0)
+ 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)
settings = d.run()
@@ -588,6 +608,8 @@
# User does not want to proceed with experimental driver
return
+ self._show_instructions(rclass, rclass.get_prompts().pre_download)
+
print "User selected %s %s on port %s" % (rclass.VENDOR,
rclass.MODEL,
settings.port)
@@ -631,6 +653,8 @@
# User does not want to proceed with experimental driver
return
+ self._show_instructions(radio, radio.get_prompts().pre_upload)
+
try:
ser = serial.Serial(port=settings.port,
baudrate=radio.BAUD_RATE,
More information about the chirp_devel
mailing list