diff --git a/lib/gui_lite.py b/lib/gui_lite.py index 22106ffb4..67ccdc8ed 100644 --- a/lib/gui_lite.py +++ b/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) diff --git a/lib/gui_qt.py b/lib/gui_qt.py index 4b6214d2c..d8f26fc5d 100644 --- a/lib/gui_qt.py +++ b/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) diff --git a/lib/wallet.py b/lib/wallet.py index 9c51df162..fcc846e8c 100644 --- a/lib/wallet.py +++ b/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):