From 820f435a9a39489cbfc529780e08c37353fbc30d Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 26 Jun 2015 11:55:20 +0900 Subject: [PATCH] Distinguish receiving and change addrs in TxDialog Show change in yellow, receiving in lightgreen (as now). Numbers are more readable with whitespace. --- gui/qt/transaction_dialog.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py index 1e290d5e8..da5734015 100644 --- a/gui/qt/transaction_dialog.py +++ b/gui/qt/transaction_dialog.py @@ -215,9 +215,17 @@ class TxDialog(QWidget): vbox.addWidget(QLabel(_("Inputs"))) ext = QTextCharFormat() - own = QTextCharFormat() - own.setBackground(QBrush(QColor("lightgreen"))) - own.setToolTip(_("Own address")) + rec = QTextCharFormat() + rec.setBackground(QBrush(QColor("lightgreen"))) + rec.setToolTip(_("Wallet receive address")) + chg = QTextCharFormat() + chg.setBackground(QBrush(QColor("yellow"))) + chg.setToolTip(_("Wallet change address")) + + def text_format(addr): + if self.wallet.is_mine(addr): + return chg if self.wallet.is_change(addr) else rec + return ext i_text = QTextEdit() i_text.setFont(QFont(MONOSPACE_FONT)) @@ -239,7 +247,7 @@ class TxDialog(QWidget): addr = _addr if addr is None: addr = _('unknown') - cursor.insertText(addr, own if self.wallet.is_mine(addr) else ext) + cursor.insertText(addr, text_format(addr)) cursor.insertBlock() vbox.addWidget(i_text) @@ -250,10 +258,10 @@ class TxDialog(QWidget): o_text.setMaximumHeight(100) cursor = o_text.textCursor() for addr, v in self.tx.get_outputs(): - cursor.insertText(addr, own if self.wallet.is_mine(addr) else ext) + cursor.insertText(addr, text_format(addr)) if v is not None: cursor.insertText('\t', ext) - cursor.insertText(self.parent.format_amount(v), ext) + cursor.insertText(self.parent.format_amount(v, whitespaces = True), ext) cursor.insertBlock() vbox.addWidget(o_text)