Skip to content

Commit

Permalink
use QDesktopServices to open help files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Oct 4, 2012
1 parent 4475854 commit 4e02cfb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
11 changes: 2 additions & 9 deletions python/plugins/sextante/SextantePlugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os, sys
import inspect
import subprocess

from PyQt4.QtCore import *
from PyQt4.QtGui import *
Expand Down Expand Up @@ -122,14 +121,8 @@ def openConfig(self):
dlg.exec_()

def openAbout(self):
dlg = AboutDialog(self)
dlg = AboutDialog()
dlg.exec_()

def openHelp(self):
filename = os.path.dirname(__file__) + "/help/index.html"
if os.name == "nt":
os.startfile(filename)
elif sys.platform == "darwin":
subprocess.Popen(('open', filename))
else:
subprocess.call(('xdg-open', filename))
QDesktopServices.openUrl(QUrl(os.path.dirname(__file__) + "/help/index.html"))
45 changes: 26 additions & 19 deletions python/plugins/sextante/about/AboutDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,37 @@

class AboutDialog(QDialog, Ui_DlgAbout):

def __init__(self, parent):
def __init__(self):
QDialog.__init__(self)
self.setupUi(self)

self.buttonBox.helpRequested.connect(self.openHelp)

self.setAboutText()

def setAboutText(self):
strAbout = self.tr("""
<img src="qrc:/sextante/images/sextante_logo.png" />
<h2>SEXTANTE for QGIS</h2>
<p>SEXTANTE, a geoprocessing platform for QGIS</p>
<p>A development by Victor Olaya (volayaf@gmail.com).</p>
<p>Portions of this software contributed by:
<ul>
<li>Alexander Bruy</li>
<li>Carson Farmer (fTools algorithms)</li>
<li>Julien Malik (Orfeo Toolbox connectors)</li>
<li>Evgeniy Nikulin (Original Field Pyculator code)</li>
<li>Michael Nimm (mmqgis algorithms)</li>
<li>Camilo Polymeris (Threading). Developed as part of Google Summer of Code 2012</li>
</ul>
</p>
<p>You are currently using SEXTANTE v%1</p>
<p>This software is distributed under the terms of the GNU GPL License v2.
<p>For more information, please visit our website at <a href="http://sextantegis.com">http://sextantegis.com</a></p>
""").arg(version())
<img src="qrc:/sextante/images/sextante_logo.png" />
<h2>SEXTANTE for QGIS</h2>
<p>SEXTANTE, a geoprocessing platform for QGIS</p>
<p>A development by Victor Olaya (volayaf@gmail.com).</p>
<p>Portions of this software contributed by:
<ul>
<li>Alexander Bruy</li>
<li>Carson Farmer (fTools algorithms)</li>
<li>Julien Malik (Orfeo Toolbox connectors)</li>
<li>Evgeniy Nikulin (Original Field Pyculator code)</li>
<li>Michael Nimm (mmqgis algorithms)</li>
<li>Camilo Polymeris (Threading). Developed as part of Google
Summer of Code 2012</li>
</ul>
</p>
<p>You are currently using SEXTANTE v%1</p>
<p>This software is distributed under the terms of the GNU GPL License v2.
<p>For more information, please visit our website at
<a href="http://sextantegis.com">http://sextantegis.com</a></p>
""").arg(version())
self.webView.setHtml(strAbout)

def openHelp(self):
QDesktopServices.openUrl(QUrl(os.path.join(os.path.dirname(__file__), os.path.pardir) + "/help/index.html"))

0 comments on commit 4e02cfb

Please sign in to comment.