@@ -76,9 +76,7 @@ def __init__(self, alg, mainWidget):
76
76
self .resize (650 , 450 )
77
77
self .buttonBox = QtGui .QDialogButtonBox ()
78
78
self .buttonBox .setOrientation (QtCore .Qt .Horizontal )
79
- self .buttonBox .setStandardButtons (QtGui .QDialogButtonBox .Cancel
80
- | QtGui .QDialogButtonBox .Close )
81
- self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).setEnabled (False )
79
+ self .buttonBox .setStandardButtons (QtGui .QDialogButtonBox .Close )
82
80
self .runButton = QtGui .QPushButton ()
83
81
self .runButton .setText ('Run' )
84
82
self .buttonBox .addButton (self .runButton ,
@@ -128,8 +126,6 @@ def __init__(self, alg, mainWidget):
128
126
self .verticalLayout .addWidget (self .buttonBox )
129
127
self .setLayout (self .verticalLayout )
130
128
self .buttonBox .rejected .connect (self .close )
131
- self .buttonBox .button (
132
- QtGui .QDialogButtonBox .Cancel ).clicked .connect (self .cancel )
133
129
134
130
self .showDebug = ProcessingConfig .getSetting (
135
131
ProcessingConfig .SHOW_DEBUG_IN_DIALOG )
@@ -306,19 +302,6 @@ def error(self, msg):
306
302
self .resetGUI ()
307
303
self .tabWidget .setCurrentIndex (1 ) # log tab
308
304
309
- def iterate (self , i ):
310
- self .setInfo ('<b>Algorithm %s iteration #%i completed</b>'
311
- % (self .alg .name , i ))
312
-
313
- def cancel (self ):
314
- self .setInfo ('<b>Algorithm %s canceled</b>' % self .alg .name )
315
- try :
316
- self .algEx .algExecuted .disconnect ()
317
- self .algEx .terminate ()
318
- except :
319
- pass
320
- self .resetGUI ()
321
-
322
305
def resetGUI (self ):
323
306
QApplication .restoreOverrideCursor ()
324
307
self .progressLabel .setText ('' )
@@ -333,24 +316,30 @@ def setInfo(self, msg, error=False):
333
316
self .logText .append ('<span style="color:red">' + msg + '</span>' )
334
317
else :
335
318
self .logText .append (msg )
319
+ QCoreApplication .processEvents ()
336
320
337
321
def setCommand (self , cmd ):
338
322
if self .showDebug :
339
323
self .setInfo ('<tt>' + cmd + '<tt>' )
324
+ QCoreApplication .processEvents ()
340
325
341
326
def setDebugInfo (self , msg ):
342
327
if self .showDebug :
343
328
self .setInfo ('<span style="color:blue">' + msg + '</span>' )
329
+ QCoreApplication .processEvents ()
344
330
345
331
def setConsoleInfo (self , msg ):
346
332
if self .showDebug :
347
333
self .setCommand ('<span style="color:darkgray">' + msg + '</span>' )
334
+ QCoreApplication .processEvents ()
348
335
349
336
def setPercentage (self , i ):
350
337
if self .progress .maximum () == 0 :
351
338
self .progress .setMaximum (100 )
352
339
self .progress .setValue (i )
340
+ QCoreApplication .processEvents ()
353
341
354
342
def setText (self , text ):
355
343
self .progressLabel .setText (text )
356
344
self .setInfo (text , False )
345
+ QCoreApplication .processEvents ()
0 commit comments