aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Ferdinand <sa.ferdinand@gmail.com>2018-03-31 03:16:35 +0200
committerSander Ferdinand <sa.ferdinand@gmail.com>2018-03-31 03:16:35 +0200
commit90818efe5e04fd2ed9788d9e52943419acb0f2a8 (patch)
tree7ae1f88c6a40d496eb71a37c27d8bde5f45cb017
parent959c2fcc32d515f90cb39933689a37418197a095 (diff)
downloadmonzero-gui-90818efe5e04fd2ed9788d9e52943419acb0f2a8.tar.gz
monzero-gui-90818efe5e04fd2ed9788d9e52943419acb0f2a8.tar.xz
monzero-gui-90818efe5e04fd2ed9788d9e52943419acb0f2a8.zip
Disable send button when there is an insufficient unlocked balance
-rw-r--r--pages/Transfer.qml27
1 files changed, 22 insertions, 5 deletions
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index db46f04d..01c0b1b1 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -332,12 +332,29 @@ Rectangle {
rightIcon: "../images/rightIcon.png"
Layout.topMargin: 4 * scaleRatio
text: qsTr("Send") + translationManager.emptyString
+ // Send button is enabled when:
enabled : {
- // Send button is enabled when:
- // 1) Currently opened wallet is not view-only
- // 2) There is no warning box displayed
- // 3) The transactional information is correct
- return !appWindow.viewOnly && warningText.text === '' && pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype);
+ // Currently opened wallet is not view-only
+ if(appWindow.viewOnly){
+ return false;
+ }
+
+ // There is no warning box displayed
+ if(warningText.text !== ''){
+ return false;
+ }
+
+ // The transactional information is correct
+ if(!pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype)){
+ return false;
+ }
+
+ // There are sufficient unlocked funds available
+ if(parseInt(amountLine.text) > parseInt(unlockedBalanceText)){
+ return false;
+ }
+
+ return true;
}
onClicked: {
console.log("Transfer: paymentClicked")