[chirp_devel] [PATCH] Fix Link in About Dialog (Update)
# HG changeset patch # User K. Arvanitis kosta@alumni.uvic.ca # Date 1421989539 28800 # Thu Jan 22 21:05:39 2015 -0800 # Node ID a4b1dd7418de3105ea43e521a1b50dc4d6b05fe7 # 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 a4b1dd7418de chirpui/mainapp.py --- a/chirpui/mainapp.py Wed Jan 21 23:30:19 2015 -0800 +++ b/chirpui/mainapp.py Thu Jan 22 21:05:39 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:"), @@ -1205,20 +1209,8 @@ d.run() 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() + def do_gethelp(self): + webbrowser.open("http://chirp.danplanet.com")
def do_columns(self): eset = self.get_current_editorset() @@ -1407,8 +1399,8 @@ self.do_przemienniki(action[0] == "i") elif action == "about": self.do_about() - elif action == "documentation": - self.do_documentation() + elif action == "gethelp": + self.do_gethelp() elif action == "columns": self.do_columns() elif action == "hide_unused": @@ -1502,10 +1494,12 @@ <menuitem action="cancelq"/> </menu> <menu action="help"> - <menuitem action="about"/> - <menuitem action="documentation"/> + <menuitem action="gethelp"/> + <separator/> <menuitem action="report"/> <menuitem action="developer"/> + <separator/> + <menuitem action="about"/> </menu> </menubar> </ui> @@ -1558,7 +1552,7 @@ ('cancelq', gtk.STOCK_STOP, None, "Escape", None, self.mh), ('help', None, _('Help'), None, None, self.mh), ('about', gtk.STOCK_ABOUT, None, None, None, self.mh), - ('documentation', None, _("Documentation"), None, None, self.mh), + ('gethelp', None, _("Get Help Online..."), None, None, self.mh), ]
conf = config.get()
participants (1)
-
Kosta Arvanitis