Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] recover previous value of formula in modeler calculator
#fixes 11539
  • Loading branch information
volaya committed Sep 30, 2015
1 parent 3bb677e commit 56af106
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/FieldsMapper.py
Expand Up @@ -62,8 +62,8 @@ def defineCharacteristics(self):
def getCustomParametersDialog(self):
return FieldsMapperParametersDialog(self)

def getCustomModelerParametersDialog(self, modelAlg, algIndex=None):
return FieldsMapperModelerParametersDialog(self, modelAlg, algIndex)
def getCustomModelerParametersDialog(self, modelAlg, algName=None):
return FieldsMapperModelerParametersDialog(self, modelAlg, algName)

def processAlgorithm(self, progress):
layer = self.getParameterValue(self.INPUT_LAYER)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -161,7 +161,7 @@ def getCustomParametersDialog(self):
"""
return None

def getCustomModelerParametersDialog(self, modelAlg, algIndex=None):
def getCustomModelerParametersDialog(self, modelAlg, algName=None):
"""If the algorithm has a custom parameters dialog when called
from the modeler, it should be returned here, ready to be
executed.
Expand Down
Expand Up @@ -71,8 +71,8 @@ def processAlgorithm(self, progress):
raise GeoAlgorithmExecutionException(
self.tr('Wrong formula: %s', 'CalculatorModelerAlgorithm') % formula)

def getCustomModelerParametersDialog(self, modelAlg, algIndex=None):
return CalculatorModelerParametersDialog(self, modelAlg, algIndex)
def getCustomModelerParametersDialog(self, modelAlg, algName=None):
return CalculatorModelerParametersDialog(self, modelAlg, algName)


class CalculatorModelerParametersDialog(ModelerParametersDialog):
Expand Down Expand Up @@ -101,6 +101,8 @@ def setupUi(self):
self.formulaText = QLineEdit()
if hasattr(self.formulaText, 'setPlaceholderText'):
self.formulaText.setPlaceholderText(self.tr('[Enter your formula here]', 'CalculatorModelerParametersDialog'))
alg = self.model.algs[self._algName]
self.formulaText.setText(alg.params[FORMULA])
self.setWindowTitle(self.tr('Calculator', 'CalculatorModelerParametersDialog'))
self.verticalLayout = QVBoxLayout()
self.verticalLayout.setSpacing(2)
Expand Down

0 comments on commit 56af106

Please sign in to comment.