[processing] fixed table fields in batch processing interface

Conflicts:
	python/plugins/processing/gui/BatchInputSelectionPanel.py
This commit is contained in:
volaya 2016-09-20 13:43:10 +02:00
parent 23aec61501
commit 404c57bc59
2 changed files with 3 additions and 5 deletions

View File

@ -114,7 +114,7 @@ class BatchInputSelectionPanel(QWidget):
if dlg.selectedoptions is not None:
selected = dlg.selectedoptions
if len(selected) == 1:
self.text.setText(layers[selected[0]].name())
self.setValue(layers[selected[0]])
else:
if isinstance(self.param, ParameterMultipleInput):
self.text.setText(';'.join(layers[idx].name() for idx in selected))
@ -148,6 +148,7 @@ class BatchInputSelectionPanel(QWidget):
files[i] = dataobjects.getRasterSublayer(filename, self.param)
if len(files) == 1:
self.text.setText(files[0])
self.textEditingFinished()
else:
if isinstance(self.param, ParameterMultipleInput):
self.text.setText(';'.join(str(f) for f in files))
@ -170,6 +171,6 @@ class BatchInputSelectionPanel(QWidget):
self._value = value
if isinstance(value, QgsMapLayer):
self.text.setText(value.name())
else: #  should be basestring
else: # should be basestring
self.text.setText(value)
self.valueChanged.emit()

View File

@ -762,8 +762,6 @@ class TableFieldWidgetWrapper(WidgetWrapper):
else:
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
widget = QComboBox()
if self.dialogType == DIALOG_BATCH:
widget.setEditable(True) # Should be removed at the end
return widget
else:
widget = QComboBox()
@ -778,7 +776,6 @@ class TableFieldWidgetWrapper(WidgetWrapper):
def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.param.name == self.param.parent:
# self.refreshItems()
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
self.setLayer(wrapper.value())
wrapper.widgetValueHasChanged.connect(self.parentValueChanged)