Skip to content

Commit 0e0947f

Browse files
committed
add helpful info to GdalTools Settings dialog on how to configure GDAL path
1 parent 99edf1d commit 0e0947f

File tree

4 files changed

+64
-13
lines changed

4 files changed

+64
-13
lines changed
969 Bytes
Loading

python/plugins/GdalTools/resources.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<file>icons/fillnodata.png</file>
2525
<file>icons/edit.png</file>
2626
<file>icons/reset.png</file>
27+
<file>icons/tooltip.png</file>
2728
</qresource>
2829
</RCC>

python/plugins/GdalTools/tools/dialogSettings.ui

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,36 @@
77
<x>0</x>
88
<y>0</y>
99
<width>368</width>
10-
<height>324</height>
10+
<height>337</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Gdal Tools settings</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
18-
<widget class="QLabel" name="label">
19-
<property name="text">
20-
<string>Path to the GDAL binaries</string>
21-
</property>
22-
</widget>
18+
<layout class="QHBoxLayout" name="horizontalLayout_6">
19+
<item>
20+
<widget class="QLabel" name="label">
21+
<property name="text">
22+
<string>Path to the GDAL binaries</string>
23+
</property>
24+
</widget>
25+
</item>
26+
<item>
27+
<widget class="QLabel" name="bin_tooltip_label">
28+
<property name="sizePolicy">
29+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
30+
<horstretch>0</horstretch>
31+
<verstretch>0</verstretch>
32+
</sizepolicy>
33+
</property>
34+
<property name="text">
35+
<string notr="true">##tooltip icon##</string>
36+
</property>
37+
</widget>
38+
</item>
39+
</layout>
2340
</item>
2441
<item>
2542
<layout class="QHBoxLayout" name="horizontalLayout">
@@ -36,11 +53,28 @@
3653
</layout>
3754
</item>
3855
<item>
39-
<widget class="QLabel" name="label_5">
40-
<property name="text">
41-
<string>GDAL help path</string>
42-
</property>
43-
</widget>
56+
<layout class="QHBoxLayout" name="horizontalLayout_7">
57+
<item>
58+
<widget class="QLabel" name="label_5">
59+
<property name="text">
60+
<string>GDAL help path</string>
61+
</property>
62+
</widget>
63+
</item>
64+
<item>
65+
<widget class="QLabel" name="help_tooltip_label">
66+
<property name="sizePolicy">
67+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
68+
<horstretch>0</horstretch>
69+
<verstretch>0</verstretch>
70+
</sizepolicy>
71+
</property>
72+
<property name="text">
73+
<string notr="true">##tooltip icon##</string>
74+
</property>
75+
</widget>
76+
</item>
77+
</layout>
4478
</item>
4579
<item>
4680
<layout class="QHBoxLayout" name="horizontalLayout_5">

python/plugins/GdalTools/tools/doSettings.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,34 @@
88
from ui_dialogSettings import Ui_GdalToolsSettingsDialog as Ui_Dialog
99
import GdalTools_utils as Utils
1010

11+
from .. import resources_rc
12+
1113
class GdalToolsSettingsDialog( QDialog, Ui_Dialog ):
1214
def __init__( self, iface ):
1315
QDialog.__init__( self, iface.mainWindow() )
1416
self.setAttribute(Qt.WA_DeleteOnClose)
1517
self.iface = iface
1618
self.setupUi( self )
1719

20+
# binaries
1821
self.leGdalBinPath.setText( Utils.getGdalPath() )
19-
self.leGdalHelpPath.setText( Utils.getHelpPath() )
20-
2122
QObject.connect( self.btnSetBinPath, SIGNAL( "clicked()" ), self.setBinPath )
23+
self.bin_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
24+
self.bin_tooltip_label.setToolTip( self.tr( \
25+
u"""A list of colon-separated (Linux and MacOS) or
26+
semicolon-separated (Windows) paths to executables.
27+
28+
MacOS users usually need to set it to something like
29+
/Library/Frameworks/GDAL.framework/Versions/1.8/Programs""") )
30+
31+
# help
32+
self.leGdalHelpPath.setText( Utils.getHelpPath() )
2233
QObject.connect( self.btnSetHelpPath, SIGNAL( "clicked()" ), self.setHelpPath )
34+
self.help_tooltip_label.setPixmap( QPixmap(':/icons/tooltip.png') )
35+
self.help_tooltip_label.setToolTip( self.tr( \
36+
u"""Useful to open local GDAL documentation instead of online help
37+
when pressing on the tool dialog's Help button.""") )
38+
2339

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

0 commit comments

Comments
 (0)