rename ConfirmPaymentDialog to ConfirmTxDialog
generalize/parameterize some labels and inject TxFinalizer instead of encapsulate
This commit is contained in:
@@ -10,15 +10,22 @@ import "controls"
|
|||||||
Dialog {
|
Dialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
property alias address: finalizer.address
|
required property QtObject finalizer
|
||||||
property alias satoshis: finalizer.amount
|
required property Amount satoshis
|
||||||
|
property string address
|
||||||
property string message
|
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
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
title: qsTr('Confirm Payment')
|
|
||||||
|
|
||||||
modal: true
|
modal: true
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
Overlay.modal: Rectangle {
|
Overlay.modal: Rectangle {
|
||||||
@@ -39,6 +46,7 @@ Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
id: amountLabel
|
||||||
text: qsTr('Amount to send')
|
text: qsTr('Amount to send')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,6 +210,7 @@ Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
id: sendButton
|
||||||
text: qsTr('Pay')
|
text: qsTr('Pay')
|
||||||
enabled: finalizer.valid
|
enabled: finalizer.valid
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -212,9 +221,4 @@ Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TxFinalizer {
|
|
||||||
id: finalizer
|
|
||||||
wallet: Daemon.currentWallet
|
|
||||||
onAmountChanged: console.log(amount.satsInt)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,13 @@ Pane {
|
|||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: confirmPaymentDialog
|
id: confirmPaymentDialog
|
||||||
ConfirmPaymentDialog {}
|
ConfirmTxDialog {
|
||||||
|
title: qsTr('Confirm Payment')
|
||||||
|
finalizer: TxFinalizer {
|
||||||
|
wallet: Daemon.currentWallet
|
||||||
|
onAmountChanged: console.log(amount.satsInt)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|||||||
Reference in New Issue
Block a user