Skip to content

Commit

Permalink
Merge pull request #3657 from nirvn/processing_modeler_mandatory
Browse files Browse the repository at this point in the history
[processing] fix modeler parameter mandatory checkbox logic
  • Loading branch information
nyalldawson authored Oct 30, 2016
2 parents d5698be + ddc44df commit 29ce141
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
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 29ce141

Please sign in to comment.