commit 0a7b585b6c7112fe54d22eb9bc7256974518f489
parent 21ccb1e82de79ec5277e2f9ec55c30166d7c1475
Author: ThomasV <thomasv@gitorious>
Date: Sat, 4 Apr 2015 15:55:28 +0200
redo default labels with incoming tx outputs
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -676,8 +676,6 @@ class ElectrumWindow(QMainWindow):
v_str = self.format_amount(value, True, whitespaces=True)
balance_str = self.format_amount(balance, whitespaces=True)
label, is_default_label = self.wallet.get_label(tx_hash)
- if is_default_label:
- label = ''
item = QTreeWidgetItem( [ '', time_str, label, v_str, balance_str] )
item.setFont(2, QFont(MONOSPACE_FONT))
item.setFont(3, QFont(MONOSPACE_FONT))
@@ -687,7 +685,7 @@ class ElectrumWindow(QMainWindow):
if tx_hash:
item.setData(0, Qt.UserRole, tx_hash)
if is_default_label:
- item.setForeground(2, QBrush(QColor('lightgrey')))
+ item.setForeground(2, QBrush(QColor('grey')))
item.setIcon(0, icon)
l.insertTopLevelItem(0, item)
if current_tx == tx_hash:
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -775,6 +775,15 @@ class Abstract_Wallet(object):
return label, is_default
def get_default_label(self, tx_hash):
+ if self.txi.get(tx_hash) == {}:
+ d = self.txo.get(tx_hash, {})
+ for addr in d.keys():
+ assert self.is_mine(addr)
+ label = self.labels.get(addr)
+ if label:
+ break
+ label = ">" + addr
+ return label
return tx_hash
def get_tx_fee(self, tx):