@@ -166,7 +166,6 @@ def setParamValue(self, param, widget):
166
166
167
167
@pyqtSlot ()
168
168
def accept (self ):
169
- #~ try:
170
169
if self .setParamValues ():
171
170
msg = self .alg .checkParameterValuesBeforeExecuting ()
172
171
if msg :
@@ -205,39 +204,25 @@ def accept(self):
205
204
self .setInfo ("Algorithm %s started" % self .alg .name )
206
205
self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).setEnabled (True )
207
206
self .tabWidget .setCurrentIndex (1 ) # log tab
208
- self .finish ()
209
207
else :
210
- keepOpen = SextanteConfig .getSetting (SextanteConfig .KEEP_DIALOG_OPEN )
211
208
if iterateParam :
212
209
UnthreadedAlgorithmExecutor .runalgIterating (self .alg , iterateParam , self )
213
210
else :
214
211
command = self .alg .getAsCommand ()
215
212
if command :
216
213
SextanteLog .addToLog (SextanteLog .LOG_ALGORITHM , command )
217
214
if UnthreadedAlgorithmExecutor .runalg (self .alg , self ):
218
- SextantePostprocessing .handleAlgorithmResults (self .alg , not keepOpen )
219
- self .executed = True
220
- QApplication .restoreOverrideCursor ()
221
- if not keepOpen :
222
- self .close ()
223
- else :
224
- self .progressLabel .setText ("" )
225
- self .progress .setMaximum (100 )
226
- self .progress .setValue (0 )
227
- self .buttonBox .button (QtGui .QDialogButtonBox .Ok ).setEnabled (True )
228
- self .buttonBox .button (QtGui .QDialogButtonBox .Close ).setEnabled (True )
229
- self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).setEnabled (False )
230
-
231
-
215
+ self .finish ()
232
216
else :
233
217
QMessageBox .critical (self , "Unable to execute algorithm" , "Wrong or missing parameter values" )
234
218
235
219
@pyqtSlot ()
236
220
def finish (self ):
221
+ keepOpen = SextanteConfig .getSetting (SextanteConfig .KEEP_DIALOG_OPEN )
222
+ SextantePostprocessing .handleAlgorithmResults (self .alg , not keepOpen )
237
223
self .executed = True
238
224
self .setInfo ("Algorithm %s finished correctly" % self .alg .name )
239
225
QApplication .restoreOverrideCursor ()
240
- keepOpen = SextanteConfig .getSetting (SextanteConfig .KEEP_DIALOG_OPEN )
241
226
if not keepOpen :
242
227
self .close ()
243
228
else :
0 commit comments