commit 05c496edd193c73cb8e6511e095c88c8650ecc10
parent 9627f32e086bae011e2f0d2771951966370e5f40
Author: SomberNight <somber.night@protonmail.com>
Date: Tue, 12 Nov 2019 22:04:57 +0100
PreviewTxDialog: small UI changes
Diffstat:
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -1451,9 +1451,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
raise Exception('unknown invoice type')
def get_coins(self):
- coins = self.utxo_list.get_spend_list()
+ coins = self.get_manually_selected_coins()
return coins or self.wallet.get_spendable_coins(None)
+ def get_manually_selected_coins(self) -> Sequence[PartialTxInput]:
+ return self.utxo_list.get_spend_list()
+
def pay_onchain_dialog(self, inputs, outputs, invoice=None, external_keypairs=None):
# trustedcoin requires this
if run_hook('abort_send', self):
@@ -1563,7 +1566,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
def open_channel(self, connect_str, local_amt, push_amt):
# use ConfirmTxDialog
# we need to know the fee before we broadcast, because the txid is required
- # however, the user must be allowed to broadcast early
+ # however, the user must not be allowed to broadcast early
funding_sat = local_amt + push_amt
inputs = self.get_coins
outputs = [PartialTxOutput.from_address_and_value(self.wallet.dummy_address(), funding_sat)]
diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py
@@ -444,7 +444,12 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
run_hook('transaction_dialog_update', self)
def update_io(self):
- self.inputs_header.setText(_("Inputs") + ' (%d)'%len(self.tx.inputs()))
+ inputs_header_text = _("Inputs") + ' (%d)'%len(self.tx.inputs())
+ if not self.finalized:
+ num_utxos = len(self.main_window.get_manually_selected_coins())
+ if num_utxos > 0:
+ inputs_header_text += f" - " + _("Coin selection active ({} UTXOs selected)").format(num_utxos)
+ self.inputs_header.setText(inputs_header_text)
ext = QTextCharFormat()
rec = QTextCharFormat()
rec.setBackground(QBrush(ColorScheme.GREEN.as_color(background=True)))
@@ -481,7 +486,7 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
addr = self.wallet.get_txin_address(txin)
if addr is None:
addr = ''
- #cursor.insertText(addr, text_format(addr))
+ cursor.insertText(addr, text_format(addr))
if isinstance(txin, PartialTxInput) and txin.value_sats() is not None:
cursor.insertText(format_amount(txin.value_sats()), ext)
cursor.insertBlock()
@@ -644,6 +649,7 @@ class PreviewTxDialog(BaseTxDialog, TxEditor):
self.feecontrol_fields = QWidget()
vbox_feecontrol = QVBoxLayout(self.feecontrol_fields)
vbox_feecontrol.setContentsMargins(0, 0, 0, 0)
+ vbox_feecontrol.addWidget(QLabel(_("Target fee:")))
vbox_feecontrol.addWidget(self.fee_adv_controls)
vbox_feecontrol.addWidget(self.fee_slider)