use labels for to/from in lite history where available.
This commit is contained in:
parent
a61d1ad44b
commit
c506139e68
|
@ -334,7 +334,7 @@ class MiniWindow(QDialog):
|
||||||
|
|
||||||
def update_history(self, tx_history):
|
def update_history(self, tx_history):
|
||||||
for tx in tx_history[-10:]:
|
for tx in tx_history[-10:]:
|
||||||
address = tx["dest_address"]
|
address = tx["default_label"]
|
||||||
amount = D(tx["value"]) / 10**8
|
amount = D(tx["value"]) / 10**8
|
||||||
self.history_list.append(address, amount)
|
self.history_list.append(address, amount)
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
l.setColumnWidth(2, 350)
|
l.setColumnWidth(2, 350)
|
||||||
l.setColumnWidth(3, 140)
|
l.setColumnWidth(3, 140)
|
||||||
l.setColumnWidth(4, 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('itemDoubleClicked(QTreeWidgetItem*, int)'), self.tx_label_clicked)
|
||||||
self.connect(l, SIGNAL('itemChanged(QTreeWidgetItem*, int)'), self.tx_label_changed)
|
self.connect(l, SIGNAL('itemChanged(QTreeWidgetItem*, int)'), self.tx_label_changed)
|
||||||
l.setContextMenuPolicy(Qt.CustomContextMenu)
|
l.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||||
|
|
|
@ -892,12 +892,10 @@ class Wallet:
|
||||||
if tx['value']<0:
|
if tx['value']<0:
|
||||||
for o_addr in tx['outputs']:
|
for o_addr in tx['outputs']:
|
||||||
if not self.is_mine(o_addr):
|
if not self.is_mine(o_addr):
|
||||||
dest_label = self.labels.get(o_addr)
|
try:
|
||||||
if dest_label:
|
default_label = self.labels[o_addr]
|
||||||
default_label = 'to: ' + dest_label
|
except KeyError:
|
||||||
else:
|
default_label = o_addr
|
||||||
default_label = 'to: ' + o_addr
|
|
||||||
dest_address = o_addr
|
|
||||||
else:
|
else:
|
||||||
for o_addr in tx['outputs']:
|
for o_addr in tx['outputs']:
|
||||||
if self.is_mine(o_addr) and not self.is_change(o_addr):
|
if self.is_mine(o_addr) and not self.is_change(o_addr):
|
||||||
|
@ -911,14 +909,12 @@ class Wallet:
|
||||||
|
|
||||||
if o_addr:
|
if o_addr:
|
||||||
dest_label = self.labels.get(o_addr)
|
dest_label = self.labels.get(o_addr)
|
||||||
if dest_label:
|
try:
|
||||||
default_label = 'at: ' + dest_label
|
default_label = self.labels[o_addr]
|
||||||
else:
|
except KeyError:
|
||||||
default_label = 'at: ' + o_addr
|
default_label = o_addr
|
||||||
dest_address = o_addr
|
|
||||||
|
|
||||||
tx['default_label'] = default_label
|
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):
|
def mktx(self, to_address, amount, label, password, fee=None, change_addr=None, from_addr= None):
|
||||||
if not self.is_valid(to_address):
|
if not self.is_valid(to_address):
|
||||||
|
|
Loading…
Reference in New Issue