Browse Source

qt coins tab: label(utxo) to consider both label(txid) and label(addr)

related: #6644
patch-4
SomberNight 4 years ago
parent
commit
c69ce73814
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/transaction_dialog.py
  2. 1
      electrum/gui/qt/util.py
  3. 4
      electrum/gui/qt/utxo_list.py

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

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

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

Loading…
Cancel
Save