Skip to content

Commit

Permalink
Allow users to open the local gdal documentation by clicking on the H…
Browse files Browse the repository at this point in the history
…elp button, to fix #3040

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14544 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Nov 11, 2010
1 parent 3307fa6 commit 850c6ca
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/__init__.py
Expand Up @@ -22,7 +22,7 @@ def name():
def description():
return "Integrate gdal tools into qgis"
def version():
return "Version 1.2.16"
return "Version 1.2.17"
def qgisMinimumVersion():
return "1.0"
def classFactory(iface):
Expand Down
10 changes: 10 additions & 0 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Expand Up @@ -54,6 +54,16 @@ def setGdalPath( path ):
settings = QSettings()
settings.setValue( "/GdalTools/gdalPath", QVariant( path ) )

# Retrieves GDAL help files location
def getHelpPath():
settings = QSettings()
return settings.value( "/GdalTools/helpPath", QVariant( "" ) ).toString()

# Stores GDAL help files location
def setHelpPath( path ):
settings = QSettings()
settings.setValue( "/GdalTools/helpPath", QVariant( path ) )

# Retrieves last used encoding from persistent settings
def getLastUsedEncoding():
settings = QSettings()
Expand Down
6 changes: 5 additions & 1 deletion python/plugins/GdalTools/tools/dialogBase.py
Expand Up @@ -81,7 +81,11 @@ def processFinished(self, exitCode, status):

# show the online tool documentation in the default browser
def onHelp(self):
url = QUrl("http://www.gdal.org/" + self.helpFileName)
helpPath = Utils.getHelpPath()
if helpPath.isEmpty():
url = QUrl("http://www.gdal.org/" + self.helpFileName)
else:
url = QUrl.fromLocalFile(helpPath + '/' + self.helpFileName)
QDesktopServices.openUrl(url)

def setCommandViewerEnabled(self, enable):
Expand Down
11 changes: 11 additions & 0 deletions python/plugins/GdalTools/tools/doSettings.py
Expand Up @@ -15,8 +15,10 @@ def __init__( self, iface ):
self.setupUi( self )

self.leGdalBinPath.setText( Utils.getGdalPath() )
self.leGdalHelpPath.setText( Utils.getHelpPath() )

QObject.connect( self.btnSetBinPath, SIGNAL( "clicked()" ), self.setBinPath )
QObject.connect( self.btnSetHelpPath, SIGNAL( "clicked()" ), self.setHelpPath )

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

self.leGdalBinPath.setText( inputDir )

def setHelpPath( self ):
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select directory with the GDAL documentation" ) )
if inputDir.isEmpty():
return

self.leGdalHelpPath.setText( inputDir )


def accept( self ):
Utils.setGdalPath( self.leGdalBinPath.text() )
Utils.setHelpPath( self.leGdalHelpPath.text() )
QDialog.accept( self )

0 comments on commit 850c6ca

Please sign in to comment.