|
@ -1491,24 +1491,6 @@ class ElectrumWindow(QMainWindow): |
|
|
menu.exec_(self.invoices_list.viewport().mapToGlobal(position)) |
|
|
menu.exec_(self.invoices_list.viewport().mapToGlobal(position)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_address_item(self, item): |
|
|
|
|
|
item.setFont(0, QFont(MONOSPACE_FONT)) |
|
|
|
|
|
address = str(item.data(0,0).toString()) |
|
|
|
|
|
label = self.wallet.labels.get(address,'') |
|
|
|
|
|
item.setData(1,0,label) |
|
|
|
|
|
item.setData(0,32, True) # is editable |
|
|
|
|
|
|
|
|
|
|
|
run_hook('update_address_item', address, item) |
|
|
|
|
|
|
|
|
|
|
|
if not self.wallet.is_mine(address): return |
|
|
|
|
|
|
|
|
|
|
|
c, u = self.wallet.get_addr_balance(address) |
|
|
|
|
|
balance = self.format_amount(c + u) |
|
|
|
|
|
item.setData(2,0,balance) |
|
|
|
|
|
|
|
|
|
|
|
if address in self.wallet.frozen_addresses: |
|
|
|
|
|
item.setBackgroundColor(0, QColor('lightblue')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_address_tab(self): |
|
|
def update_address_tab(self): |
|
|
l = self.address_list |
|
|
l = self.address_list |
|
@ -1551,27 +1533,22 @@ class ElectrumWindow(QMainWindow): |
|
|
used_item = QTreeWidgetItem( [ _("Used"), '', '', '', ''] ) |
|
|
used_item = QTreeWidgetItem( [ _("Used"), '', '', '', ''] ) |
|
|
used_flag = False |
|
|
used_flag = False |
|
|
|
|
|
|
|
|
is_red = False |
|
|
addr_list = account.get_addresses(is_change) |
|
|
gap = 0 |
|
|
for address in addr_list: |
|
|
|
|
|
|
|
|
for address in account.get_addresses(is_change): |
|
|
|
|
|
|
|
|
|
|
|
num, is_used = self.wallet.is_used(address) |
|
|
num, is_used = self.wallet.is_used(address) |
|
|
if num == 0: |
|
|
label = self.wallet.labels.get(address,'') |
|
|
gap += 1 |
|
|
c, u = self.wallet.get_addr_balance(address) |
|
|
if gap > self.wallet.gap_limit: |
|
|
balance = self.format_amount(c + u) |
|
|
is_red = True |
|
|
item = QTreeWidgetItem( [ address, label, balance, "%d"%num] ) |
|
|
else: |
|
|
item.setFont(0, QFont(MONOSPACE_FONT)) |
|
|
gap = 0 |
|
|
item.setData(0, 32, True) # label can be edited |
|
|
|
|
|
if address in self.wallet.frozen_addresses: |
|
|
item = QTreeWidgetItem( [ address, '', '', "%d"%num] ) |
|
|
item.setBackgroundColor(0, QColor('lightblue')) |
|
|
self.update_address_item(item) |
|
|
if self.wallet.is_beyond_limit(address, account, is_change): |
|
|
if is_red: |
|
|
item.setBackgroundColor(0, QColor('red')) |
|
|
item.setBackgroundColor(1, QColor('red')) |
|
|
|
|
|
|
|
|
|
|
|
if is_used: |
|
|
if is_used: |
|
|
if not used_flag: |
|
|
if not used_flag: |
|
|
seq_item.insertChild(0,used_item) |
|
|
seq_item.insertChild(0, used_item) |
|
|
used_flag = True |
|
|
used_flag = True |
|
|
used_item.addChild(item) |
|
|
used_item.addChild(item) |
|
|
else: |
|
|
else: |
|
@ -1600,7 +1577,6 @@ class ElectrumWindow(QMainWindow): |
|
|
l.setCurrentItem(l.topLevelItem(0)) |
|
|
l.setCurrentItem(l.topLevelItem(0)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_console_tab(self): |
|
|
def create_console_tab(self): |
|
|
from console import Console |
|
|
from console import Console |
|
|
self.console = console = Console() |
|
|
self.console = console = Console() |
|
|