Skip to content

Commit

Permalink
Merge pull request #4120 from arnaud-morvan/processing_fix_boolean_wr…
Browse files Browse the repository at this point in the history
…apper

[processing] fix boolean widget wrapper in batch dialog
  • Loading branch information
alexbruy committed Feb 16, 2017
2 parents aa86281 + 3a12f2a commit 441f6e6
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions python/plugins/processing/gui/wrappers.py
Expand Up @@ -241,24 +241,16 @@ def createWidget(self):
return QCheckBox()
elif self.dialogType == DIALOG_BATCH:
widget = QComboBox()
widget.addItem(self.tr('Yes'))
widget.addItem(self.tr('No'))
if self.param.default:
widget.setCurrentIndex(0)
else:
widget.setCurrentIndex(1)
widget.addItem(self.tr('Yes'), True)
widget.addItem(self.tr('No'), False)
return widget
else:
widget = QComboBox()
widget.addItem('Yes', True)
widget.addItem('No', False)
widget.addItem(self.tr('Yes'), True)
widget.addItem(self.tr('No'), False)
bools = self.dialog.getAvailableValuesOfType(ParameterBoolean, None)
for b in bools:
widget.addItem(self.dialog.resolveValueDescription(b), b)
if self.param.default:
widget.setCurrentIndex(0)
else:
widget.setCurrentIndex(1)
return widget

def setValue(self, value):
Expand All @@ -270,8 +262,6 @@ def setValue(self, value):
def value(self):
if self.dialogType == DIALOG_STANDARD:
return self.widget.isChecked()
elif self.dialogType == DIALOG_BATCH:
return self.widget.currentIndex == 0
else:
return self.comboValue()

Expand Down

0 comments on commit 441f6e6

Please sign in to comment.