diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-11-24 12:37:53 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-11-24 12:37:53 +0200 |
| commit | cb3285e55312d4d0a4a0db1919e6945c3290578f (patch) | |
| tree | 6fd3350edfbc5e047eda6e5c49bfa4e1fff1b7ff /pages | |
| parent | 5afd11b7fe21f49919dd55a24658dcae8272b468 (diff) | |
| parent | 96c7ddeea8e590726ef3c28faead8205bb45ac41 (diff) | |
| download | monzero-gui-cb3285e55312d4d0a4a0db1919e6945c3290578f.tar.gz monzero-gui-cb3285e55312d4d0a4a0db1919e6945c3290578f.tar.xz monzero-gui-cb3285e55312d4d0a4a0db1919e6945c3290578f.zip | |
Merge pull request #192
96c7dde Add QR code display on the receive page (moneromooo.monero)
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/Receive.qml | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pages/Receive.qml b/pages/Receive.qml index b4730293..ce3d2320 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -56,6 +56,23 @@ Rectangle { integratedAddressLine.text = qsTr("Invalid payment ID") } + function makeQRCodeString() { + var s = "monero:" + var nfields = 0 + s += addressLine.text + var amount = amountLine.text.trim() + if (amount !== "") { + s += (nfields++ ? "&" : "?") + s += "tx_amount=" + amount + } + var pid = paymentIdLine.text.trim() + if (pid !== "") { + s += (nfields++ ? "&" : "?") + s += "tx_payment_id=" + pid + } + return s + } + Clipboard { id: clipboard } @@ -71,6 +88,7 @@ Rectangle { property int labelWidth: 120 property int editWidth: 400 property int lineEditFontSize: 12 + property int qrCodeSize: 240 RowLayout { @@ -183,6 +201,43 @@ Rectangle { } } + RowLayout { + id: amountRow + Label { + id: amountLabel + fontSize: 14 + text: qsTr("Amount") + translationManager.emptyString + width: mainLayout.labelWidth + } + + + LineEdit { + id: amountLine + fontSize: mainLayout.lineEditFontSize + placeholderText: qsTr("Amount") + translationManager.emptyString + readOnly: false + width: mainLayout.editWidth + Layout.fillWidth: true + validator: DoubleValidator { + bottom: 0.0 + top: 18446744.073709551615 + decimals: 12 + notation: DoubleValidator.StandardNotation + locale: "C" + } + } + } + + Image { + id: qrCode + anchors.margins: 50 + anchors.top: amountRow.bottom + Layout.fillWidth: true + Layout.minimumHeight: mainLayout.qrCodeSize + smooth: false + fillMode: Image.PreserveAspectFit + source: "image://qrcode/" + makeQRCodeString() + } } function onPageCompleted() { |
