Skip to content
Permalink
Browse files

[processing] Fix wrapper value retrieval for some ported wrappers

Fixes #19813
  • Loading branch information
nyalldawson committed Sep 11, 2018
1 parent d54bd1a commit ac3b37ffe0a4b295830d813ca5aafa2be71fb3f8
@@ -310,7 +310,7 @@ def fillParameterValues(self, column):
return

for row in range(1, self.tblParameters.rowCount()):
self.wrappers[row][column].setParameterValue(wrapper.value(), context)
self.wrappers[row][column].setParameterValue(wrapper.parameterValue(), context)

def toggleAdvancedMode(self, checked):
for column, param in enumerate(self.alg.parameterDefinitions()):
@@ -765,12 +765,12 @@ def postInitialize(self, wrappers):
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH) and self.parameterDefinition().isDynamic():
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self.parameterDefinition().dynamicLayerParameterName():
self.widget.setDynamicLayer(wrapper.value())
self.widget.setDynamicLayer(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.parentLayerChanged)
break

def parentLayerChanged(self, wrapper):
self.widget.setDynamicLayer(wrapper.value())
self.widget.setDynamicLayer(wrapper.parameterValue())


class DistanceWidgetWrapper(WidgetWrapper):
@@ -796,17 +796,17 @@ def postInitialize(self, wrappers):
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self.parameterDefinition().dynamicLayerParameterName():
self.widget.setDynamicLayer(wrapper.value())
self.widget.setDynamicLayer(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.dynamicLayerChanged)
if wrapper.parameterDefinition().name() == self.parameterDefinition().parentParameterName():
self.widget.setUnitParameterValue(wrapper.value())
self.widget.setUnitParameterValue(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.parentParameterChanged)

def dynamicLayerChanged(self, wrapper):
self.widget.setDynamicLayer(wrapper.value())
self.widget.setDynamicLayer(wrapper.parameterValue())

def parentParameterChanged(self, wrapper):
self.widget.setUnitParameterValue(wrapper.value())
self.widget.setUnitParameterValue(wrapper.parameterValue())


class RangeWidgetWrapper(WidgetWrapper):
@@ -1347,12 +1347,12 @@ def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self.parameterDefinition().parentLayerParameterName():
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.parentLayerChanged)
break

def parentLayerChanged(self, wrapper):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())

def setLayer(self, layer):
if isinstance(layer, QgsProcessingFeatureSourceDefinition):
@@ -1567,12 +1567,12 @@ def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self.parameterDefinition().parentLayerParameterName():
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.parentValueChanged)
break

def parentValueChanged(self, wrapper):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())

def setLayer(self, layer):
if isinstance(layer, QgsProcessingFeatureSourceDefinition):
@@ -1682,12 +1682,12 @@ def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self.parameterDefinition().parentLayerParameterName():
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.parentValueChanged)
break

def parentValueChanged(self, wrapper):
self.setLayer(wrapper.value())
self.setLayer(wrapper.parameterValue())

def setLayer(self, layer):
if isinstance(layer, QgsProcessingParameterRasterLayer):
@@ -91,12 +91,12 @@ def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self._connection_param:
self.connection_wrapper = wrapper
self.setConnection(wrapper.value())
self.setConnection(wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.connectionChanged)
break

def connectionChanged(self, wrapper):
connection = wrapper.value()
connection = wrapper.parameterValue()
if connection == self._connection:
return
self.setConnection(connection)
@@ -163,13 +163,13 @@ def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.parameterDefinition().name() == self._schema_param:
self.schema_wrapper = wrapper
self.setSchema(wrapper.database(), wrapper.value())
self.setSchema(wrapper.database(), wrapper.parameterValue())
wrapper.widgetValueHasChanged.connect(self.schemaChanged)
break

def schemaChanged(self, wrapper):
database = wrapper.database()
schema = wrapper.value()
schema = wrapper.parameterValue()
if database == self._database and schema == self._schema:
return
self.setSchema(database, schema)
@@ -315,7 +315,7 @@ def createAlgorithm(self):
if param.isDestination() or param.flags() & QgsProcessingParameterDefinition.FlagHidden:
continue
try:
val = self.wrappers[param.name()].value()
val = self.wrappers[param.name()].parameterValue()
except InvalidParameterValue:
self.bar.pushMessage(self.tr("Error"),
self.tr("Wrong or missing value for parameter '{}'").format(param.description()),

0 comments on commit ac3b37f

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