This commit is contained in:
SomberNight 2018-02-26 22:03:22 +01:00
parent 5893af5025
commit 98cdbe3771
1 changed files with 2 additions and 1 deletions

View File

@ -218,13 +218,14 @@ class WindowModalDialog(QDialog, MessageBoxMixin):
class WaitingDialog(WindowModalDialog):
'''Shows a please wait dialog whilst runnning a task. It is not
'''Shows a please wait dialog whilst running a task. It is not
necessary to maintain a reference to this dialog.'''
def __init__(self, parent, message, task, on_success=None, on_error=None):
assert parent
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)