Browse Source

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

283
Amir Taaki 13 years ago
parent
commit
c506139e68
  1. 2
      lib/gui_lite.py
  2. 2
      lib/gui_qt.py
  3. 20
      lib/wallet.py

2
lib/gui_lite.py

@ -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)

2
lib/gui_qt.py

@ -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)

20
lib/wallet.py

@ -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):

Loading…
Cancel
Save