Skip to content

Commit 850c6ca

Browse files
author
brushtyler
committedNov 11, 2010
Allow users to open the local gdal documentation by clicking on the Help button, to fix #3040
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14544 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed
 

‎python/plugins/GdalTools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def name():
2222
def description():
2323
return "Integrate gdal tools into qgis"
2424
def version():
25-
return "Version 1.2.16"
25+
return "Version 1.2.17"
2626
def qgisMinimumVersion():
2727
return "1.0"
2828
def classFactory(iface):

‎python/plugins/GdalTools/tools/GdalTools_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ def setGdalPath( path ):
5454
settings = QSettings()
5555
settings.setValue( "/GdalTools/gdalPath", QVariant( path ) )
5656

57+
# Retrieves GDAL help files location
58+
def getHelpPath():
59+
settings = QSettings()
60+
return settings.value( "/GdalTools/helpPath", QVariant( "" ) ).toString()
61+
62+
# Stores GDAL help files location
63+
def setHelpPath( path ):
64+
settings = QSettings()
65+
settings.setValue( "/GdalTools/helpPath", QVariant( path ) )
66+
5767
# Retrieves last used encoding from persistent settings
5868
def getLastUsedEncoding():
5969
settings = QSettings()

‎python/plugins/GdalTools/tools/dialogBase.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def processFinished(self, exitCode, status):
8181

8282
# show the online tool documentation in the default browser
8383
def onHelp(self):
84-
url = QUrl("http://www.gdal.org/" + self.helpFileName)
84+
helpPath = Utils.getHelpPath()
85+
if helpPath.isEmpty():
86+
url = QUrl("http://www.gdal.org/" + self.helpFileName)
87+
else:
88+
url = QUrl.fromLocalFile(helpPath + '/' + self.helpFileName)
8589
QDesktopServices.openUrl(url)
8690

8791
def setCommandViewerEnabled(self, enable):

‎python/plugins/GdalTools/tools/doSettings.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ def __init__( self, iface ):
1515
self.setupUi( self )
1616

1717
self.leGdalBinPath.setText( Utils.getGdalPath() )
18+
self.leGdalHelpPath.setText( Utils.getHelpPath() )
1819

1920
QObject.connect( self.btnSetBinPath, SIGNAL( "clicked()" ), self.setBinPath )
21+
QObject.connect( self.btnSetHelpPath, SIGNAL( "clicked()" ), self.setHelpPath )
2022

2123
def setBinPath( self ):
2224
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select directory with GDAL executables" ) )
@@ -25,6 +27,15 @@ def setBinPath( self ):
2527

2628
self.leGdalBinPath.setText( inputDir )
2729

30+
def setHelpPath( self ):
31+
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select directory with the GDAL documentation" ) )
32+
if inputDir.isEmpty():
33+
return
34+
35+
self.leGdalHelpPath.setText( inputDir )
36+
37+
2838
def accept( self ):
2939
Utils.setGdalPath( self.leGdalBinPath.text() )
40+
Utils.setHelpPath( self.leGdalHelpPath.text() )
3041
QDialog.accept( self )

0 commit comments

Comments
 (0)
Please sign in to comment.