Skip to content

Commit 3b88637

Browse files
committed
fixed #6571
1 parent 98658ef commit 3b88637

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

python/plugins/sextante/gui/MultipleInputPanel.py

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def __init__(self, options, datatype = None, parent = None):
5353
self.horizontalLayout.addWidget(self.pushButton)
5454
self.setLayout(self.horizontalLayout)
5555

56+
def setSelectedItems(self, selected):
57+
#no checking is performed!
58+
self.selectedoptions = selected
59+
self.label.setText(str(len(self.selectedoptions)) + " elements selected")
60+
5661
def showSelectionDialog(self):
5762
#If there is a datatype, we use it to create the list of options
5863
if self.datatype is not None:

python/plugins/sextante/modeler/ModelerParameterDefinitionDialog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def setupUi(self):
8787
self.horizontalLayout3.setMargin(0)
8888

8989
if isinstance(self.param, Parameter):
90-
self.nameTextBox.setText(self.param.name)
90+
self.nameTextBox.setText(self.param.description)
9191

9292
if self.paramType == ModelerParameterDefinitionDialog.PARAMETER_BOOLEAN or \
9393
isinstance(self.param, ParameterBoolean):

python/plugins/sextante/modeler/ModelerParametersDialog.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,19 @@ def setPreviousValues(self):
510510
elif isinstance(param, ParameterFixedTable):
511511
pass
512512
elif isinstance(param, ParameterMultipleInput):
513-
pass
513+
value = self.model.getValueFromAlgorithmAndParameter(value)
514+
values = value.split(";")
515+
selectedoptions = []
516+
if param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
517+
options = self.getVectorLayers()
518+
else:
519+
options = self.getRasterLayers()
520+
for i in range(len(options)):
521+
option = options[i]
522+
for aap in (values):
523+
if str(option) == aap:
524+
selectedoptions.append(i)
525+
widget.setSelectedItems(selectedoptions)
514526
else:
515527
pass
516528

0 commit comments

Comments
 (0)