diff options
| author | Sander Ferdinand <sa.ferdinand@gmail.com> | 2018-04-28 02:54:12 +0200 |
|---|---|---|
| committer | Sander Ferdinand <sa.ferdinand@gmail.com> | 2018-05-03 12:35:53 +0200 |
| commit | dc1d5e9e0a1af6b8b3b9ce48a378e2b57a618a36 (patch) | |
| tree | 3e69a7d315e301a4642b5c936146aa8ad58d2132 | |
| parent | 9018ae3afe5f934c65a3e3c5be15e519ea4f5a92 (diff) | |
| download | monzero-gui-dc1d5e9e0a1af6b8b3b9ce48a378e2b57a618a36.tar.gz monzero-gui-dc1d5e9e0a1af6b8b3b9ce48a378e2b57a618a36.tar.xz monzero-gui-dc1d5e9e0a1af6b8b3b9ce48a378e2b57a618a36.zip | |
Check the 'to receive amount' with the transaction tracker
| -rw-r--r-- | pages/Receive.qml | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/pages/Receive.qml b/pages/Receive.qml index b89c636c..9ab742c9 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -48,13 +48,14 @@ Rectangle { property var model property var current_address property int current_subaddress_table_index: 0 + property alias receiveHeight: mainLayout.height property alias addressText : pageReceive.current_address function makeQRCodeString() { var s = "monero:" var nfields = 0 s += current_address; - var amount = amountLine.text.trim() + var amount = amountToReceiveLine.text.trim() if (amount !== "") { s += (nfields++ ? "&" : "?") s += "tx_amount=" + amount @@ -65,10 +66,12 @@ Rectangle { function update() { if (!appWindow.currentWallet || !trackingEnabled.checked) { trackingLineText.text = ""; + trackingModel.clear(); return } if (appWindow.currentWallet.connected() == Wallet.ConnectionStatus_Disconnected) { trackingLineText.text = qsTr("WARNING: no connection to daemon"); + trackingModel.clear(); return } @@ -121,22 +124,21 @@ Rectangle { return } else if(nTransactions === 1){ - trackingLineText.text = qsTr("Transaction found") + translationManager.emptyString; + trackingLineText.text = qsTr("Transaction found") + ":" + translationManager.emptyString; } else { - trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + translationManager.emptyString + trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + ":" + translationManager.emptyString } var max_tracking = 3; - - var expectedAmount = walletManager.amountFromString(amountLine.text) + toReceiveSatisfiedLine.text = ""; + var expectedAmount = walletManager.amountFromString(amountToReceiveLine.text) if (expectedAmount && expectedAmount != amount) { var displayTotalAmount = walletManager.displayAmount(totalAmount) - if (amount > expectedAmount) { - - text += qsTr(" with more money (%1)").arg(displayTotalAmount) + translationManager.emptyString - } else if (amount < expectedAmount) { - text += qsTr(" with not enough money (%1)").arg(displayTotalAmount) + translationManager.emptyString - } + if (amount > expectedAmount) toReceiveSatisfiedLine.text += qsTr("With more Monero"); + else if (amount < expectedAmount) toReceiveSatisfiedLine.text = qsTr("With not enough Monero") + toReceiveSatisfiedLine.text += ": " + "<br>" + + qsTr("Expected") + ": " + amountToReceiveLine.text + "<br>" + + qsTr("Total received") + ": " + displayTotalAmount + translationManager.emptyString; } trackingModel.clear(); @@ -434,7 +436,7 @@ Rectangle { Layout.maximumWidth: mainLayout.qrCodeSize LineEdit { - id: amountLine + id: amountToReceiveLine Layout.fillWidth: true labelText: qsTr("Amount") + translationManager.emptyString placeholderText: qsTr("Amount to receive") + translationManager.emptyString @@ -626,7 +628,6 @@ Rectangle { } anchors.right: parent.right - anchors.rightMargin: 4 anchors.top: undefined anchors.verticalCenter: parent.verticalCenter } @@ -635,9 +636,26 @@ Rectangle { } RowLayout { - Layout.topMargin: 32 * scaleRatio + visible: trackingTableRow.visible && x.text !== "" && amountToReceiveLine.text !== "" + Layout.topMargin: 14 * scaleRatio + Layout.fillWidth: true + Layout.preferredHeight: 40 * scaleRatio + + Label { + id: toReceiveSatisfiedLine + color: "white" + fontFamily: Style.fontLight.name + fontSize: 14 * scaleRatio + textFormat: Text.RichText + text: "" + height: 40 * scaleRatio + } + } + + RowLayout { Layout.fillWidth: true Layout.minimumWidth: 200 + Layout.topMargin: trackingTableRow.visible ? 20 * scaleRatio : 32 * scaleRatio CheckBox { id: trackingEnabled @@ -695,5 +713,7 @@ Rectangle { function onPageClosed() { timer.running = false + trackingEnabled.checked = false + trackingModel.clear() } } |
