From 627f43b495de5960c10901496a39f6c7d7bb0f1b Mon Sep 17 00:00:00 2001 From: Tudor Barascu Date: Tue, 25 Oct 2022 06:35:02 +0300 Subject: [PATCH] Add Icon for "Select within distance" + add it to Vector -> Research Tools menu under "Select by location" (#50446) * add Select within distance icon * add select within distance to Vector -> research Tools Menu * rework image according to review * align image to grid --- images/images.qrc | 1 + .../algorithms/mAlgorithmSelectDistance.svg | 25 +++++++++++++++++++ python/plugins/processing/gui/menus.py | 1 + .../processing/qgsalgorithmdistancewithin.h | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 images/themes/default/algorithms/mAlgorithmSelectDistance.svg diff --git a/images/images.qrc b/images/images.qrc index 1c7376afc5d..ecd5f07148e 100644 --- a/images/images.qrc +++ b/images/images.qrc @@ -129,6 +129,7 @@ themes/default/algorithms/mAlgorithmRegularPoints.svg themes/default/algorithms/mAlgorithmRoundRastervalues.svg themes/default/algorithms/mAlgorithmSelectLocation.svg + themes/default/algorithms/mAlgorithmSelectDistance.svg themes/default/algorithms/mAlgorithmSelectRandom.svg themes/default/algorithms/mAlgorithmSimplify.svg themes/default/algorithms/mAlgorithmSingleToMulti.svg diff --git a/images/themes/default/algorithms/mAlgorithmSelectDistance.svg b/images/themes/default/algorithms/mAlgorithmSelectDistance.svg new file mode 100644 index 00000000000..a3661e0d417 --- /dev/null +++ b/images/themes/default/algorithms/mAlgorithmSelectDistance.svg @@ -0,0 +1,25 @@ + + + + + + diff --git a/python/plugins/processing/gui/menus.py b/python/plugins/processing/gui/menus.py index 7f1865bf2a4..69c194541f8 100644 --- a/python/plugins/processing/gui/menus.py +++ b/python/plugins/processing/gui/menus.py @@ -67,6 +67,7 @@ def initMenusAndToolbars(): 'native:randompointsonlines': researchToolsMenu, 'qgis:regularpoints': researchToolsMenu, 'native:selectbylocation': researchToolsMenu, + 'native:selectwithindistance': researchToolsMenu, 'native:polygonfromlayerextent': researchToolsMenu}) geoprocessingToolsMenu = vectorMenu + "/" + Processing.tr('&Geoprocessing Tools') defaultMenuEntries.update({'native:buffer': geoprocessingToolsMenu, diff --git a/src/analysis/processing/qgsalgorithmdistancewithin.h b/src/analysis/processing/qgsalgorithmdistancewithin.h index d9fd562e47e..1289746cb39 100644 --- a/src/analysis/processing/qgsalgorithmdistancewithin.h +++ b/src/analysis/processing/qgsalgorithmdistancewithin.h @@ -64,6 +64,8 @@ class QgsSelectWithinDistanceAlgorithm : public QgsDistanceWithinAlgorithm QgsSelectWithinDistanceAlgorithm() = default; void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override; + QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmSelectDistance.svg" ) ); } + QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmSelectDistance.svg" ) ); } QString name() const override; Flags flags() const override; QString displayName() const override;