Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add vector icons to some qgs algorithms (fixes #19082) (#7149)
  • Loading branch information
agiudiceandrea authored and nirvn committed Jun 4, 2018
1 parent b8ff44e commit adf5eb7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Expand Up @@ -31,7 +31,8 @@
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtCore import QVariant

from qgis.core import (QgsField,
from qgis.core import (QgsApplication,
QgsField,
QgsFeatureSink,
QgsGeometry,
QgsWkbTypes,
Expand Down Expand Up @@ -60,7 +61,10 @@ class MinimumBoundingGeometry(QgisAlgorithm):
FIELD = 'FIELD'

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmConvexHull.svg")

def svgIconPath(self):
return QgsApplication.iconPath("/algorithms/mAlgorithmConvexHull.svg")

def group(self):
return self.tr('Vector geometry')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/PointsAlongGeometry.py
Expand Up @@ -31,7 +31,8 @@
from qgis.PyQt.QtCore import QVariant
from qgis.PyQt.QtGui import QIcon

from qgis.core import (QgsFeature,
from qgis.core import (QgsApplication,
QgsFeature,
QgsFeatureSink,
QgsWkbTypes,
QgsField,
Expand All @@ -57,7 +58,10 @@ class PointsAlongGeometry(QgisAlgorithm):
END_OFFSET = 'END_OFFSET'

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'extract_nodes.png'))
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmExtractVertices.svg")

def svgIconPath(self):
return QgsApplication.iconPath("/algorithms/mAlgorithmExtractVertices.svg")

def tags(self):
return self.tr('create,interpolate,points,lines,regular,distance,by').split(',')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/PoleOfInaccessibility.py
Expand Up @@ -27,7 +27,8 @@

import os

from qgis.core import (QgsWkbTypes,
from qgis.core import (QgsApplication,
QgsWkbTypes,
QgsField,
NULL,
QgsFeatureSink,
Expand All @@ -53,7 +54,10 @@ class PoleOfInaccessibility(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'centroids.png'))
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmCentroids.svg")

def svgIconPath(self):
return QgsApplication.iconPath("/algorithms/mAlgorithmCentroids.svg")

def tags(self):
return self.tr('furthest,point,distant,extreme,maximum,centroid,center,centre').split(',')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
Expand Up @@ -29,7 +29,8 @@

from qgis.PyQt.QtGui import QIcon

from qgis.core import (QgsWkbTypes,
from qgis.core import (QgsApplication,
QgsWkbTypes,
QgsProcessing,
QgsProcessingException,
QgsProcessingAlgorithm,
Expand Down Expand Up @@ -58,7 +59,10 @@ class VariableDistanceBuffer(QgisAlgorithm):
MITER_LIMIT = 'MITER_LIMIT'

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'buffer.png'))
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmBuffer.svg")

def svgIconPath(self):
return QgsApplication.iconPath("/algorithms/mAlgorithmBuffer.svg")

def group(self):
return self.tr('Vector geometry')
Expand Down

0 comments on commit adf5eb7

Please sign in to comment.