Skip to content

Commit 4e02cfb

Browse files
committed
use QDesktopServices to open help files
1 parent 4475854 commit 4e02cfb

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎python/plugins/sextante/SextantePlugin.py‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os, sys
22
import inspect
3-
import subprocess
43

54
from PyQt4.QtCore import *
65
from PyQt4.QtGui import *
@@ -122,14 +121,8 @@ def openConfig(self):
122121
dlg.exec_()
123122

124123
def openAbout(self):
125-
dlg = AboutDialog(self)
124+
dlg = AboutDialog()
126125
dlg.exec_()
127126

128127
def openHelp(self):
129-
filename = os.path.dirname(__file__) + "/help/index.html"
130-
if os.name == "nt":
131-
os.startfile(filename)
132-
elif sys.platform == "darwin":
133-
subprocess.Popen(('open', filename))
134-
else:
135-
subprocess.call(('xdg-open', filename))
128+
QDesktopServices.openUrl(QUrl(os.path.dirname(__file__) + "/help/index.html"))

‎python/plugins/sextante/about/AboutDialog.py‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,37 @@
1010

1111
class AboutDialog(QDialog, Ui_DlgAbout):
1212

13-
def __init__(self, parent):
13+
def __init__(self):
1414
QDialog.__init__(self)
1515
self.setupUi(self)
1616

17+
self.buttonBox.helpRequested.connect(self.openHelp)
18+
1719
self.setAboutText()
1820

1921
def setAboutText(self):
2022
strAbout = self.tr("""
21-
<img src="qrc:/sextante/images/sextante_logo.png" />
22-
<h2>SEXTANTE for QGIS</h2>
23-
<p>SEXTANTE, a geoprocessing platform for QGIS</p>
24-
<p>A development by Victor Olaya (volayaf@gmail.com).</p>
25-
<p>Portions of this software contributed by:
26-
<ul>
27-
<li>Alexander Bruy</li>
28-
<li>Carson Farmer (fTools algorithms)</li>
29-
<li>Julien Malik (Orfeo Toolbox connectors)</li>
30-
<li>Evgeniy Nikulin (Original Field Pyculator code)</li>
31-
<li>Michael Nimm (mmqgis algorithms)</li>
32-
<li>Camilo Polymeris (Threading). Developed as part of Google Summer of Code 2012</li>
33-
</ul>
34-
</p>
35-
<p>You are currently using SEXTANTE v%1</p>
36-
<p>This software is distributed under the terms of the GNU GPL License v2.
37-
<p>For more information, please visit our website at <a href="http://sextantegis.com">http://sextantegis.com</a></p>
38-
""").arg(version())
23+
<img src="qrc:/sextante/images/sextante_logo.png" />
24+
<h2>SEXTANTE for QGIS</h2>
25+
<p>SEXTANTE, a geoprocessing platform for QGIS</p>
26+
<p>A development by Victor Olaya (volayaf@gmail.com).</p>
27+
<p>Portions of this software contributed by:
28+
<ul>
29+
<li>Alexander Bruy</li>
30+
<li>Carson Farmer (fTools algorithms)</li>
31+
<li>Julien Malik (Orfeo Toolbox connectors)</li>
32+
<li>Evgeniy Nikulin (Original Field Pyculator code)</li>
33+
<li>Michael Nimm (mmqgis algorithms)</li>
34+
<li>Camilo Polymeris (Threading). Developed as part of Google
35+
Summer of Code 2012</li>
36+
</ul>
37+
</p>
38+
<p>You are currently using SEXTANTE v%1</p>
39+
<p>This software is distributed under the terms of the GNU GPL License v2.
40+
<p>For more information, please visit our website at
41+
<a href="http://sextantegis.com">http://sextantegis.com</a></p>
42+
""").arg(version())
3943
self.webView.setHtml(strAbout)
44+
45+
def openHelp(self):
46+
QDesktopServices.openUrl(QUrl(os.path.join(os.path.dirname(__file__), os.path.pardir) + "/help/index.html"))

0 commit comments

Comments
 (0)