Skip to content
Permalink
Browse files
Move algorithm icon handling to QgsProcessingAlgorithm
  • Loading branch information
nyalldawson committed Apr 3, 2017
1 parent 28e7573 commit faa8a653b260cdc6faf2586824c8d2d284753889
Showing with 899 additions and 193 deletions.
  1. +2 −0 python/core/processing/qgsprocessingalgorithm.sip
  2. +1 −1 python/plugins/processing/algs/gdal/AssignProjection.py
  3. +1 −1 python/plugins/processing/algs/gdal/ClipByExtent.py
  4. +1 −1 python/plugins/processing/algs/gdal/ClipByMask.py
  5. +5 −5 python/plugins/processing/algs/gdal/GdalAlgorithm.py
  6. +1 −1 python/plugins/processing/algs/gdal/GridAverage.py
  7. +1 −1 python/plugins/processing/algs/gdal/GridDataMetrics.py
  8. +1 −1 python/plugins/processing/algs/gdal/GridInvDist.py
  9. +1 −1 python/plugins/processing/algs/gdal/GridNearest.py
  10. +1 −1 python/plugins/processing/algs/gdal/buildvrt.py
  11. +1 −1 python/plugins/processing/algs/gdal/contour.py
  12. +1 −1 python/plugins/processing/algs/gdal/extractprojection.py
  13. +1 −1 python/plugins/processing/algs/gdal/gdaladdo.py
  14. +1 −1 python/plugins/processing/algs/gdal/gdaltindex.py
  15. +1 −1 python/plugins/processing/algs/gdal/information.py
  16. +1 −1 python/plugins/processing/algs/gdal/merge.py
  17. +1 −1 python/plugins/processing/algs/gdal/nearblack.py
  18. +1 −1 python/plugins/processing/algs/gdal/pct2rgb.py
  19. +1 −1 python/plugins/processing/algs/gdal/polygonize.py
  20. +1 −1 python/plugins/processing/algs/gdal/proximity.py
  21. +1 −1 python/plugins/processing/algs/gdal/rasterize.py
  22. +1 −1 python/plugins/processing/algs/gdal/rasterize_over.py
  23. +1 −1 python/plugins/processing/algs/gdal/rgb2pct.py
  24. +1 −1 python/plugins/processing/algs/gdal/sieve.py
  25. +1 −1 python/plugins/processing/algs/gdal/translate.py
  26. +1 −1 python/plugins/processing/algs/gdal/warp.py
  27. +5 −5 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  28. +1 −1 python/plugins/processing/algs/grass7/nviz7.py
  29. +9 −1 python/plugins/processing/algs/qgis/AddTableField.py
  30. +1 −1 python/plugins/processing/algs/qgis/Aspect.py
  31. +9 −1 python/plugins/processing/algs/qgis/AutoincrementalField.py
  32. +7 −0 python/plugins/processing/algs/qgis/BarPlot.py
  33. +1 −1 python/plugins/processing/algs/qgis/BasicStatistics.py
  34. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  35. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsStrings.py
  36. +1 −1 python/plugins/processing/algs/qgis/Boundary.py
  37. +1 −1 python/plugins/processing/algs/qgis/BoundingBox.py
  38. +1 −1 python/plugins/processing/algs/qgis/Centroids.py
  39. +1 −1 python/plugins/processing/algs/qgis/CheckValidity.py
  40. +1 −1 python/plugins/processing/algs/qgis/Clip.py
  41. +11 −1 python/plugins/processing/algs/qgis/ConcaveHull.py
  42. +1 −1 python/plugins/processing/algs/qgis/ConvexHull.py
  43. +9 −1 python/plugins/processing/algs/qgis/CreateAttributeIndex.py
  44. +7 −0 python/plugins/processing/algs/qgis/CreateConstantRaster.py
  45. +8 −1 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  46. +8 −1 python/plugins/processing/algs/qgis/DefineProjection.py
  47. +1 −1 python/plugins/processing/algs/qgis/Delaunay.py
  48. +7 −0 python/plugins/processing/algs/qgis/DeleteColumn.py
  49. +8 −1 python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
  50. +7 −0 python/plugins/processing/algs/qgis/DeleteHoles.py
  51. +10 −1 python/plugins/processing/algs/qgis/DensifyGeometries.py
  52. +10 −1 python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
  53. +1 −1 python/plugins/processing/algs/qgis/Difference.py
  54. +1 −1 python/plugins/processing/algs/qgis/Dissolve.py
  55. +10 −1 python/plugins/processing/algs/qgis/DropGeometry.py
  56. +1 −1 python/plugins/processing/algs/qgis/EliminateSelection.py
  57. +9 −1 python/plugins/processing/algs/qgis/EquivalentNumField.py
  58. +11 −2 python/plugins/processing/algs/qgis/ExecuteSQL.py
  59. +10 −1 python/plugins/processing/algs/qgis/Explode.py
  60. +1 −1 python/plugins/processing/algs/qgis/ExportGeometryInfo.py
  61. +7 −1 python/plugins/processing/algs/qgis/ExtendLines.py
  62. +1 −1 python/plugins/processing/algs/qgis/ExtentFromLayer.py
  63. +9 −1 python/plugins/processing/algs/qgis/ExtractByAttribute.py
  64. +9 −1 python/plugins/processing/algs/qgis/ExtractByExpression.py
  65. +8 −1 python/plugins/processing/algs/qgis/ExtractByLocation.py
  66. +1 −1 python/plugins/processing/algs/qgis/ExtractNodes.py
  67. +11 −1 python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
  68. +9 −1 python/plugins/processing/algs/qgis/FieldPyculator.py
  69. +15 −1 python/plugins/processing/algs/qgis/FieldsCalculator.py
  70. +13 −1 python/plugins/processing/algs/qgis/FieldsMapper.py
  71. +8 −1 python/plugins/processing/algs/qgis/FindProjection.py
  72. +9 −1 python/plugins/processing/algs/qgis/FixGeometry.py
  73. +1 −1 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  74. +12 −1 python/plugins/processing/algs/qgis/GeometryByExpression.py
  75. +10 −1 python/plugins/processing/algs/qgis/GeometryConvert.py
  76. +1 −1 python/plugins/processing/algs/qgis/GridLine.py
  77. +1 −1 python/plugins/processing/algs/qgis/GridPolygon.py
  78. +11 −1 python/plugins/processing/algs/qgis/Gridify.py
  79. +1 −1 python/plugins/processing/algs/qgis/Heatmap.py
  80. +1 −1 python/plugins/processing/algs/qgis/Hillshade.py
  81. +13 −1 python/plugins/processing/algs/qgis/HubDistanceLines.py
  82. +13 −1 python/plugins/processing/algs/qgis/HubDistancePoints.py
  83. +11 −1 python/plugins/processing/algs/qgis/HubLines.py
  84. +9 −1 python/plugins/processing/algs/qgis/HypsometricCurves.py
  85. +1 −1 python/plugins/processing/algs/qgis/IdwInterpolation.py
  86. +9 −1 python/plugins/processing/algs/qgis/ImportIntoPostGIS.py
  87. +9 −1 python/plugins/processing/algs/qgis/ImportIntoSpatialite.py
  88. +1 −1 python/plugins/processing/algs/qgis/Intersection.py
  89. +8 −1 python/plugins/processing/algs/qgis/JoinAttributes.py
  90. +1 −1 python/plugins/processing/algs/qgis/LinesIntersection.py
  91. +1 −1 python/plugins/processing/algs/qgis/LinesToPolygons.py
  92. +7 −0 python/plugins/processing/algs/qgis/MeanAndStdDevPlot.py
  93. +1 −1 python/plugins/processing/algs/qgis/MeanCoords.py
  94. +1 −1 python/plugins/processing/algs/qgis/Merge.py
  95. +1 −1 python/plugins/processing/algs/qgis/MergeLines.py
  96. +1 −1 python/plugins/processing/algs/qgis/MultipartToSingleparts.py
  97. +1 −1 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  98. +8 −1 python/plugins/processing/algs/qgis/OffsetLine.py
  99. +13 −1 python/plugins/processing/algs/qgis/OrientedMinimumBoundingBox.py
  100. +7 −0 python/plugins/processing/algs/qgis/Orthogonalize.py
  101. +1 −1 python/plugins/processing/algs/qgis/PointDistance.py
  102. +1 −1 python/plugins/processing/algs/qgis/PointOnSurface.py
  103. +1 −1 python/plugins/processing/algs/qgis/PointsAlongGeometry.py
  104. +11 −1 python/plugins/processing/algs/qgis/PointsDisplacement.py
  105. +13 −1 python/plugins/processing/algs/qgis/PointsFromLines.py
  106. +13 −1 python/plugins/processing/algs/qgis/PointsFromPolygons.py
  107. +1 −1 python/plugins/processing/algs/qgis/PointsInPolygon.py
  108. +11 −1 python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
  109. +11 −1 python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py
  110. +11 −1 python/plugins/processing/algs/qgis/PointsLayerFromTable.py
  111. +13 −1 python/plugins/processing/algs/qgis/PointsToPaths.py
  112. +7 −0 python/plugins/processing/algs/qgis/PolarPlot.py
  113. +1 −1 python/plugins/processing/algs/qgis/PoleOfInaccessibility.py
  114. +1 −1 python/plugins/processing/algs/qgis/PolygonCentroids.py
  115. +8 −1 python/plugins/processing/algs/qgis/Polygonize.py
  116. +1 −1 python/plugins/processing/algs/qgis/PolygonsToLines.py
  117. +7 −0 python/plugins/processing/algs/qgis/PostGISExecuteSQL.py
  118. +0 −3 python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
  119. +7 −0 python/plugins/processing/algs/qgis/RandomExtract.py
  120. +7 −0 python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
  121. +15 −2 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  122. +1 −1 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  123. +1 −1 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  124. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygonsFixed.py
  125. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygonsVariable.py
  126. +1 −1 python/plugins/processing/algs/qgis/RandomSelection.py
  127. +1 −1 python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py
  128. +8 −1 python/plugins/processing/algs/qgis/RasterCalculator.py
  129. +7 −0 python/plugins/processing/algs/qgis/RasterLayerHistogram.py
  130. +7 −0 python/plugins/processing/algs/qgis/RasterLayerStatistics.py
  131. +11 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py
  132. +11 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
  133. +1 −1 python/plugins/processing/algs/qgis/RegularPoints.py
  134. +1 −1 python/plugins/processing/algs/qgis/Relief.py
  135. +7 −0 python/plugins/processing/algs/qgis/RemoveNullGeometry.py
  136. +1 −1 python/plugins/processing/algs/qgis/ReprojectLayer.py
  137. +9 −1 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  138. +1 −1 python/plugins/processing/algs/qgis/Ruggedness.py
  139. +7 −0 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
  140. +7 −0 python/plugins/processing/algs/qgis/SelectByAttribute.py
  141. +9 −1 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  142. +9 −1 python/plugins/processing/algs/qgis/SelectByExpression.py
  143. +1 −1 python/plugins/processing/algs/qgis/SelectByLocation.py
  144. +1 −1 python/plugins/processing/algs/qgis/ServiceAreaFromLayer.py
  145. +1 −1 python/plugins/processing/algs/qgis/ServiceAreaFromPoint.py
  146. +7 −0 python/plugins/processing/algs/qgis/SetRasterStyle.py
  147. +7 −0 python/plugins/processing/algs/qgis/SetVectorStyle.py
  148. +1 −1 python/plugins/processing/algs/qgis/ShortestPathLayerToPoint.py
  149. +1 −1 python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py
  150. +1 −1 python/plugins/processing/algs/qgis/ShortestPathPointToPoint.py
  151. +1 −1 python/plugins/processing/algs/qgis/SimplifyGeometries.py
  152. +1 −1 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
  153. +9 −1 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  154. +1 −1 python/plugins/processing/algs/qgis/Slope.py
  155. +7 −0 python/plugins/processing/algs/qgis/Smooth.py
  156. +8 −2 python/plugins/processing/algs/qgis/SnapGeometries.py
  157. +7 −3 python/plugins/processing/algs/qgis/SpatialIndex.py
  158. +1 −1 python/plugins/processing/algs/qgis/SpatialJoin.py
  159. +8 −1 python/plugins/processing/algs/qgis/SpatialiteExecuteSQL.py
  160. +11 −1 python/plugins/processing/algs/qgis/SplitLinesWithLines.py
  161. +12 −1 python/plugins/processing/algs/qgis/SplitWithLines.py
  162. +8 −1 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  163. +1 −1 python/plugins/processing/algs/qgis/SumLines.py
  164. +1 −1 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  165. +8 −1 python/plugins/processing/algs/qgis/TextToFloat.py
  166. +1 −1 python/plugins/processing/algs/qgis/TinInterpolation.py
  167. +8 −1 python/plugins/processing/algs/qgis/TopoColors.py
  168. +7 −0 python/plugins/processing/algs/qgis/Translate.py
  169. +7 −0 python/plugins/processing/algs/qgis/TruncateTable.py
  170. +1 −1 python/plugins/processing/algs/qgis/Union.py
  171. +1 −1 python/plugins/processing/algs/qgis/UniqueValues.py
  172. +1 −1 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  173. +1 −1 python/plugins/processing/algs/qgis/VectorGridLines.py
  174. +1 −1 python/plugins/processing/algs/qgis/VectorGridPolygons.py
  175. +7 −0 python/plugins/processing/algs/qgis/VectorLayerHistogram.py
  176. +7 −0 python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
  177. +1 −1 python/plugins/processing/algs/qgis/VectorSplit.py
  178. +1 −1 python/plugins/processing/algs/qgis/VoronoiPolygons.py
  179. +10 −1 python/plugins/processing/algs/qgis/ZonalStatistics.py
  180. +1 −1 python/plugins/processing/algs/qgis/ZonalStatisticsQgis.py
  181. +5 −5 python/plugins/processing/algs/r/RAlgorithm.py
  182. +1 −1 python/plugins/processing/algs/saga/SagaAlgorithm.py
  183. +1 −1 python/plugins/processing/algs/saga/SplitRGBBands.py
  184. +0 −8 python/plugins/processing/core/GeoAlgorithm.py
  185. +1 −1 python/plugins/processing/gui/Postprocessing.py
  186. +1 −1 python/plugins/processing/gui/ProcessingToolbox.py
  187. +1 −1 python/plugins/processing/gui/menus.py
  188. +4 −1 python/plugins/processing/modeler/ModelerAlgorithm.py
  189. +1 −1 python/plugins/processing/modeler/ModelerDialog.py
  190. +1 −1 python/plugins/processing/modeler/ModelerGraphicItem.py
  191. +3 −0 python/plugins/processing/script/ScriptAlgorithm.py
  192. +11 −0 src/core/processing/qgsprocessingalgorithm.cpp
  193. +11 −0 src/core/processing/qgsprocessingalgorithm.h
@@ -9,5 +9,7 @@ class QgsProcessingAlgorithm
QgsProcessingAlgorithm();
virtual ~QgsProcessingAlgorithm();
virtual QStringList tags() const;
virtual QIcon icon() const;
virtual QString svgIconPath() const;
};

@@ -46,7 +46,7 @@ class AssignProjection(GdalAlgorithm):
CRS = 'CRS'
OUTPUT = 'OUTPUT'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-add.png'))

def defineCharacteristics(self):
@@ -53,7 +53,7 @@ class ClipByExtent(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def defineCharacteristics(self):
@@ -62,7 +62,7 @@ class ClipByMask(GdalAlgorithm):
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))

def defineCharacteristics(self):
@@ -46,12 +46,12 @@ class GdalAlgorithm(GeoAlgorithm):

def __init__(self):
GeoAlgorithm.__init__(self)
self._icon = None

def getIcon(self):
if self._icon is None:
self._icon = QgsApplication.getThemeIcon("/providerGdal.svg")
return self._icon
def icon(self):
return QgsApplication.getThemeIcon("/providerGdal.svg")

def svgIconPath(self):
return QgsApplication.iconPath("providerGdal.svg")

def getCustomParametersDialog(self):
return GdalAlgorithmDialog(self)
@@ -56,7 +56,7 @@ class GridAverage(GdalAlgorithm):

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

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
@@ -61,7 +61,7 @@ class GridDataMetrics(GdalAlgorithm):
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
'Average distance between points']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
@@ -60,7 +60,7 @@ class GridInvDist(GdalAlgorithm):

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

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
@@ -56,7 +56,7 @@ class GridNearest(GdalAlgorithm):

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

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))

def commandLineName(self):
@@ -51,7 +51,7 @@ class buildvrt(GdalAlgorithm):

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

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'vrt.png'))

def defineCharacteristics(self):
@@ -51,7 +51,7 @@ class contour(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
EXTRA = 'EXTRA'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'contour.png'))

def defineCharacteristics(self):
@@ -44,7 +44,7 @@ class ExtractProjection(GdalAlgorithm):
INPUT = 'INPUT'
PRJ_FILE = 'PRJ_FILE'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-export.png'))

def defineCharacteristics(self):
@@ -63,7 +63,7 @@ class gdaladdo(GdalAlgorithm):
FORMATS = ['Internal (if possible)', 'External (GTiff .ovr)',
'External (ERDAS Imagine .aux)']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-overview.png'))

def commandLineName(self):
@@ -48,7 +48,7 @@ class gdaltindex(GdalAlgorithm):
FIELD_NAME = 'FIELD_NAME'
PROJ_DIFFERENCE = 'PROJ_DIFFERENCE'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'tiles.png'))

def defineCharacteristics(self):
@@ -46,7 +46,7 @@ class information(GdalAlgorithm):
NOGCP = 'NOGCP'
NOMETADATA = 'NOMETADATA'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-info.png'))

def commandLineName(self):
@@ -54,7 +54,7 @@ class merge(GdalAlgorithm):

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

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'merge.png'))

def defineCharacteristics(self):
@@ -47,7 +47,7 @@ class nearblack(GdalAlgorithm):
NEAR = 'NEAR'
WHITE = 'WHITE'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'nearblack.png'))

def defineCharacteristics(self):
@@ -47,7 +47,7 @@ class pct2rgb(GdalAlgorithm):
OUTPUT = 'OUTPUT'
NBAND = 'NBAND'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', '8-to-24-bits.png'))

def defineCharacteristics(self):
@@ -46,7 +46,7 @@ class polygonize(GdalAlgorithm):
OUTPUT = 'OUTPUT'
FIELD = 'FIELD'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'polygonize.png'))

def commandLineName(self):
@@ -57,7 +57,7 @@ class proximity(GdalAlgorithm):

DISTUNITS = ['GEO', 'PIXEL']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'proximity.png'))

def commandLineName(self):
@@ -62,7 +62,7 @@ class rasterize(GdalAlgorithm):

RAST_EXT = 'RAST_EXT'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'rasterize.png'))

def commandLineName(self):
@@ -49,7 +49,7 @@ class rasterize_over(GdalAlgorithm):
INPUT_RASTER = 'INPUT_RASTER'
FIELD = 'FIELD'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'rasterize.png'))

def commandLineName(self):
@@ -47,7 +47,7 @@ class rgb2pct(GdalAlgorithm):
OUTPUT = 'OUTPUT'
NCOLORS = 'NCOLORS'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', '24-to-8-bits.png'))

def defineCharacteristics(self):
@@ -53,7 +53,7 @@ class sieve(GdalAlgorithm):

PIXEL_CONNECTIONS = ['4', '8']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'sieve.png'))

def defineCharacteristics(self):
@@ -60,7 +60,7 @@ class translate(GdalAlgorithm):
OPTIONS = 'OPTIONS'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'translate.png'))

def commandLineName(self):
@@ -60,7 +60,7 @@ class warp(GdalAlgorithm):
METHOD_OPTIONS = ['near', 'bilinear', 'cubic', 'cubicspline', 'lanczos']
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'warp.png'))

def tags(self):
@@ -84,7 +84,6 @@ def __init__(self, descriptionfile):
self.descriptionFile = descriptionfile
self.defineCharacteristicsFromFile()
self.numExportedLayers = 0
self._icon = None
self.uniqueSuffix = str(uuid.uuid4()).replace('-', '')

# Use the ext mechanism
@@ -99,10 +98,11 @@ def getCopy(self):
newone.provider = self.provider
return newone

def getIcon(self):
if self._icon is None:
self._icon = QgsApplication.getThemeIcon("/providerGrass.svg")
return self._icon
def icon(self):
return QgsApplication.getThemeIcon("/providerGrass.svg")

def svgIconPath(self):
return QgsApplication.iconPath("providerGrass.svg")

def help(self):
helpPath = Grass7Utils.grassHelpPath()
@@ -59,7 +59,7 @@ def __init__(self):
GeoAlgorithm.__init__(self)
self.showInModeler = False

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))

def defineCharacteristics(self):
@@ -26,7 +26,9 @@
__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QVariant
from qgis.core import QgsField, QgsFeature
from qgis.core import (QgsField,
QgsFeature,
QgsApplication)
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterString
@@ -47,6 +49,12 @@ class AddTableField(GeoAlgorithm):

TYPES = [QVariant.Int, QVariant.Double, QVariant.String]

def icon(self):
return QgsApplication.getThemeIcon("/providerQgis.svg")

def svgIconPath(self):
return QgsApplication.iconPath("providerQgis.svg")

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Add field to attributes table')
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
@@ -46,7 +46,7 @@ class Aspect(GeoAlgorithm):
Z_FACTOR = 'Z_FACTOR'
OUTPUT_LAYER = 'OUTPUT_LAYER'

def getIcon(self):
def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'dem.png'))

def defineCharacteristics(self):
@@ -26,7 +26,9 @@
__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QVariant
from qgis.core import QgsField, QgsFeature
from qgis.core import (QgsField,
QgsFeature,
QgsApplication)
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
@@ -38,6 +40,12 @@ class AutoincrementalField(GeoAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'

def icon(self):
return QgsApplication.getThemeIcon("/providerQgis.svg")

def svgIconPath(self):
return QgsApplication.iconPath("providerQgis.svg")

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Add autoincremental field')
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
@@ -29,6 +29,7 @@
import plotly.graph_objs as go
import numpy as np

from qgis.core import (QgsApplication)
from processing.core.parameters import ParameterTable
from processing.core.parameters import ParameterTableField
from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -44,6 +45,12 @@ class BarPlot(GeoAlgorithm):
NAME_FIELD = 'NAME_FIELD'
VALUE_FIELD = 'VALUE_FIELD'

def icon(self):
return QgsApplication.getThemeIcon("/providerQgis.svg")

def svgIconPath(self):
return QgsApplication.iconPath("providerQgis.svg&qu