Skip to content

Commit

Permalink
Fixed bug using multipleinputpanel in modeler
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Oct 29, 2012
1 parent 83f6712 commit e5437c4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions python/plugins/sextante/gui/MultipleInputPanel.py
Expand Up @@ -35,7 +35,7 @@

class MultipleInputPanel(QtGui.QWidget):

def __init__(self, options, datatype, parent = None):
def __init__(self, options, datatype = None, parent = None):
super(MultipleInputPanel, self).__init__(parent)
self.options = options
self.datatype = datatype
Expand All @@ -54,17 +54,18 @@ def __init__(self, options, datatype, parent = None):
self.setLayout(self.horizontalLayout)

def showSelectionDialog(self):
if self.datatype == ParameterMultipleInput.TYPE_RASTER:
options = QGisLayers.getRasterLayers()
elif self.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
options = QGisLayers.getVectorLayers()
else:
options = QGisLayers.getVectorLayers(self.datatype)
opts = []
for opt in options:
opts.append(opt.name())
self.options = opts

#If there is a datatype, we use it to create the list of options
if self.datatype is not None:
if self.datatype == ParameterMultipleInput.TYPE_RASTER:
options = QGisLayers.getRasterLayers()
elif self.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
options = QGisLayers.getVectorLayers()
else:
options = QGisLayers.getVectorLayers(self.datatype)
opts = []
for opt in options:
opts.append(opt.name())
self.options = opts
dlg = MultipleInputDialog(self.options, self.selectedoptions)
dlg.exec_()
if dlg.selectedoptions != None:
Expand Down

0 comments on commit e5437c4

Please sign in to comment.