Skip to content
Permalink
Browse files

[processing] improve loading help from local files (refs #17191)

  • Loading branch information
alexbruy committed Sep 27, 2017
1 parent 59904fb commit 03a444ca459ea1ccf3d67d7d867a1d6e155dadc2
Showing with 12 additions and 7 deletions.
  1. +12 −7 python/plugins/processing/gui/AlgorithmDialogBase.py
@@ -89,17 +89,22 @@ def linkClicked(url):

isText, algHelp = self.alg.help()
if algHelp is not None:
algHelp = algHelp if isText else QUrl(algHelp)
try:
if isText:
self.txtHelp.setHtml(algHelp)
else:
html = self.tr('<p>Downloading algorithm help... Please wait.</p>')
self.txtHelp.setHtml(html)
rq = QNetworkRequest(algHelp)
self.reply = QgsNetworkAccessManager.instance().get(rq)
self.reply.finished.connect(self.requestFinished)
except Exception, e:
if algHelp.startswith('http'):
html = self.tr('<p>Downloading algorithm help... Please wait.</p>')
self.txtHelp.setHtml(html)
rq = QNetworkRequest(QUrl(algHelp))
self.reply = QgsNetworkAccessManager.instance().get(rq)
self.reply.finished.connect(self.requestFinished)
else:
if algHelp.startswith('file://'):
p = os.path.dirname(algHelp[7:])
self.txtHelp.setSearchPaths([p])
self.txtHelp.setSource(QUrl(algHelp))
except Exception as e:
self.tabWidget.removeTab(2)
else:
self.tabWidget.removeTab(2)

0 comments on commit 03a444c

Please sign in to comment.
You can’t perform that action at this time.