Skip to content
Permalink
Browse files

Merge pull request #4120 from arnaud-morvan/processing_fix_boolean_wr…

…apper

[processing] fix boolean widget wrapper in batch dialog
  • Loading branch information
alexbruy committed Feb 16, 2017
2 parents aa86281 + 3a12f2a commit 441f6e6e6e5e8531a858128f488621c9187b2e09
Showing with 4 additions and 14 deletions.
  1. +4 −14 python/plugins/processing/gui/wrappers.py
@@ -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):
@@ -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()

0 comments on commit 441f6e6

Please sign in to comment.
You can’t perform that action at this time.