Skip to content
Permalink
Browse files

Rename some processing widget wrappers to better match corresponding …

…c++ classes
  • Loading branch information
nyalldawson committed Aug 22, 2017
1 parent c119c28 commit 367aba7059814db1cda9be5cd118ffb0eaf21f13
Showing with 12 additions and 12 deletions.
  1. +8 −8 python/plugins/processing/gui/wrappers.py
  2. +4 −4 python/plugins/processing/tests/GuiTest.py
@@ -521,7 +521,7 @@ def value(self):
return self.widget.table


class MultipleInputWidgetWrapper(WidgetWrapper):
class MultipleLayerWidgetWrapper(WidgetWrapper):

def _getOptions(self):
if self.param.layerType() == QgsProcessing.TypeVectorAnyGeometry:
@@ -766,7 +766,7 @@ def selectFile(self):
self.combo.setEditText(filename)


class SelectionWidgetWrapper(WidgetWrapper):
class EnumWidgetWrapper(WidgetWrapper):

def createWidget(self):
if self.param.allowMultiple():
@@ -792,7 +792,7 @@ def value(self):
return self.widget.currentData()


class VectorWidgetWrapper(WidgetWrapper):
class FeatureSourceWidgetWrapper(WidgetWrapper):

NOT_SELECTED = '[Not selected]'

@@ -1082,7 +1082,7 @@ def validator(v):
return self.comboValue(validator)


class TableWidgetWrapper(WidgetWrapper):
class VectorLayerWidgetWrapper(WidgetWrapper):

NOT_SELECTED = '[Not selected]'

@@ -1407,23 +1407,23 @@ def create_wrapper_from_class(param, dialog, row=0, col=0):
elif param.type() == 'file':
wrapper = FileWidgetWrapper
elif param.type() == 'multilayer':
wrapper = MultipleInputWidgetWrapper
wrapper = MultipleLayerWidgetWrapper
elif param.type() == 'number':
wrapper = NumberWidgetWrapper
elif param.type() == 'raster':
wrapper = RasterWidgetWrapper
elif param.type() == 'enum':
wrapper = SelectionWidgetWrapper
wrapper = EnumWidgetWrapper
elif param.type() == 'string':
wrapper = StringWidgetWrapper
elif param.type() == 'expression':
wrapper = ExpressionWidgetWrapper
elif param.type() == 'vector':
wrapper = TableWidgetWrapper
wrapper = VectorLayerWidgetWrapper
elif param.type() == 'field':
wrapper = TableFieldWidgetWrapper
elif param.type() == 'source':
wrapper = VectorWidgetWrapper
wrapper = FeatureSourceWidgetWrapper
elif param.type() == 'band':
wrapper = BandWidgetWrapper
elif param.type() == 'layer':
@@ -90,13 +90,13 @@ def testFile(self):
self.checkConstructWrapper(QgsProcessingParameterFile('test'), FileWidgetWrapper)

def testMultiInput(self):
self.checkConstructWrapper(QgsProcessingParameterMultipleLayers('test'), MultipleInputWidgetWrapper)
self.checkConstructWrapper(QgsProcessingParameterMultipleLayers('test'), MultipleLayerWidgetWrapper)

def testRasterInput(self):
self.checkConstructWrapper(QgsProcessingParameterRasterLayer('test'), RasterWidgetWrapper)

def testEnum(self):
self.checkConstructWrapper(QgsProcessingParameterEnum('test'), SelectionWidgetWrapper)
self.checkConstructWrapper(QgsProcessingParameterEnum('test'), EnumWidgetWrapper)

def testString(self):
self.checkConstructWrapper(QgsProcessingParameterString('test'), StringWidgetWrapper)
@@ -105,13 +105,13 @@ def testExpression(self):
self.checkConstructWrapper(QgsProcessingParameterExpression('test'), ExpressionWidgetWrapper)

def testVector(self):
self.checkConstructWrapper(QgsProcessingParameterVectorLayer('test'), TableWidgetWrapper)
self.checkConstructWrapper(QgsProcessingParameterVectorLayer('test'), VectorLayerWidgetWrapper)

def testField(self):
self.checkConstructWrapper(QgsProcessingParameterField('test'), TableFieldWidgetWrapper)

def testSource(self):
self.checkConstructWrapper(QgsProcessingParameterFeatureSource('test'), VectorWidgetWrapper)
self.checkConstructWrapper(QgsProcessingParameterFeatureSource('test'), FeatureSourceWidgetWrapper)

def testSource(self):
self.checkConstructWrapper(QgsProcessingParameterBand('test'), BandWidgetWrapper)

0 comments on commit 367aba7

Please sign in to comment.
You can’t perform that action at this time.