Skip to content

Commit

Permalink
[processing] Nicer strings, default values for select/extract by attr…
Browse files Browse the repository at this point in the history
…ibute
  • Loading branch information
nyalldawson committed Jun 10, 2019
1 parent a9d0b6f commit 2e26e41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/algs/qgis/SelectByAttribute.py
Expand Up @@ -82,9 +82,9 @@ def initAlgorithm(self, config=None):
self.operators = ['=',
'≠',
'>',
'>=',
'',
'<',
'<=',
'',
self.tr('begins with'),
self.tr('contains'),
self.tr('is null'),
Expand All @@ -104,14 +104,14 @@ def initAlgorithm(self, config=None):
self.tr('Selection attribute'),
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterEnum(self.OPERATOR,
self.tr('Operator'), self.operators))
self.tr('Operator'), self.operators, defaultValue=0))
self.addParameter(QgsProcessingParameterString(self.VALUE,
self.tr('Value'),
optional=True))
self.addParameter(QgsProcessingParameterEnum(self.METHOD,
self.tr('Modify current selection by'),
self.methods,
0))
defaultValue=0))

self.addOutput(QgsProcessingOutputVectorLayer(self.OUTPUT, self.tr('Selected (attribute)')))

Expand Down
6 changes: 3 additions & 3 deletions src/analysis/processing/qgsalgorithmextractbyattribute.cpp
Expand Up @@ -53,14 +53,14 @@ void QgsExtractByAttributeAlgorithm::initAlgorithm( const QVariantMap & )
<< QObject::tr( "=" )
<< QObject::tr( "" )
<< QObject::tr( ">" )
<< QObject::tr( ">=" )
<< QObject::tr( "" )
<< QObject::tr( "<" )
<< QObject::tr( "<=" )
<< QObject::tr( "" )
<< QObject::tr( "begins with" )
<< QObject::tr( "contains" )
<< QObject::tr( "is null" )
<< QObject::tr( "is not null" )
<< QObject::tr( "does not contain" ) ) );
<< QObject::tr( "does not contain" ), false, 0 ) );
addParameter( new QgsProcessingParameterString( QStringLiteral( "VALUE" ), QObject::tr( "Value" ), QVariant(), false, true ) );

addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Extracted (attribute)" ) ) );
Expand Down

0 comments on commit 2e26e41

Please sign in to comment.