Merge pull request #1316 from kyuupichan/tx_dialog3
Distinguish receiving and change addrs in TxDialog
This commit is contained in:
@@ -215,9 +215,17 @@ class TxDialog(QWidget):
|
|||||||
vbox.addWidget(QLabel(_("Inputs")))
|
vbox.addWidget(QLabel(_("Inputs")))
|
||||||
|
|
||||||
ext = QTextCharFormat()
|
ext = QTextCharFormat()
|
||||||
own = QTextCharFormat()
|
rec = QTextCharFormat()
|
||||||
own.setBackground(QBrush(QColor("lightgreen")))
|
rec.setBackground(QBrush(QColor("lightgreen")))
|
||||||
own.setToolTip(_("Own address"))
|
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 = QTextEdit()
|
||||||
i_text.setFont(QFont(MONOSPACE_FONT))
|
i_text.setFont(QFont(MONOSPACE_FONT))
|
||||||
@@ -239,7 +247,7 @@ class TxDialog(QWidget):
|
|||||||
addr = _addr
|
addr = _addr
|
||||||
if addr is None:
|
if addr is None:
|
||||||
addr = _('unknown')
|
addr = _('unknown')
|
||||||
cursor.insertText(addr, own if self.wallet.is_mine(addr) else ext)
|
cursor.insertText(addr, text_format(addr))
|
||||||
cursor.insertBlock()
|
cursor.insertBlock()
|
||||||
|
|
||||||
vbox.addWidget(i_text)
|
vbox.addWidget(i_text)
|
||||||
@@ -250,10 +258,10 @@ class TxDialog(QWidget):
|
|||||||
o_text.setMaximumHeight(100)
|
o_text.setMaximumHeight(100)
|
||||||
cursor = o_text.textCursor()
|
cursor = o_text.textCursor()
|
||||||
for addr, v in self.tx.get_outputs():
|
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:
|
if v is not None:
|
||||||
cursor.insertText('\t', ext)
|
cursor.insertText('\t', ext)
|
||||||
cursor.insertText(self.parent.format_amount(v), ext)
|
cursor.insertText(self.parent.format_amount(v, whitespaces = True), ext)
|
||||||
cursor.insertBlock()
|
cursor.insertBlock()
|
||||||
vbox.addWidget(o_text)
|
vbox.addWidget(o_text)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user