1
0

Qt ConfirmTxDialog: make sure dialog is deleted when closed

Same for BlockingWaitingDialog.

related: https://github.com/spesmilo/electrum/issues/3956#issuecomment-1017593613
Note that this change does not solve the "dialog sometimes does not get drawn properly" issue,
just the "dialog sometimes does not get closed properly" issue.

closes: https://github.com/spesmilo/electrum/issues/7816
This commit is contained in:
SomberNight
2022-05-20 18:05:16 +02:00
parent 4e11116eab
commit 57ec9612cb
2 changed files with 8 additions and 4 deletions

View File

@@ -193,6 +193,7 @@ class ConfirmTxDialog(TxEditor, WindowModalDialog):
def run(self):
cancelled = not self.exec_()
password = self.pw.text() or None
self.deleteLater() # see #3956
return cancelled, self.is_send, password, self.tx
def on_send(self):

View File

@@ -337,15 +337,18 @@ class BlockingWaitingDialog(WindowModalDialog):
self.message_label = QLabel(message)
vbox = QVBoxLayout(self)
vbox.addWidget(self.message_label)
self.finished.connect(self.deleteLater) # see #3956
# show popup
self.show()
# refresh GUI; needed for popup to appear and for message_label to get drawn
QCoreApplication.processEvents()
QCoreApplication.processEvents()
# block and run given task
task()
# close popup
self.accept()
try:
# block and run given task
task()
finally:
# close popup
self.accept()
def line_dialog(parent, title, label, ok_label, default=None):