Skip to content

Commit

Permalink
Fix Boolean widget wrapper in batch dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Feb 9, 2017
1 parent 2f68d1a commit 3a12f2a
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions python/plugins/processing/gui/wrappers.py
Expand Up @@ -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):
Expand All @@ -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()

Expand Down

0 comments on commit 3a12f2a

Please sign in to comment.