From 8807a428ed5888b2cc03eab5054e2adce1495e89 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Wed, 1 Jun 2022 13:06:59 +0200 Subject: [PATCH] rename ConfirmPaymentDialog to ConfirmTxDialog generalize/parameterize some labels and inject TxFinalizer instead of encapsulate --- ...mPaymentDialog.qml => ConfirmTxDialog.qml} | 22 +++++++++++-------- electrum/gui/qml/components/Send.qml | 8 ++++++- 2 files changed, 20 insertions(+), 10 deletions(-) rename electrum/gui/qml/components/{ConfirmPaymentDialog.qml => ConfirmTxDialog.qml} (91%) diff --git a/electrum/gui/qml/components/ConfirmPaymentDialog.qml b/electrum/gui/qml/components/ConfirmTxDialog.qml similarity index 91% rename from electrum/gui/qml/components/ConfirmPaymentDialog.qml rename to electrum/gui/qml/components/ConfirmTxDialog.qml index a0f04cd2b..3e2ef3161 100644 --- a/electrum/gui/qml/components/ConfirmPaymentDialog.qml +++ b/electrum/gui/qml/components/ConfirmTxDialog.qml @@ -10,15 +10,22 @@ import "controls" Dialog { id: dialog - property alias address: finalizer.address - property alias satoshis: finalizer.amount + required property QtObject finalizer + required property Amount satoshis + property string address property string message + property alias amountLabelText: amountLabel.text + property alias sendButtonText: sendButton.text + + title: qsTr('Confirm Transaction') + + // copy these to finalizer + onAddressChanged: finalizer.address = address + onSatoshisChanged: finalizer.amount = satoshis width: parent.width height: parent.height - title: qsTr('Confirm Payment') - modal: true parent: Overlay.overlay Overlay.modal: Rectangle { @@ -39,6 +46,7 @@ Dialog { } Label { + id: amountLabel text: qsTr('Amount to send') } @@ -202,6 +210,7 @@ Dialog { } Button { + id: sendButton text: qsTr('Pay') enabled: finalizer.valid onClicked: { @@ -212,9 +221,4 @@ Dialog { } } - TxFinalizer { - id: finalizer - wallet: Daemon.currentWallet - onAmountChanged: console.log(amount.satsInt) - } } diff --git a/electrum/gui/qml/components/Send.qml b/electrum/gui/qml/components/Send.qml index 06d614617..495656a58 100644 --- a/electrum/gui/qml/components/Send.qml +++ b/electrum/gui/qml/components/Send.qml @@ -217,7 +217,13 @@ Pane { Component { id: confirmPaymentDialog - ConfirmPaymentDialog {} + ConfirmTxDialog { + title: qsTr('Confirm Payment') + finalizer: TxFinalizer { + wallet: Daemon.currentWallet + onAmountChanged: console.log(amount.satsInt) + } + } } Component {