@@ -167,17 +167,19 @@ def load(self):
167
167
for param in self .alg .parameterDefinitions ():
168
168
if param .flags () & QgsProcessingParameterDefinition .FlagHidden :
169
169
continue
170
+ if param .isDestination ():
171
+ continue
170
172
if param .name () in params :
171
- value = params [param .name ()].strip ('"' )
173
+ value = params [param .name ()].strip ("'" )
172
174
wrapper = self .wrappers [row ][column ]
173
175
wrapper .setValue (value )
174
176
column += 1
175
177
176
- for out in self .alg .outputs :
178
+ for out in self .alg .destinationParameterDefinitions () :
177
179
if out .flags () & QgsProcessingParameterDefinition .FlagHidden :
178
180
continue
179
181
if out .name () in outputs :
180
- value = outputs [out .name ()].strip ('"' )
182
+ value = outputs [out .name ()].strip ("'" )
181
183
widget = self .tblParameters .cellWidget (row , column )
182
184
widget .setValue (value )
183
185
column += 1
@@ -198,26 +200,28 @@ def save(self):
198
200
for param in alg .parameterDefinitions ():
199
201
if param .flags () & QgsProcessingParameterDefinition .FlagHidden :
200
202
continue
203
+ if param .isDestination ():
204
+ continue
201
205
wrapper = self .wrappers [row ][col ]
202
- if not param .checkValueIsAcceptable (wrapper .value , context ):
206
+ if not param .checkValueIsAcceptable (wrapper .value () , context ):
203
207
self .parent .bar .pushMessage ("" , self .tr ('Wrong or missing parameter value: {0} (row {1})' ).format (
204
- param .description (), row + 1 ),
205
- level = QgsMessageBar .WARNING , duration = 5 )
208
+ param .description (), row + 1 ),
209
+ level = QgsMessageBar .WARNING , duration = 5 )
206
210
return
207
- algParams [param .name ()] = param .getValueAsCommandLineParameter ( )
211
+ algParams [param .name ()] = param .valueAsPythonString ( wrapper . value (), context )
208
212
col += 1
209
- for out in alg .outputs :
213
+ for out in alg .destinationParameterDefinitions () :
210
214
if out .flags () & QgsProcessingParameterDefinition .FlagHidden :
211
215
continue
212
216
widget = self .tblParameters .cellWidget (row , col )
213
217
text = widget .getValue ()
214
218
if text .strip () != '' :
215
- algOutputs [out .name ] = text .strip ()
219
+ algOutputs [out .name () ] = text .strip ()
216
220
col += 1
217
221
else :
218
222
self .parent .bar .pushMessage ("" , self .tr ('Wrong or missing output value: {0} (row {1})' ).format (
219
- out .description (), row + 1 ),
220
- level = QgsMessageBar .WARNING , duration = 5 )
223
+ out .description (), row + 1 ),
224
+ level = QgsMessageBar .WARNING , duration = 5 )
221
225
return
222
226
toSave .append ({self .PARAMETERS : algParams , self .OUTPUTS : algOutputs })
223
227
0 commit comments