From d10db05b5a4cf5819af40fa406646d802bef9344 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 11 Jun 2019 09:28:56 +1000 Subject: [PATCH] [processing] Nicer strings, default values for select/extract by attribute --- python/plugins/processing/algs/qgis/SelectByAttribute.py | 8 ++++---- .../processing/qgsalgorithmextractbyattribute.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/plugins/processing/algs/qgis/SelectByAttribute.py b/python/plugins/processing/algs/qgis/SelectByAttribute.py index aac4d34f6e08..1a6ac94fad29 100644 --- a/python/plugins/processing/algs/qgis/SelectByAttribute.py +++ b/python/plugins/processing/algs/qgis/SelectByAttribute.py @@ -78,9 +78,9 @@ def initAlgorithm(self, config=None): self.operators = ['=', '≠', '>', - '>=', + '≥', '<', - '<=', + '≤', self.tr('begins with'), self.tr('contains'), self.tr('is null'), @@ -100,14 +100,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)'))) diff --git a/src/analysis/processing/qgsalgorithmextractbyattribute.cpp b/src/analysis/processing/qgsalgorithmextractbyattribute.cpp index 605c3c5139ec..7f08e89d6ee6 100644 --- a/src/analysis/processing/qgsalgorithmextractbyattribute.cpp +++ b/src/analysis/processing/qgsalgorithmextractbyattribute.cpp @@ -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)" ) ) );