# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1381255994 25200 # Node ID 10b5cfa342621b9094f2079a3ac559c0827a3947 # Parent f7658c8abf415a92aef21c20687ac4e3ee1c89c5 Add instructions for clone mode radios. #1163
diff -r f7658c8abf41 -r 10b5cfa34262 chirpui/mainapp.py --- a/chirpui/mainapp.py Mon Oct 07 09:03:24 2013 -0700 +++ b/chirpui/mainapp.py Tue Oct 08 11:13:14 2013 -0700 @@ -575,6 +575,26 @@ CONF.set_bool(sql_key, not squelch, "state") return resp == gtk.RESPONSE_YES
+ def _show_instructions(self, radio, instructions): + d = gtk.MessageDialog(parent=self, buttons=gtk.BUTTONS_OK) + d.set_markup("<big><b>" + _("{vendor} {model} Instructions").format( + vendor=radio.VENDOR, model=radio.MODEL) + "</b></big>") + msg = _("{instructions}").format(instructions=instructions()) + d.format_secondary_markup(msg) + + again = gtk.CheckButton(_("Don't show this 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 _show_download_instructions(self, radio): + return self._show_instructions(radio, radio.get_download_instructions) + + def _show_upload_instructions(self, radio): + return self._show_instructions(radio, radio.get_upload_instructions) + def do_download(self, port=None, rtype=None): d = clone.CloneSettingsDialog(parent=self) settings = d.run() @@ -588,6 +608,9 @@ # User does not want to proceed with experimental driver return
+ if not CONF.get_bool("clone_instructions", "noconfirm"): + self._show_download_instructions(rclass) + print "User selected %s %s on port %s" % (rclass.VENDOR, rclass.MODEL, settings.port) @@ -631,6 +654,9 @@ # User does not want to proceed with experimental driver return
+ if not CONF.get_bool("clone_instructions", "noconfirm"): + self._show_upload_instructions(radio) + try: ser = serial.Serial(port=settings.port, baudrate=radio.BAUD_RATE,