Skip to content

Commit 441f6e6

Browse files
authored
Merge pull request #4120 from arnaud-morvan/processing_fix_boolean_wrapper
[processing] fix boolean widget wrapper in batch dialog
2 parents aa86281 + 3a12f2a commit 441f6e6

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

python/plugins/processing/gui/wrappers.py

+4-14
Original file line numberDiff line numberDiff line change
@@ -241,24 +241,16 @@ def createWidget(self):
241241
return QCheckBox()
242242
elif self.dialogType == DIALOG_BATCH:
243243
widget = QComboBox()
244-
widget.addItem(self.tr('Yes'))
245-
widget.addItem(self.tr('No'))
246-
if self.param.default:
247-
widget.setCurrentIndex(0)
248-
else:
249-
widget.setCurrentIndex(1)
244+
widget.addItem(self.tr('Yes'), True)
245+
widget.addItem(self.tr('No'), False)
250246
return widget
251247
else:
252248
widget = QComboBox()
253-
widget.addItem('Yes', True)
254-
widget.addItem('No', False)
249+
widget.addItem(self.tr('Yes'), True)
250+
widget.addItem(self.tr('No'), False)
255251
bools = self.dialog.getAvailableValuesOfType(ParameterBoolean, None)
256252
for b in bools:
257253
widget.addItem(self.dialog.resolveValueDescription(b), b)
258-
if self.param.default:
259-
widget.setCurrentIndex(0)
260-
else:
261-
widget.setCurrentIndex(1)
262254
return widget
263255

264256
def setValue(self, value):
@@ -270,8 +262,6 @@ def setValue(self, value):
270262
def value(self):
271263
if self.dialogType == DIALOG_STANDARD:
272264
return self.widget.isChecked()
273-
elif self.dialogType == DIALOG_BATCH:
274-
return self.widget.currentIndex == 0
275265
else:
276266
return self.comboValue()
277267

0 commit comments

Comments
 (0)