1
0

add a QEAmount type for storing/passing BTC amounts in the widest sense

from a UI perspective. Stores sats, millisats (LN), whether MAX amount is
requested etc

some refactor QEInvoice type and Send page
This commit is contained in:
Sander van Grieken
2022-04-25 15:55:34 +02:00
parent cd4bd39583
commit 5031391484
10 changed files with 184 additions and 48 deletions

View File

@@ -11,6 +11,7 @@ Dialog {
id: dialog
property Invoice invoice
property string invoice_key
width: parent.width
height: parent.height
@@ -84,9 +85,20 @@ Dialog {
}
}
Label {
text: qsTr('Expiration')
visible: true
}
Label {
id: expiration
text: invoice.time + invoice.expiration
}
RowLayout {
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.fillHeight: true
spacing: constants.paddingMedium
Button {
@@ -115,4 +127,9 @@ Dialog {
}
Component.onCompleted: {
if (invoice_key != '') {
invoice.initFromKey(invoice_key)
}
}
}

View File

@@ -213,7 +213,12 @@ Pane {
model: DelegateModel {
id: delegateModel
model: Daemon.currentWallet.invoiceModel
delegate: InvoiceDelegate {}
delegate: InvoiceDelegate {
onClicked: {
var dialog = confirmInvoiceDialog.createObject(app, {'invoice' : invoice, 'invoice_key': model.key})
dialog.open()
}
}
}
remove: Transition {
@@ -288,9 +293,7 @@ Pane {
// and maybe store invoice if expiry allows
}
}
onInvoiceTypeChanged: {
if (invoiceType == Invoice.Invalid)
return
onValidationSuccess: {
// address only -> fill form fields
// else -> show invoice confirmation dialog
if (invoiceType == Invoice.OnchainOnlyAddress)