Skip to content

Commit

Permalink
Merge pull request #5867 from alexbruy/processing-group
Browse files Browse the repository at this point in the history
[processing] add groupId() method to get untranslated algorithm group
  • Loading branch information
nyalldawson authored Dec 15, 2017
2 parents abdd875 + 2674022 commit db07bc6
Show file tree
Hide file tree
Showing 268 changed files with 841 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QgsProcessingModelAlgorithm : QgsProcessingAlgorithm
%End
public:

QgsProcessingModelAlgorithm( const QString &name = QString(), const QString &group = QString() );
QgsProcessingModelAlgorithm( const QString &name = QString(), const QString &group = QString(), const QString &groupId = QString() );
%Docstring
Constructor for QgsProcessingModelAlgorithm.
%End
Expand All @@ -36,6 +36,8 @@ class QgsProcessingModelAlgorithm : QgsProcessingAlgorithm

virtual QString group() const;

virtual QString groupId() const;

virtual QIcon icon() const;

virtual QString svgIconPath() const;
Expand Down
10 changes: 10 additions & 0 deletions python/core/processing/qgsprocessingalgorithm.sip
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,20 @@ class QgsProcessingAlgorithm
%Docstring
Returns the name of the group this algorithm belongs to. This string
should be localised.
.. seealso:: :py:func:`groupId()`
.. seealso:: :py:func:`tags()`
:rtype: str
%End

virtual QString groupId() const;
%Docstring
Returns the unique ID of the group this algorithm belongs to. This string
should be fixed for the algorithm, and must not be localised. The group id
should be unique within each provider. Group id should contain lowercase
alphanumeric characters only and no spaces or other formatting characters.
.. seealso:: :py:func:`group()`
:rtype: str
%End
virtual Flags flags() const;
%Docstring
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/AssignProjection.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def group(self):
return 'rasterprojections'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)
fileName = inLayer.source()
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/Buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipRasterByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def displayName(self):
def group(self):
return self.tr('Raster extraction')

def groupId(self):
return 'rasterextraction'

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

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipRasterByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def groupId(self):
return 'rasterextraction'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
inLayer = self.parameterAsRasterLayer(parameters, self.INPUT, context)

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipVectorByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipVectorByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def displayName(self):
def group(self):
return self.tr('Vector geoprocessing')

def groupId(self):
return 'vectorgeoprocessing'

def commandName(self):
return 'ogr2ogr'

Expand Down