qml: add option to open ReceiveDialog with existing request key
This commit is contained in:
@@ -13,6 +13,8 @@ ElDialog {
|
|||||||
|
|
||||||
title: qsTr('Receive Payment')
|
title: qsTr('Receive Payment')
|
||||||
|
|
||||||
|
property string key
|
||||||
|
|
||||||
property string _bolt11: request.bolt11
|
property string _bolt11: request.bolt11
|
||||||
property string _bip21uri: request.bip21
|
property string _bip21uri: request.bip21
|
||||||
property string _address: request.address
|
property string _address: request.address
|
||||||
@@ -441,8 +443,12 @@ ElDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// callLater to make sure any popups are on top of the dialog stacking order
|
if (dialog.key) {
|
||||||
Qt.callLater(createDefaultRequest)
|
request.key = dialog.key
|
||||||
|
} else {
|
||||||
|
// callLater to make sure any popups are on top of the dialog stacking order
|
||||||
|
Qt.callLater(createDefaultRequest)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack. delay qr rendering until dialog is shown
|
// hack. delay qr rendering until dialog is shown
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import QtQuick.Controls.Material 2.0
|
|||||||
import QtQml.Models 2.1
|
import QtQml.Models 2.1
|
||||||
import QtQml 2.6
|
import QtQml 2.6
|
||||||
|
|
||||||
|
import org.electrum 1.0
|
||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Pane {
|
Pane {
|
||||||
@@ -35,10 +37,10 @@ Pane {
|
|||||||
model: Daemon.currentWallet.requestModel
|
model: Daemon.currentWallet.requestModel
|
||||||
delegate: InvoiceDelegate {
|
delegate: InvoiceDelegate {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
//var dialog = app.stack.getRoot().openInvoice(model.key)
|
// TODO: only open unpaid?
|
||||||
// dialog.invoiceAmountChanged.connect(function () {
|
if (model.status == Invoice.Unpaid) {
|
||||||
// Daemon.currentWallet.invoiceModel.init_model()
|
app.stack.getRoot().openRequest(model.key)
|
||||||
// })
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ Item {
|
|||||||
return dialog
|
return dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openRequest(key) {
|
||||||
|
var dialog = receiveDialog.createObject(app, { key: key })
|
||||||
|
dialog.open()
|
||||||
|
return dialog
|
||||||
|
}
|
||||||
|
|
||||||
function openSendDialog() {
|
function openSendDialog() {
|
||||||
_sendDialog = sendDialog.createObject(mainView, {invoiceParser: invoiceParser})
|
_sendDialog = sendDialog.createObject(mainView, {invoiceParser: invoiceParser})
|
||||||
_sendDialog.open()
|
_sendDialog.open()
|
||||||
|
|||||||
Reference in New Issue
Block a user