Skip to content

Commit e5437c4

Browse files
committed
Fixed bug using multipleinputpanel in modeler
1 parent 83f6712 commit e5437c4

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

python/plugins/sextante/gui/MultipleInputPanel.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
class MultipleInputPanel(QtGui.QWidget):
3737

38-
def __init__(self, options, datatype, parent = None):
38+
def __init__(self, options, datatype = None, parent = None):
3939
super(MultipleInputPanel, self).__init__(parent)
4040
self.options = options
4141
self.datatype = datatype
@@ -54,17 +54,18 @@ def __init__(self, options, datatype, parent = None):
5454
self.setLayout(self.horizontalLayout)
5555

5656
def showSelectionDialog(self):
57-
if self.datatype == ParameterMultipleInput.TYPE_RASTER:
58-
options = QGisLayers.getRasterLayers()
59-
elif self.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
60-
options = QGisLayers.getVectorLayers()
61-
else:
62-
options = QGisLayers.getVectorLayers(self.datatype)
63-
opts = []
64-
for opt in options:
65-
opts.append(opt.name())
66-
self.options = opts
67-
57+
#If there is a datatype, we use it to create the list of options
58+
if self.datatype is not None:
59+
if self.datatype == ParameterMultipleInput.TYPE_RASTER:
60+
options = QGisLayers.getRasterLayers()
61+
elif self.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
62+
options = QGisLayers.getVectorLayers()
63+
else:
64+
options = QGisLayers.getVectorLayers(self.datatype)
65+
opts = []
66+
for opt in options:
67+
opts.append(opt.name())
68+
self.options = opts
6869
dlg = MultipleInputDialog(self.options, self.selectedoptions)
6970
dlg.exec_()
7071
if dlg.selectedoptions != None:

0 commit comments

Comments
 (0)