From 5a1952f7ac5a8b3faed076494067ea638f2bd810 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand This is a simple sales tracker: Let your customer scan that QR code to make a payment (if that customer has software which " +
- "supports QR code scanning). This page will automatically scan the blockchain and the tx pool " +
- "for incoming transactions using this QR code. If you input an amount, it will also check " +
- "that incoming transactions total up to that amount.
This QR code includes the address you selected above and" + + "the amount you entered below. Share it with others (right-click->Save) " + + "so they can more easily send you exact amounts.
" + ) + trackingHowToUseDialog.icon = StandardIcon.Information + trackingHowToUseDialog.open() + } + } + + ColumnLayout { + id: amountRow + + Layout.fillWidth: true + Layout.minimumWidth: 200 + + LineEdit { + id: amountLine + Layout.fillWidth: true + labelText: qsTr("Amount") + translationManager.emptyString + placeholderText: qsTr("Amount to receive") + translationManager.emptyString + fontBold: true + inlineIcon: true + validator: DoubleValidator { + bottom: 0.0 + top: 18446744.073709551615 + decimals: 12 + notation: DoubleValidator.StandardNotation + locale: "C" + } + } + } + + Rectangle { + color: "white" + Layout.topMargin: parent.spacing + Layout.fillWidth: true + Layout.maximumWidth: mainLayout.qrCodeSize + Layout.preferredHeight: width + radius: 4 + + Image { + id: qrCode + anchors.fill: parent + anchors.margins: 6 + + smooth: false + fillMode: Image.PreserveAspectFit + source: "image://qrcode/" + makeQRCodeString() + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: { + if (mouse.button == Qt.RightButton) + qrMenu.open() + } + onPressAndHold: qrFileDialog.open() + } + } + + Menu { + id: qrMenu + title: "QrCode" + y: parent.height / 2 + + MenuItem { + text: qsTr("Save As") + translationManager.emptyString; + onTriggered: qrFileDialog.open() + } + } } } - CheckBox { - id: trackingEnabled - text: qsTr("Enable") + translationManager.emptyString - } - - TextEdit { - id: trackingLine - readOnly: true - width: mainLayout.editWidth + ColumnLayout { + id: trackingRow + Layout.alignment: Qt.AlignTop Layout.fillWidth: true - textFormat: Text.RichText - text: "" - selectByMouse: true - color: 'white' + spacing: 32 * scaleRatio + + LabelSubheader { + Layout.fillWidth: true + textFormat: Text.RichText + text: "" + + qsTr("Tracking") + + " " + + qsTr("Help") + "" + + translationManager.emptyString + onLinkActivated: { + trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString; + trackingHowToUseDialog.text = qsTr( + "This is a simple sales tracker:
" + + "Let your customer scan that QR code to make a payment (if that customer has software which " + + "supports QR code scanning).
" + + "This page will automatically scan the blockchain and the tx pool " + + "for incoming transactions using this QR code. If you input an amount, it will also check " + + "that incoming transactions total up to that amount.
" + + "It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " + + "confirmed in short order, but there is still a possibility they might not, so for larger " + + "values you may want to wait for one or more confirmation(s)." + ) + trackingHowToUseDialog.icon = StandardIcon.Information + trackingHowToUseDialog.open() + } + } + + RowLayout { + Layout.fillWidth: true + Layout.minimumWidth: 200 + + CheckBox { + id: trackingEnabled + text: qsTr("Enable") + translationManager.emptyString + } + } + + RowLayout { + Layout.fillWidth: true + Layout.minimumWidth: 200 + + TextEdit { + id: trackingLine + readOnly: true + Layout.fillWidth: true + textFormat: Text.RichText + text: "" + selectByMouse: true + color: 'white' + } + } } } @@ -352,46 +432,17 @@ Rectangle { title: "Please choose a name" folder: shortcuts.pictures selectExisting: false - nameFilters: [ "Image (*.png)"] + nameFilters: ["Image (*.png)"] onAccepted: { - if( ! walletManager.saveQrCode(makeQRCodeString(), walletManager.urlToLocalPath(fileUrl))) { + if(!walletManager.saveQrCode(makeQRCodeString(), walletManager.urlToLocalPath(fileUrl))) { console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) ) - trackingHowToUseDialog.title = qsTr("Save QrCode") + translationManager.emptyString; + trackingHowToUseDialog.title = qsTr("Save QrCode") + translationManager.emptyString; trackingHowToUseDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString; trackingHowToUseDialog.icon = StandardIcon.Error trackingHowToUseDialog.open() } } } - ColumnLayout { - Menu { - id: qrMenu - title: "QrCode" - MenuItem { - text: qsTr("Save As") + translationManager.emptyString; - onTriggered: qrFileDialog.open() - } - } - - Image { - id: qrCode - anchors.margins: 50 * scaleRatio - Layout.fillWidth: true - Layout.minimumHeight: mainLayout.qrCodeSize - smooth: false - fillMode: Image.PreserveAspectFit - source: "image://qrcode/" + makeQRCodeString() - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onClicked: { - if (mouse.button == Qt.RightButton) - qrMenu.popup() - } - onPressAndHold: qrFileDialog.open() - } - } - } } Timer {