use labels for to/from in lite history where available.

This commit is contained in:
Amir Taaki 2012-08-12 21:52:28 +01:00
parent a61d1ad44b
commit c506139e68
3 changed files with 10 additions and 14 deletions

View File

@ -334,7 +334,7 @@ class MiniWindow(QDialog):
def update_history(self, tx_history):
for tx in tx_history[-10:]:
address = tx["dest_address"]
address = tx["default_label"]
amount = D(tx["value"]) / 10**8
self.history_list.append(address, amount)

View File

@ -291,7 +291,7 @@ class ElectrumWindow(QMainWindow):
l.setColumnWidth(2, 350)
l.setColumnWidth(3, 140)
l.setColumnWidth(4, 140)
l.setHeaderLabels( [ '', _( 'Date' ), _( 'Description' ) , _('Amount'), _('Balance')] )
l.setHeaderLabels( [ '', _( 'Date' ), _( 'To / From' ) , _('Amount'), _('Balance')] )
self.connect(l, SIGNAL('itemDoubleClicked(QTreeWidgetItem*, int)'), self.tx_label_clicked)
self.connect(l, SIGNAL('itemChanged(QTreeWidgetItem*, int)'), self.tx_label_changed)
l.setContextMenuPolicy(Qt.CustomContextMenu)

View File

@ -892,12 +892,10 @@ class Wallet:
if tx['value']<0:
for o_addr in tx['outputs']:
if not self.is_mine(o_addr):
dest_label = self.labels.get(o_addr)
if dest_label:
default_label = 'to: ' + dest_label
else:
default_label = 'to: ' + o_addr
dest_address = o_addr
try:
default_label = self.labels[o_addr]
except KeyError:
default_label = o_addr
else:
for o_addr in tx['outputs']:
if self.is_mine(o_addr) and not self.is_change(o_addr):
@ -911,14 +909,12 @@ class Wallet:
if o_addr:
dest_label = self.labels.get(o_addr)
if dest_label:
default_label = 'at: ' + dest_label
else:
default_label = 'at: ' + o_addr
dest_address = o_addr
try:
default_label = self.labels[o_addr]
except KeyError:
default_label = o_addr
tx['default_label'] = default_label
tx['dest_address'] = dest_address
def mktx(self, to_address, amount, label, password, fee=None, change_addr=None, from_addr= None):
if not self.is_valid(to_address):