commit 9625ef1ea902b14d47f36d5d0416537a5aee9030
parent 7ba656a1bc68e66e231bb8294a3be6a3ac5c9993
Author: thomasv <thomasv@gitorious>
Date: Thu, 7 Jun 2012 16:14:08 +0200
define method get_address_flags
Diffstat:
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/electrum b/electrum
@@ -380,10 +380,9 @@ if __name__ == '__main__':
for addr in wallet.all_addresses():
if options.show_all or not wallet.is_change(addr):
- flags = "C" if wallet.is_change(addr) else "I" if addr in wallet.imported_keys.keys() else "-"
- flags += "F" if addr in wallet.frozen_addresses else "P" if addr in wallet.prioritized_addresses else "-"
-
+ flags = wallet.get_address_flags(addr)
label = wallet.labels.get(addr,'')
+
if label: label = "\"%s\""%label
if options.show_balance:
diff --git a/lib/gui_qt.py b/lib/gui_qt.py
@@ -693,9 +693,10 @@ class ElectrumWindow(QMainWindow):
c, u = self.wallet.get_addr_balance(address)
balance = format_satoshis( c + u, False, self.wallet.num_zeros )
- flags = '--'
+ flags = self.wallet.get_address_flags(address)
item = QTreeWidgetItem( [ flags, address, label, balance, tx] )
+ item.setFont(0, QFont(MONOSPACE_FONT))
item.setFont(1, QFont(MONOSPACE_FONT))
if address in self.wallet.frozen_addresses:
item.setBackgroundColor(1, QColor('lightblue'))
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -623,6 +623,10 @@ class Wallet:
self.file_exists = True
+ def get_address_flags(self, addr):
+ flags = "C" if self.is_change(addr) else "I" if addr in self.imported_keys.keys() else "-"
+ flags += "F" if addr in self.frozen_addresses else "P" if addr in self.prioritized_addresses else "-"
+ return flags
def get_addr_balance(self, addr):