Steve Borho committed f26f3d3

qtlib: provide a method for opening online help

Comments (0)

Files changed (2)


 * Pull latest translations from Launchpad
 * set revision number in doc/source/
 * tag stable branch of repository, push
+* update url in qtlib.openhelpcontents()            (major release only)
 * build pdf hgbook, check into thg-winbuild         (major release only)
 * build release installer
 * commit extension versions, tag, push thg-winbuild


     return tmproot
+def openhelpcontents(url):
+    'Open online help, use local CHM file if available'
+    if not url.startswith('http'):
+        fullurl = '' + url
+        # Use local CHM file if it can be found
+        if == 'nt' and paths.bin_path:
+            chm = os.path.join(paths.bin_path, 'doc', 'TortoiseHg.chm')
+            if os.path.exists(chm):
+                fullurl = (r'mk:@MSITStore:%s::/' % chm) + url
+                QDesktopServices.openUrl(QUrl.fromLocalFile(fullurl))
+                return
+        QDesktopServices.openUrl(QUrl(fullurl))
 # _styles maps from ui labels to effects
 # _effects maps an effect to font style properties.  We define a limited
 # set of _effects, since we convert color effect names to font style