Skip to content
Permalink
Browse files

Allow users to open the local gdal documentation by clicking on the H…

…elp button, to fix #3040

git-svn-id: http://svn.osgeo.org/qgis/trunk@14544 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler
brushtyler committed Nov 11, 2010
1 parent 3606744 commit 404d0aee4616ee61e18a8176f588015c88b7e25a
@@ -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):
@@ -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()
@@ -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):
@@ -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" ) )
@@ -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 404d0ae

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