From 5bf5dd805b9419224f9c4d1445a7cdd352829685 Mon Sep 17 00:00:00 2001 From: thgh Date: Thu, 14 Nov 2013 14:07:44 +0100 Subject: [PATCH 1/2] Old addresses on receive tab grayed out --- gui/qt/main_window.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 18ff5712..37103162 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1173,7 +1173,7 @@ class ElectrumWindow(QMainWindow): menu.exec_(self.contacts_list.viewport().mapToGlobal(position)) - def update_receive_item(self, item): + def update_receive_item(self, item, num_tx = 0): item.setFont(0, QFont(MONOSPACE_FONT)) address = str(item.data(0,0).toString()) label = self.wallet.labels.get(address,'') @@ -1188,11 +1188,16 @@ class ElectrumWindow(QMainWindow): balance = self.format_amount(c + u) item.setData(2,0,balance) - if address in self.wallet.frozen_addresses: + if (num_tx > 1) and (c == -u): + item.setForeground(0,QColor('lightgray')) + item.setForeground(1,QColor('gray')) + item.setForeground(2,QColor('gray')) + item.setForeground(3,QColor('gray')) + elif address in self.wallet.frozen_addresses: item.setBackgroundColor(0, QColor('lightblue')) elif address in self.wallet.prioritized_addresses: item.setBackgroundColor(0, QColor('lightgreen')) - + def update_receive_tab(self): l = self.receive_list @@ -1231,7 +1236,7 @@ class ElectrumWindow(QMainWindow): is_red = False gap = 0 - for address in account.get_addresses(is_change): + for address in reversed(account.get_addresses(is_change)): h = self.wallet.history.get(address,[]) if h == []: @@ -1243,7 +1248,7 @@ class ElectrumWindow(QMainWindow): num_tx = '*' if h == ['*'] else "%d"%len(h) item = QTreeWidgetItem( [ address, '', '', num_tx] ) - self.update_receive_item(item) + self.update_receive_item(item, len(h)) if is_red: item.setBackgroundColor(1, QColor('red')) seq_item.addChild(item) From ae74568620e1eee8fe27504ee98a996943ac2a1b Mon Sep 17 00:00:00 2001 From: thgh Date: Thu, 14 Nov 2013 15:55:21 +0100 Subject: [PATCH 2/2] Undo reverse list --- gui/qt/main_window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 37103162..7bda9f67 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1236,7 +1236,7 @@ class ElectrumWindow(QMainWindow): is_red = False gap = 0 - for address in reversed(account.get_addresses(is_change)): + for address in account.get_addresses(is_change): h = self.wallet.history.get(address,[]) if h == []: