diff --git a/python/plugins/processing/gui/AlgorithmExecutionDialog.py b/python/plugins/processing/gui/AlgorithmExecutionDialog.py index 1887d8dbe92..2256600f32d 100644 --- a/python/plugins/processing/gui/AlgorithmExecutionDialog.py +++ b/python/plugins/processing/gui/AlgorithmExecutionDialog.py @@ -156,8 +156,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog): continue output.value = self.paramTable.valueItems[output.name].getValue() if isinstance(output, (OutputRaster, OutputVector, OutputTable)): - output.open = \ - self.paramTable.checkBoxes[output.name].isChecked() + output.open = self.paramTable.checkBoxes[output.name].isChecked() return True diff --git a/python/plugins/processing/gui/InputLayerSelectorPanel.py b/python/plugins/processing/gui/InputLayerSelectorPanel.py index 4cd310decbf..665d7bfb1da 100644 --- a/python/plugins/processing/gui/InputLayerSelectorPanel.py +++ b/python/plugins/processing/gui/InputLayerSelectorPanel.py @@ -31,8 +31,9 @@ from PyQt4 import QtGui, QtCore class InputLayerSelectorPanel(QtGui.QWidget): - def __init__(self, options): + def __init__(self, options, param): super(InputLayerSelectorPanel, self).__init__(None) + self.param = param self.horizontalLayout = QtGui.QHBoxLayout(self) self.horizontalLayout.setSpacing(2) self.horizontalLayout.setMargin(0) @@ -61,8 +62,8 @@ class InputLayerSelectorPanel(QtGui.QWidget): else: path = '' - filename = QtGui.QFileDialog.getOpenFileName(self, 'All files', path, - '*.*') + filename = QtGui.QFileDialog.getOpenFileName(self, self.param.description, path, + self.param.getFileFilter()) if filename: self.text.addItem(filename, filename) self.text.setCurrentIndex(self.text.count() - 1) diff --git a/python/plugins/processing/gui/ParametersPanel.py b/python/plugins/processing/gui/ParametersPanel.py index e5a9d7fdab9..c613611bc13 100644 --- a/python/plugins/processing/gui/ParametersPanel.py +++ b/python/plugins/processing/gui/ParametersPanel.py @@ -197,10 +197,9 @@ class ParametersPanel(QtGui.QWidget): items.append((self.NOT_SELECTED, None)) for layer in layers: items.append((self.getExtendedLayerName(layer), layer)) - item = InputLayerSelectorPanel(items) + item = InputLayerSelectorPanel(items, param) elif isinstance(param, ParameterVector): - if self.somethingDependsOnThisParameter(param) \ - or self.alg.allowOnlyOpenedLayers: + if self.somethingDependsOnThisParameter(param) or self.alg.allowOnlyOpenedLayers: item = QtGui.QComboBox() layers = dataobjects.getVectorLayers(param.shapetype) if param.optional: @@ -220,7 +219,7 @@ class ParametersPanel(QtGui.QWidget): for i,(name,layer) in enumerate(items): if layer and layer.source() == param.value: items.insert(0, items.pop(i)) - item = InputLayerSelectorPanel(items) + item = InputLayerSelectorPanel(items, param) elif isinstance(param, ParameterTable): if self.somethingDependsOnThisParameter(param): item = QtGui.QComboBox() @@ -242,7 +241,7 @@ class ParametersPanel(QtGui.QWidget): for i,(name,layer) in enumerate(items): if layer and layer.source() == param.value: items.insert(0, items.pop(i)) - item = InputLayerSelectorPanel(items) + item = InputLayerSelectorPanel(items, param) elif isinstance(param, ParameterBoolean): item = QtGui.QComboBox() item.addItem('Yes')