From 0a7b585b6c7112fe54d22eb9bc7256974518f489 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 4 Apr 2015 15:55:28 +0200 Subject: [PATCH] redo default labels with incoming tx outputs --- gui/qt/main_window.py | 4 +--- lib/wallet.py | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 95403a268..8c4402787 100644 --- 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 index 51ff15e0e..f6d017cfc 100644 --- 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):