Skip to content

Commit

Permalink
add helpful info to GdalTools Settings dialog on how to configure GDA…
Browse files Browse the repository at this point in the history
…L path
  • Loading branch information
brushtyler committed Dec 1, 2011
1 parent 99edf1d commit 0e0947f
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 13 deletions.
Binary file added python/plugins/GdalTools/icons/tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/plugins/GdalTools/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<file>icons/fillnodata.png</file>
<file>icons/edit.png</file>
<file>icons/reset.png</file>
<file>icons/tooltip.png</file>
</qresource>
</RCC>
56 changes: 45 additions & 11 deletions python/plugins/GdalTools/tools/dialogSettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,36 @@
<x>0</x>
<y>0</y>
<width>368</width>
<height>324</height>
<height>337</height>
</rect>
</property>
<property name="windowTitle">
<string>Gdal Tools settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Path to the GDAL binaries</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Path to the GDAL binaries</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bin_tooltip_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">##tooltip icon##</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
Expand All @@ -36,11 +53,28 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>GDAL help path</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>GDAL help path</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="help_tooltip_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">##tooltip icon##</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
Expand Down
20 changes: 18 additions & 2 deletions python/plugins/GdalTools/tools/doSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,34 @@
from ui_dialogSettings import Ui_GdalToolsSettingsDialog as Ui_Dialog
import GdalTools_utils as Utils

from .. import resources_rc

class GdalToolsSettingsDialog( QDialog, Ui_Dialog ):
def __init__( self, iface ):
QDialog.__init__( self, iface.mainWindow() )
self.setAttribute(Qt.WA_DeleteOnClose)
self.iface = iface
self.setupUi( self )

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

QObject.connect( self.btnSetBinPath, SIGNAL( "clicked()" ), self.setBinPath )
self.bin_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
self.bin_tooltip_label.setToolTip( self.tr( \
u"""A list of colon-separated (Linux and MacOS) or
semicolon-separated (Windows) paths to executables.
MacOS users usually need to set it to something like
/Library/Frameworks/GDAL.framework/Versions/1.8/Programs""") )

# help
self.leGdalHelpPath.setText( Utils.getHelpPath() )
QObject.connect( self.btnSetHelpPath, SIGNAL( "clicked()" ), self.setHelpPath )
self.help_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
self.help_tooltip_label.setToolTip( self.tr( \
u"""Useful to open local GDAL documentation instead of online help
when pressing on the tool dialog's Help button.""") )


def setBinPath( self ):
inputDir = Utils.FileDialog.getExistingDirectory( self, self.tr( "Select directory with GDAL executables" ) )
Expand Down

0 comments on commit 0e0947f

Please sign in to comment.