Skip to content

Commit

Permalink
[processing] fix modeler parameter mandatory checkbox logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Oct 22, 2016
1 parent 3cc9b5d commit ddc44df
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -226,7 +226,7 @@ def setupUi(self):
self.requiredCheck.setText(self.tr('Mandatory'))
self.requiredCheck.setChecked(True)
if self.param is not None:
self.requiredCheck.setChecked(self.param.optional)
self.requiredCheck.setChecked(not self.param.optional)
self.verticalLayout.addWidget(self.requiredCheck)

self.buttonBox = QDialogButtonBox(self)
Expand Down Expand Up @@ -325,7 +325,7 @@ def okPressed(self):
elif (self.paramType == ModelerParameterDefinitionDialog.PARAMETER_CRS or
isinstance(self.param, ParameterCrs)):
self.param = ParameterCrs(name, description, self.defaultTextBox.getValue())
self.param.optional = self.requiredCheck.isChecked()
self.param.optional = not self.requiredCheck.isChecked()
self.close()

def cancelPressed(self):
Expand Down

0 comments on commit ddc44df

Please sign in to comment.