commit c69ce73814d638246a18ef72094c8dec1cd0ca2b
parent 4b6c86ecbecb445483a5dcf52d7cfea0e268afe9
Author: SomberNight <somber.night@protonmail.com>
Date: Tue, 13 Oct 2020 18:41:19 +0200
qt coins tab: label(utxo) to consider both label(txid) and label(addr)
related: #6644
Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py
@@ -419,7 +419,7 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
# note: when not finalized, RBF and locktime changes do not trigger
# a make_tx, so the txid is unreliable, hence:
self.tx_hash_e.setText(_('Unknown'))
- if desc is None:
+ if not desc:
self.tx_desc.hide()
else:
self.tx_desc.setText(_("Description") + ': ' + desc)
diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py
@@ -608,6 +608,7 @@ class MyTreeView(QTreeView):
def on_edited(self, idx: QModelIndex, user_role, text):
self.parent.wallet.set_label(user_role, text)
self.parent.history_model.refresh('on_edited in MyTreeView')
+ self.parent.utxo_list.update()
self.parent.update_completions()
def should_hide(self, row):
diff --git a/electrum/gui/qt/utxo_list.py b/electrum/gui/qt/utxo_list.py
@@ -98,7 +98,7 @@ class UTXOList(MyTreeView):
name = utxo.prevout.to_str()
name_short = utxo.prevout.txid.hex()[:16] + '...' + ":%d" % utxo.prevout.out_idx
self._utxo_dict[name] = utxo
- label = self.wallet.get_label_for_txid(utxo.prevout.txid.hex())
+ label = self.wallet.get_label_for_txid(utxo.prevout.txid.hex()) or self.wallet.get_label(address)
amount = self.parent.format_amount(utxo.value_sats(), whitespaces=True)
labels = [name_short, address, label, amount, '%d'%height]
utxo_item = [QStandardItem(x) for x in labels]
@@ -178,7 +178,7 @@ class UTXOList(MyTreeView):
# "Details"
tx = self.wallet.db.get_transaction(txid)
if tx:
- label = self.wallet.get_label_for_txid(txid) or None # Prefer None if empty (None hides the Description: field in the window)
+ label = self.wallet.get_label_for_txid(txid)
menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx, tx_desc=label))
# "Copy ..."
idx = self.indexAt(position)