@@ -70,9 +70,12 @@ def __init__(self, alg, mainWidget):
70
70
self .buttonBox = QtGui .QDialogButtonBox ()
71
71
self .buttonBox .setOrientation (QtCore .Qt .Horizontal )
72
72
self .buttonBox .setStandardButtons (
73
- QtGui .QDialogButtonBox .Cancel | QtGui .QDialogButtonBox .Close | QtGui . QDialogButtonBox . Ok )
73
+ QtGui .QDialogButtonBox .Cancel | QtGui .QDialogButtonBox .Close )
74
74
self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).setEnabled (False )
75
-
75
+ self .runButton = QtGui .QPushButton ()
76
+ self .runButton .setText ("Run" )
77
+ self .buttonBox .addButton (self .runButton , QtGui .QDialogButtonBox .ActionRole )
78
+ self .runButton .clicked .connect (self .accept )
76
79
self .scrollArea = QtGui .QScrollArea ()
77
80
if self .mainWidget :
78
81
self .scrollArea .setWidget (self .mainWidget )
@@ -118,7 +121,7 @@ def __init__(self, alg, mainWidget):
118
121
self .verticalLayout .addWidget (self .progress )
119
122
self .verticalLayout .addWidget (self .buttonBox )
120
123
self .setLayout (self .verticalLayout )
121
- self .buttonBox .accepted .connect (self .accept )
124
+ # self.buttonBox.accepted.connect(self.accept)
122
125
self .buttonBox .rejected .connect (self .close )
123
126
self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).clicked .connect (self .cancel )
124
127
#~ QtCore.QMetaObject.connectSlotsByName(self)
@@ -207,7 +210,7 @@ def accept(self):
207
210
if msg :
208
211
QMessageBox .critical (self , "Unable to execute algorithm" , msg )
209
212
return
210
- self .buttonBox . button ( QtGui . QDialogButtonBox . Ok ) .setEnabled (False )
213
+ self .runButton .setEnabled (False )
211
214
self .buttonBox .button (QtGui .QDialogButtonBox .Close ).setEnabled (False )
212
215
buttons = self .paramTable .iterateButtons
213
216
self .iterateParam = None
@@ -321,7 +324,7 @@ def resetGUI(self):
321
324
self .progressLabel .setText ("" )
322
325
self .progress .setValue (100 )
323
326
#self.progress.setMaximum(100)
324
- self .buttonBox . button ( QtGui . QDialogButtonBox . Ok ) .setEnabled (True )
327
+ self .runButton .setEnabled (True )
325
328
self .buttonBox .button (QtGui .QDialogButtonBox .Close ).setEnabled (True )
326
329
self .buttonBox .button (QtGui .QDialogButtonBox .Cancel ).setEnabled (False )
327
330
0 commit comments