This commit is contained in:
SomberNight 2018-02-28 01:26:05 +01:00
parent 8fe315beab
commit 2aaf250a4a
1 changed files with 4 additions and 4 deletions

View File

@ -229,12 +229,12 @@ class WaitingDialog(WindowModalDialog):
if isinstance(parent, MessageBoxMixin):
parent = parent.top_level_window()
WindowModalDialog.__init__(self, parent, _("Please wait"))
self.setAttribute(Qt.WA_DeleteOnClose) # see #3956
vbox = QVBoxLayout(self)
vbox.addWidget(QLabel(message))
self.accepted.connect(self.on_accepted)
self.show()
self.thread = TaskThread(self)
self.thread.finished.connect(self.deleteLater) # see #3956
self.thread.add(task, on_success, self.accept, on_error)
def wait(self):
@ -624,12 +624,12 @@ class TaskThread(QThread):
except BaseException:
self.doneSig.emit(sys.exc_info(), task.cb_done, task.cb_error)
def on_done(self, result, cb_done, cb):
def on_done(self, result, cb_done, cb_result):
# This runs in the parent's thread.
if cb_done:
cb_done()
if cb:
cb(result)
if cb_result:
cb_result(result)
def stop(self):
self.tasks.put(None)