Skip to content
Permalink
Browse files

Fix Boolean widget wrapper in batch dialog

  • Loading branch information
arnaud-morvan committed Feb 9, 2017
1 parent 2f68d1a commit 3a12f2a0b6898ca40f1e57bba0e1bdf20773d439
Showing with 4 additions and 14 deletions.
  1. +4 −14 python/plugins/processing/gui/wrappers.py
@@ -196,24 +196,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):
@@ -225,8 +217,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 3a12f2a

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