Skip to content
Permalink
Browse files

[processing] Fix exception when showing advanced parameters for alg i…

…n modeler
  • Loading branch information
nyalldawson committed Sep 11, 2018
1 parent c8abd40 commit 90dbf72e981f92a2de4c709898f37de9412ff322
Showing with 11 additions and 2 deletions.
  1. +11 −2 python/plugins/processing/modeler/ModelerParametersDialog.py
@@ -64,6 +64,7 @@
from processing.gui.wrappers import InvalidParameterValue
from processing.gui.MultipleInputPanel import MultipleInputPanel
from processing.tools.dataobjects import createContext
from processing.gui.wrappers import WidgetWrapper


class ModelerParametersDialog(QDialog):
@@ -78,6 +79,8 @@ def __init__(self, alg, model, algName=None, configuration=None):
self.configuration = configuration
self.context = createContext()

self.widget_labels = {}

self.setupUi()
self.params = None
settings = QgsSettings()
@@ -159,6 +162,7 @@ def setupUi(self):
tooltip = param.description()
widget.setToolTip(tooltip)
label = wrapper.label
self.widget_labels[param.name()] = label

if param.flags() & QgsProcessingParameterDefinition.FlagAdvanced:
label.setVisible(self.showAdvanced)
@@ -231,8 +235,13 @@ def showAdvancedParametersClicked(self):
self.advancedButton.setText(self.tr('Show advanced parameters'))
for param in self._alg.parameterDefinitions():
if param.flags() & QgsProcessingParameterDefinition.FlagAdvanced:
self.wrappers[param.name()].widget.setVisible(self.showAdvanced)
self.wrappers[param.name()].label.setVisible(self.showAdvanced)
wrapper = self.wrappers[param.name()]
if issubclass(wrapper.__class__, QgsProcessingModelerParameterWidget):
wrapper.setVisible(self.showAdvanced)
else:
wrapper.widget.setVisible(self.showAdvanced)

self.widget_labels[param.name()].setVisible(self.showAdvanced)

def getAvailableValuesOfType(self, paramType, outTypes=[], dataTypes=[]):
# upgrade paramType to list

0 comments on commit 90dbf72

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