Skip to content

Commit

Permalink
fixed #6571
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 12, 2012
1 parent 98658ef commit 3b88637
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions python/plugins/sextante/gui/MultipleInputPanel.py
Expand Up @@ -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:
Expand Down
Expand Up @@ -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):
Expand Down
14 changes: 13 additions & 1 deletion python/plugins/sextante/modeler/ModelerParametersDialog.py
Expand Up @@ -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

Expand Down

0 comments on commit 3b88637

Please sign in to comment.