Skip to content

Commit 11a9a66

Browse files
committed
[processing] add icons for fTools and GDALTools algorithms
1 parent 9b9c692 commit 11a9a66

File tree

133 files changed

+657
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+657
-29
lines changed

python/plugins/processing/algs/gdal/ClipByExtent.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
import os
29+
30+
from PyQt4.QtGui import QIcon
31+
2832
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
2933

3034
from processing.core.parameters import ParameterRaster
@@ -37,6 +41,8 @@
3741

3842
from processing.algs.gdal.GdalUtils import GdalUtils
3943

44+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
45+
4046

4147
class ClipByExtent(GdalAlgorithm):
4248

@@ -57,6 +63,9 @@ class ClipByExtent(GdalAlgorithm):
5763
COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE']
5864
TFW = 'TFW'
5965

66+
def getIcon(self):
67+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))
68+
6069
def defineCharacteristics(self):
6170
self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent')
6271
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')

python/plugins/processing/algs/gdal/ClipByMask.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
import os
29+
30+
from PyQt4.QtGui import QIcon
31+
2832
from osgeo import gdal
2933

3034
from processing.core.parameters import ParameterRaster
@@ -42,6 +46,8 @@
4246
from processing.tools import dataobjects
4347
from processing.tools.vector import ogrConnectionString
4448

49+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
50+
4551

4652
class ClipByMask(GdalAlgorithm):
4753

@@ -65,6 +71,9 @@ class ClipByMask(GdalAlgorithm):
6571
COMPRESSTYPE = ['NONE', 'JPEG', 'LZW', 'PACKBITS', 'DEFLATE']
6672
TFW = 'TFW'
6773

74+
def getIcon(self):
75+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))
76+
6877
def defineCharacteristics(self):
6978
self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer')
7079
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')

python/plugins/processing/algs/gdal/GridAverage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
import os
2929

30+
from PyQt4.QtGui import QIcon
31+
3032
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3133
from processing.core.parameters import ParameterVector
3234
from processing.core.parameters import ParameterTableField
@@ -35,6 +37,8 @@
3537
from processing.core.outputs import OutputRaster
3638
from processing.algs.gdal.GdalUtils import GdalUtils
3739

40+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
41+
3842

3943
class GridAverage(GdalAlgorithm):
4044

@@ -50,6 +54,9 @@ class GridAverage(GdalAlgorithm):
5054

5155
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
5256

57+
def getIcon(self):
58+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
59+
5360
def commandLineName(self):
5461
return "gdalogr:gridaverage"
5562

python/plugins/processing/algs/gdal/GridDataMetrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
import os
2929

30+
from PyQt4.QtGui import QIcon
31+
3032
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3133
from processing.core.parameters import ParameterVector
3234
from processing.core.parameters import ParameterTableField
@@ -35,6 +37,8 @@
3537
from processing.core.outputs import OutputRaster
3638
from processing.algs.gdal.GdalUtils import GdalUtils
3739

40+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
41+
3842

3943
class GridDataMetrics(GdalAlgorithm):
4044

@@ -54,6 +58,9 @@ class GridDataMetrics(GdalAlgorithm):
5458
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
5559
'Average distance between points']
5660

61+
def getIcon(self):
62+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
63+
5764
def commandLineName(self):
5865
return "gdalogr:griddatametrics"
5966

python/plugins/processing/algs/gdal/GridInvDist.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import os
3030

31+
from PyQt4.QtGui import QIcon
32+
3133
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3234
from processing.core.parameters import ParameterVector
3335
from processing.core.parameters import ParameterTableField
@@ -36,6 +38,8 @@
3638
from processing.core.outputs import OutputRaster
3739
from processing.algs.gdal.GdalUtils import GdalUtils
3840

41+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
42+
3943

4044
class GridInvDist(GdalAlgorithm):
4145

@@ -54,6 +58,9 @@ class GridInvDist(GdalAlgorithm):
5458

5559
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
5660

61+
def getIcon(self):
62+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
63+
5764
def commandLineName(self):
5865
return "gdalogr:gridinvdist"
5966

python/plugins/processing/algs/gdal/GridNearest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import os
3030

31+
from PyQt4.QtGui import QIcon
32+
3133
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3234
from processing.core.parameters import ParameterVector
3335
from processing.core.parameters import ParameterTableField
@@ -36,6 +38,8 @@
3638
from processing.core.outputs import OutputRaster
3739
from processing.algs.gdal.GdalUtils import GdalUtils
3840

41+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
42+
3943

4044
class GridNearest(GdalAlgorithm):
4145

@@ -50,6 +54,9 @@ class GridNearest(GdalAlgorithm):
5054

5155
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
5256

57+
def getIcon(self):
58+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
59+
5360
def commandLineName(self):
5461
return "gdalogr:gridnearestneighbor"
5562

python/plugins/processing/algs/gdal/aspect.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
import os
29+
30+
from PyQt4.QtGui import QIcon
2831

2932
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3033
from processing.core.parameters import ParameterRaster
@@ -33,6 +36,8 @@
3336
from processing.core.outputs import OutputRaster
3437
from processing.algs.gdal.GdalUtils import GdalUtils
3538

39+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
40+
3641

3742
class aspect(GdalAlgorithm):
3843

@@ -45,8 +50,7 @@ class aspect(GdalAlgorithm):
4550
OUTPUT = 'OUTPUT'
4651

4752
#def getIcon(self):
48-
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
49-
# return QIcon(filepath)
53+
# return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'dem.png'))
5054

5155
def defineCharacteristics(self):
5256
self.name, self.i18n_name = self.trAlgorithm('Aspect')

python/plugins/processing/algs/gdal/buildvrt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
import os
29+
30+
from PyQt4.QtGui import QIcon
2831

2932
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3033
from processing.core.outputs import OutputRaster
@@ -34,7 +37,7 @@
3437
from processing.algs.gdal.GdalUtils import GdalUtils
3538
from processing.tools.system import tempFolder
3639

37-
import os
40+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
3841

3942

4043
class buildvrt(GdalAlgorithm):
@@ -47,6 +50,9 @@ class buildvrt(GdalAlgorithm):
4750

4851
RESOLUTION_OPTIONS = ['average', 'highest', 'lowest']
4952

53+
def getIcon(self):
54+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'vrt.png'))
55+
5056
def defineCharacteristics(self):
5157
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
5258
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')

python/plugins/processing/algs/gdal/contour.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
import os
29+
30+
from PyQt4.QtGui import QIcon
31+
2832
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
2933

3034
from processing.core.parameters import ParameterRaster
@@ -35,6 +39,8 @@
3539

3640
from processing.algs.gdal.GdalUtils import GdalUtils
3741

42+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
43+
3844

3945
class contour(GdalAlgorithm):
4046

@@ -44,6 +50,9 @@ class contour(GdalAlgorithm):
4450
FIELD_NAME = 'FIELD_NAME'
4551
EXTRA = 'EXTRA'
4652

53+
def getIcon(self):
54+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'contour.png'))
55+
4756
def defineCharacteristics(self):
4857
self.name, self.i18n_name = self.trAlgorithm('Contour')
4958
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')

python/plugins/processing/algs/gdal/extractprojection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,25 @@
2727

2828
import os
2929

30+
from PyQt4.QtGui import QIcon
31+
3032
from osgeo import gdal, osr
3133

3234
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
3335
from processing.core.parameters import ParameterRaster
3436
from processing.core.parameters import ParameterBoolean
3537

38+
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
39+
3640

3741
class ExtractProjection(GdalAlgorithm):
3842

3943
INPUT = 'INPUT'
4044
PRJ_FILE = 'PRJ_FILE'
4145

46+
def getIcon(self):
47+
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-export.png'))
48+
4249
def defineCharacteristics(self):
4350
self.name, self.i18n_name = self.trAlgorithm('Extract projection')
4451
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Projections')

0 commit comments

Comments
 (0)