|
63 | 63 |
|
64 | 64 |
|
65 | 65 | class ModelerParametersDialog(QDialog):
|
66 |
| - ENTER_NAME = '[Enter name if this is a final result]' |
67 |
| - NOT_SELECTED = '[Not selected]' |
68 |
| - USE_MIN_COVERING_EXTENT = '[Use min covering extent]' |
69 |
| - |
70 | 66 | def __init__(self, alg, model, algName=None):
|
71 | 67 | QDialog.__init__(self)
|
72 | 68 | self.setModal(True)
|
73 |
| - # The algorithm to define in this dialog. It is an instance of QgsProcessingModelAlgorithm |
74 |
| - self._alg = alg |
75 |
| - # The model this algorithm is going to be added to |
76 |
| - self.model = model |
77 |
| - # The name of the algorithm in the model, in case we are editing it and not defining it for the first time |
78 |
| - self.childId = algName |
| 69 | + |
| 70 | + self._alg = alg # The algorithm to define in this dialog. It is an instance of QgsProcessingAlgorithm |
| 71 | + self.model = model # The model this algorithm is going to be added to. It is an instance of QgsProcessingModelAlgorithm |
| 72 | + self.childId = algName # The name of the algorithm in the model, in case we are editing it and not defining it for the first time |
| 73 | + |
79 | 74 | self.setupUi()
|
80 | 75 | self.params = None
|
81 | 76 | settings = QgsSettings()
|
@@ -157,7 +152,7 @@ def setupUi(self):
|
157 | 152 | label = QLabel(dest.description())
|
158 | 153 | item = QgsFilterLineEdit()
|
159 | 154 | if hasattr(item, 'setPlaceholderText'):
|
160 |
| - item.setPlaceholderText(ModelerParametersDialog.ENTER_NAME) |
| 155 | + item.setPlaceholderText(self.tr('[Enter name if this is a final result]')) |
161 | 156 | self.verticalLayout.addWidget(label)
|
162 | 157 | self.verticalLayout.addWidget(item)
|
163 | 158 | self.valueItems[dest.name()] = item
|
@@ -319,8 +314,8 @@ def createAlgorithm(self):
|
319 | 314 | outputs = {}
|
320 | 315 | for dest in self._alg.destinationParameterDefinitions():
|
321 | 316 | if not dest.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
322 |
| - name = str(self.valueItems[dest.name()].text()) |
323 |
| - if name.strip() != '' and name != ModelerParametersDialog.ENTER_NAME: |
| 317 | + name = self.valueItems[dest.name()].text() |
| 318 | + if name.strip() != '': |
324 | 319 | output = QgsProcessingModelOutput(name, name)
|
325 | 320 | output.setChildId(alg.childId())
|
326 | 321 | output.setChildOutputName(dest.name())
|
|
0 commit comments