transfer: paste Payment URL to fill the payment form fields

This commit is contained in:
xiphon
2018-11-30 03:51:03 +00:00
parent 45781ab4a1
commit 02134c4fc6
6 changed files with 75 additions and 18 deletions

View File

@@ -215,6 +215,18 @@ Rectangle {
wrapMode: Text.WrapAnywhere
addressValidation: true
onInputLabelLinkActivated: { appWindow.showPageRequest("AddressBook") }
pasteButton: true
onPaste: function(clipboardText) {
const parsed = walletManager.parse_uri_to_object(clipboardText);
if (!parsed.error) {
addressLine.text = parsed.address;
paymentIdLine.text = parsed.payment_id;
amountLine.text = parsed.amount;
descriptionLine.text = parsed.tx_description;
} else {
addressLine.text = clipboardText;
}
}
}
StandardButton {