From 2d980b6951088c46ac097944a73c836fdb6e70b6 Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Tue, 11 Oct 2016 23:02:21 +0200 Subject: [PATCH] validation on send - unlocked balance --- main.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.qml b/main.qml index a4a91a50..0f937859 100644 --- a/main.qml +++ b/main.qml @@ -326,6 +326,7 @@ ApplicationWindow { // validate amount; var amountxmr = walletManager.amountFromString(amount); console.log("integer amount: ", amountxmr); + console.log("integer unlocked",currentWallet.unlockedBalance) if (amountxmr <= 0) { informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2") @@ -333,6 +334,16 @@ ApplicationWindow { .arg(walletManager.maximumAllowedAmountAsSting()) + translationManager.emptyString + informationPopup.icon = StandardIcon.Critical + informationPopup.onCloseCallback = null + informationPopup.open() + return; + } else if (amountxmr > currentWallet.unlockedBalance) { + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("insufficient funds. Unlocked balance: %1") + .arg(walletManager.displayAmount(currentWallet.unlockedBalance)) + + translationManager.emptyString + informationPopup.icon = StandardIcon.Critical informationPopup.onCloseCallback = null informationPopup.open()