Skip to content
Permalink
Browse files

fixed #6571

  • Loading branch information
volaya committed Nov 12, 2012
1 parent 98658ef commit 3b886372fe07b16403a37b7d91f04a65572f24be
@@ -53,6 +53,11 @@ def __init__(self, options, datatype = None, parent = None):
self.horizontalLayout.addWidget(self.pushButton)
self.setLayout(self.horizontalLayout)

def setSelectedItems(self, selected):
#no checking is performed!
self.selectedoptions = selected
self.label.setText(str(len(self.selectedoptions)) + " elements selected")

def showSelectionDialog(self):
#If there is a datatype, we use it to create the list of options
if self.datatype is not None:
@@ -87,7 +87,7 @@ def setupUi(self):
self.horizontalLayout3.setMargin(0)

if isinstance(self.param, Parameter):
self.nameTextBox.setText(self.param.name)
self.nameTextBox.setText(self.param.description)

if self.paramType == ModelerParameterDefinitionDialog.PARAMETER_BOOLEAN or \
isinstance(self.param, ParameterBoolean):
@@ -510,7 +510,19 @@ def setPreviousValues(self):
elif isinstance(param, ParameterFixedTable):
pass
elif isinstance(param, ParameterMultipleInput):
pass
value = self.model.getValueFromAlgorithmAndParameter(value)
values = value.split(";")
selectedoptions = []
if param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
options = self.getVectorLayers()
else:
options = self.getRasterLayers()
for i in range(len(options)):
option = options[i]
for aap in (values):
if str(option) == aap:
selectedoptions.append(i)
widget.setSelectedItems(selectedoptions)
else:
pass

0 comments on commit 3b88637

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