Skip to content

Commit

Permalink
[needs-docs][processing] vectorize & improve remaining vector menu icons
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed May 15, 2018
1 parent 9a82dbe commit bc0f753
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 22 deletions.
9 changes: 8 additions & 1 deletion images/images.qrc
Expand Up @@ -76,19 +76,21 @@
<file>north_arrows/gpsarrow2.svg</file>
<file>splash/splash.png</file>
<file>composer/missing_image.svg</file>
<file>themes/default/algorithms/mAlgorithmAddGeometryAttributes.svg</file>
<file>themes/default/algorithms/mAlgorithmBasicStatistics.svg</file>
<file>themes/default/algorithms/mAlgorithmBuffer.svg</file>
<file>themes/default/algorithms/mAlgorithmCentroids.svg</file>
<file>themes/default/algorithms/mAlgorithmCheckGeometry.svg</file>
<file>themes/default/algorithms/mAlgorithmClip.svg</file>
<file>themes/default/algorithms/mAlgorithmCollect.svg</file>
<file>themes/default/algorithms/mAlgorithmConvexHull.svg</file>
<file>themes/default/algorithms/mAlgorithmCreateGrid.svg</file>
<file>themes/default/algorithms/mAlgorithmDelaunay.svg</file>
<file>themes/default/algorithms/mAlgorithmDifference.svg</file>
<file>themes/default/algorithms/mAlgorithmDissolve.svg</file>
<file>themes/default/algorithms/mAlgorithmDistanceMatrix.svg</file>
<file>themes/default/algorithms/mAlgorithmAddGeometryAttributes.svg</file>
<file>themes/default/algorithms/mAlgorithmExtractVertices.svg</file>
<file>themes/default/algorithms/mAlgorithmExtractLayerExtent.svg</file>
<file>themes/default/algorithms/mAlgorithmIntersect.svg</file>
<file>themes/default/algorithms/mAlgorithmLineIntersections.svg</file>
<file>themes/default/algorithms/mAlgorithmLineToPolygon.svg</file>
Expand All @@ -97,6 +99,11 @@
<file>themes/default/algorithms/mAlgorithmMultiToSingle.svg</file>
<file>themes/default/algorithms/mAlgorithmNearestNeighbour.svg</file>
<file>themes/default/algorithms/mAlgorithmPolygonToLine.svg</file>
<file>themes/default/algorithms/mAlgorithmRandomPointsWithinPolygon.svg</file>
<file>themes/default/algorithms/mAlgorithmRandomPointsWithinExtent.svg</file>
<file>themes/default/algorithms/mAlgorithmRegularPoints.svg</file>
<file>themes/default/algorithms/mAlgorithmSelectLocation.svg</file>
<file>themes/default/algorithms/mAlgorithmSelectRandom.svg</file>
<file>themes/default/algorithms/mAlgorithmSimplify.svg</file>
<file>themes/default/algorithms/mAlgorithmSingleToMulti.svg</file>
<file>themes/default/algorithms/mAlgorithmSplitLayer.svg</file>
Expand Down
1 change: 1 addition & 0 deletions images/themes/default/algorithms/mAlgorithmCreateGrid.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/ExtentFromLayer.py
Expand Up @@ -30,7 +30,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,
QgsFeature,
Expand All @@ -54,7 +55,10 @@ class ExtentFromLayer(QgisAlgorithm):
OUTPUT = 'OUTPUT'

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

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

def tags(self):
return self.tr('polygon,from,vector,raster,extent,envelope,bounds,bounding,boundary,layer').split(',')
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/qgis/Grid.py
Expand Up @@ -65,7 +65,10 @@ class Grid(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def icon(self):
return QgsApplication.getThemeIcon("/vector_grid.svg")
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmCreateGrid.svg")

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

def tags(self):
return self.tr('grid,lines,polygons,vector,create,fishnet,diamond,hexagon').split(',')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/RandomPointsExtent.py
Expand Up @@ -30,7 +30,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,
QgsFeature,
QgsFields,
Expand Down Expand Up @@ -62,7 +63,10 @@ class RandomPointsExtent(QgisAlgorithm):
OUTPUT = 'OUTPUT'

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

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

def group(self):
return self.tr('Vector creation')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/RandomPointsLayer.py
Expand Up @@ -30,7 +30,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,
QgsFeature,
QgsFields,
Expand Down Expand Up @@ -61,7 +62,10 @@ class RandomPointsLayer(QgisAlgorithm):
OUTPUT = 'OUTPUT'

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

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

def group(self):
return self.tr('Vector creation')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/RandomPointsPolygons.py
Expand Up @@ -30,7 +30,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,
QgsFeature,
QgsFields,
Expand Down Expand Up @@ -67,7 +68,10 @@ class RandomPointsPolygons(QgisAlgorithm):
OUTPUT = 'OUTPUT'

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

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

def group(self):
return self.tr('Vector creation')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/RandomSelection.py
Expand Up @@ -29,7 +29,8 @@
import random

from qgis.PyQt.QtGui import QIcon
from qgis.core import (QgsFeatureSink,
from qgis.core import (QgsApplication,
QgsFeatureSink,
QgsProcessingException,
QgsProcessingUtils,
QgsProcessingAlgorithm,
Expand All @@ -52,7 +53,10 @@ class RandomSelection(QgisAlgorithm):
NUMBER = 'NUMBER'

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

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

def group(self):
return self.tr('Vector selection')
Expand Down
Expand Up @@ -30,7 +30,8 @@

from qgis.PyQt.QtGui import QIcon

from qgis.core import (QgsFeatureRequest,
from qgis.core import (QgsApplication,
QgsFeatureRequest,
QgsProcessingException,
QgsProcessingUtils,
QgsProcessingAlgorithm,
Expand All @@ -55,7 +56,10 @@ class RandomSelectionWithinSubsets(QgisAlgorithm):
OUTPUT = 'OUTPUT'

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

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

def group(self):
return self.tr('Vector selection')
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/RegularPoints.py
Expand Up @@ -31,7 +31,8 @@

from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtCore import QVariant
from qgis.core import (QgsFields,
from qgis.core import (QgsApplication,
QgsFields,
QgsFeatureSink,
QgsField,
QgsFeature,
Expand Down Expand Up @@ -63,7 +64,10 @@ class RegularPoints(QgisAlgorithm):
CRS = 'CRS'

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

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

def group(self):
return self.tr('Vector creation')
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/processing/algs/qgis/SpatialJoin.py
Expand Up @@ -57,9 +57,6 @@ class SpatialJoin(QgisAlgorithm):
DISCARD_NONMATCHING = "DISCARD_NONMATCHING"
OUTPUT = "OUTPUT"

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

def group(self):
return self.tr('Vector general')

Expand Down
3 changes: 0 additions & 3 deletions python/plugins/processing/algs/qgis/SpatialJoinSummary.py
Expand Up @@ -65,9 +65,6 @@ class SpatialJoinSummary(QgisAlgorithm):
DISCARD_NONMATCHING = "DISCARD_NONMATCHING"
OUTPUT = "OUTPUT"

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

def group(self):
return self.tr('Vector general')

Expand Down
2 changes: 2 additions & 0 deletions src/analysis/processing/qgsalgorithmextractbylocation.h
Expand Up @@ -63,6 +63,8 @@ class QgsSelectByLocationAlgorithm : public QgsLocationBasedAlgorithm

QgsSelectByLocationAlgorithm() = default;
void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmSelectLocation.svg" ) ); }
QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmSelectLocation.svg" ) ); }
QString name() const override;
Flags flags() const override;
QString displayName() const override;
Expand Down

0 comments on commit bc0f753

Please sign in to comment.