tmake txdialog a nonmodal widget - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 5a4a9f5369906fd60e5c7a8373131ce9bed3099f DIR parent 0b874b2bb03250584ef1bfc35f9151868595ffb7 HTML Author: ThomasV <thomasv@gitorious> Date: Sun, 7 Jun 2015 16:51:27 +0200 make txdialog a nonmodal widget Diffstat: M gui/qt/main_window.py | 2 +- M gui/qt/transaction_dialog.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) --- DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -570,7 +570,7 @@ class ElectrumWindow(QMainWindow): def show_transaction(self, tx): import transaction_dialog d = transaction_dialog.TxDialog(tx, self) - d.exec_() + d.show() def update_history_tab(self): domain = self.wallet.get_account_addresses(self.current_account) DIR diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py t@@ -40,7 +40,7 @@ from electrum.plugins import run_hook from util import * -class TxDialog(QDialog): +class TxDialog(QWidget): def __init__(self, tx, parent): self.tx = tx t@@ -49,10 +49,9 @@ class TxDialog(QDialog): self.wallet = parent.wallet self.saved = True - QDialog.__init__(self) + QWidget.__init__(self) self.setMinimumWidth(600) self.setWindowTitle(_("Transaction")) - self.setModal(1) vbox = QVBoxLayout() self.setLayout(vbox) t@@ -109,9 +108,11 @@ class TxDialog(QDialog): def close(self): if not self.saved: - if QMessageBox.question(self, _('Message'), _('This transaction is not saved. Close anyway?'), QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.No: + if QMessageBox.question( + self, _('Message'), _('This transaction is not saved. Close anyway?'), + QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.No: return - self.done(0) + QWidget.close(self) def show_qr(self): text = self.tx.raw.decode('hex')