File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -358,16 +358,32 @@ def runandload(name, *args):
358
358
QApplication .setOverrideCursor (QCursor (Qt .WaitCursor ))
359
359
if SextanteConfig .getSetting (SextanteConfig .USE_THREADS ):
360
360
algEx = AlgorithmExecutor (alg )
361
+ progress = QProgressDialog ()
362
+ progress .setWindowTitle (alg .name )
363
+ progress .setLabelText ("Executing %s..." % alg .name )
361
364
def finish ():
362
365
SextantePostprocessing .handleAlgorithmResults (alg )
363
366
QApplication .restoreOverrideCursor ()
367
+ progress .close ()
364
368
def error (msg ):
365
369
QApplication .restoreOverrideCursor ()
366
370
QMessageBox .critical (None , "Error" , msg )
367
371
SextanteLog .addToLog (SextanteLog .LOG_ERROR , msg )
372
+ def cancel ():
373
+ try :
374
+ algEx .finished .disconnect ()
375
+ algEx .terminate ()
376
+ QApplication .restoreOverrideCursor ()
377
+ progress .close ()
378
+ except :
379
+ pass
368
380
algEx .error .connect (error )
369
381
algEx .finished .connect (finish )
382
+ algEx .textChanged .connect (lambda t : progress .setLabelText (t ))
383
+ algEx .percentageChanged .connect (lambda x : progress .setValue (x ))
384
+ progress .canceled .connect (cancel )
370
385
algEx .start ()
386
+ progress .show ()
371
387
else :
372
388
if UnthreadedAlgorithmExecutor .runalg (alg , SilentProgress ()):
373
389
SextantePostprocessing .handleAlgorithmResults (alg )
You can’t perform that action at this time.
0 commit comments