[chirp_devel] [PATCH] Fix Link in About Dialog
# HG changeset patch # User K. Arvanitis kosta@alumni.uvic.ca # Date 1421987406 28800 # Thu Jan 22 20:30:06 2015 -0800 # Node ID 515b59115b7f0ef1f34606373844693b2b888843 # Parent b25606106a9c0cd78f3cc5f602475da64cde081d [PATCH] Fix Link in About Dialog The URL link in the about dialog is now functional. Tested in both Ubuntu and Windows 8.1, verified working. Replaced the MessageBox dialog for the 'Documentation' help menu item with a hotlink to the website. The URL link in the MessageBox was non- functional on Windows and overall it did not provide much information outside of the link anyhow. Bug #330 diff -r b25606106a9c -r 515b59115b7f chirpui/mainapp.py --- a/chirpui/mainapp.py Wed Jan 21 23:30:19 2015 -0800 +++ b/chirpui/mainapp.py Thu Jan 22 20:30:06 2015 -0800 @@ -17,6 +17,7 @@ import os import tempfile import urllib +import webbrowser from glob import glob import shutil import time @@ -1177,9 +1178,12 @@ ".".join([str(x) for x in gtk.pygtk_version]), sys.version.split()[0])
+ # Set url hook to handle user activating a URL link in the about dialog + gtk.about_dialog_set_url_hook(lambda dlg, url: webbrowser.open(url)) + d.set_name("CHIRP") d.set_version(CHIRP_VERSION) - d.set_copyright("Copyright 2013 Dan Smith (KK7DS)") + d.set_copyright("Copyright 2015 Dan Smith (KK7DS)") d.set_website("http://chirp.danplanet.com") d.set_authors(("Dan Smith KK7DS dsmith@danplanet.com", _("With significant contributions from:"), @@ -1206,19 +1210,7 @@ d.destroy()
def do_documentation(self): - d = gtk.MessageDialog(buttons=gtk.BUTTONS_OK, parent=self, - type=gtk.MESSAGE_INFO) - - d.set_markup("<b><big>" + _("CHIRP Documentation") + "</big></b>\r\n") - msg = _("Documentation for CHIRP, including FAQs, and help for common " - "problems is available on the CHIRP web site, please go to\n\n" - "<a href="http://chirp.danplanet.com/projects/chirp/wiki/" - "Documentation">" - "http://chirp.danplanet.com/projects/chirp/wiki/" - "Documentation</a>\n") - d.format_secondary_markup(msg.replace("\n","\r\n")) - d.run() - d.destroy() + webbrowser.open("http://chirp.danplanet.com/projects/chirp/wiki/Documentation")
def do_columns(self): eset = self.get_current_editorset()
participants (1)
-
Kosta Arvanitis