[change] abortButton for Thread removed by default, cause it was not

working properly
This commit is contained in:
Marcel Paffrath 2017-08-03 14:39:58 +02:00
parent 125b72a582
commit cab9061030

View File

@ -43,13 +43,15 @@ class AutoPickThread(QThread):
class Thread(QThread): class Thread(QThread):
message = Signal(str) message = Signal(str)
def __init__(self, parent, func, arg=None, progressText=None, pb_widget=None, redirect_stdout=False): def __init__(self, parent, func, arg=None, progressText=None,
pb_widget=None, redirect_stdout=False, abortButton=False):
QThread.__init__(self, parent) QThread.__init__(self, parent)
self.func = func self.func = func
self.arg = arg self.arg = arg
self.progressText = progressText self.progressText = progressText
self.pb_widget = pb_widget self.pb_widget = pb_widget
self.redirect_stdout = redirect_stdout self.redirect_stdout = redirect_stdout
self.abortButton = abortButton
self.finished.connect(self.hideProgressbar) self.finished.connect(self.hideProgressbar)
self.showProgressbar() self.showProgressbar()
@ -87,7 +89,8 @@ class Thread(QThread):
pb.setRange(0, 0) pb.setRange(0, 0)
hl.addWidget(pb) hl.addWidget(pb)
hl.addWidget(QLabel(self.progressText)) hl.addWidget(QLabel(self.progressText))
hl.addWidget(delete_button) if self.abortButton:
hl.addWidget(delete_button)
self.pb_widget.setLayout(hl) self.pb_widget.setLayout(hl)
self.pb_widget.show() self.pb_widget.show()