diff options
| author | cryptochangements34 <bevanoffr@gmail.com> | 2018-05-11 18:56:04 -0400 |
|---|---|---|
| committer | cryptochangements34 <bevanoffr@gmail.com> | 2018-05-11 18:56:04 -0400 |
| commit | d003b255b96671346b741072265212cd8af15ddd (patch) | |
| tree | 46a9001d03c6be73d6945e170ccbc7e195a9eaad | |
| parent | a7e99dc08a8d9133616a368a6359d3eeccc76d35 (diff) | |
| download | monzero-gui-d003b255b96671346b741072265212cd8af15ddd.tar.gz monzero-gui-d003b255b96671346b741072265212cd8af15ddd.tar.xz monzero-gui-d003b255b96671346b741072265212cd8af15ddd.zip | |
use regex for value input
| -rw-r--r-- | pages/Receive.qml | 10 | ||||
| -rw-r--r-- | pages/Transfer.qml | 8 |
2 files changed, 5 insertions, 13 deletions
diff --git a/pages/Receive.qml b/pages/Receive.qml index f5cac4a9..52ac373e 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -57,7 +57,7 @@ Rectangle { var nfields = 0 s += current_address; var amount = amountToReceiveLine.text.trim() - if (amount !== "") { + if (amount !== "" && amount.slice(-1) !== ".") { s += (nfields++ ? "&" : "?") s += "tx_amount=" + amount } @@ -456,12 +456,8 @@ Rectangle { 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" + validator: RegExpValidator { + regExp: /(\d{1,8})([.]\d{1,12})?$/ } } } diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 8a029deb..38100a5b 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -193,12 +193,8 @@ Rectangle { inlineButtonText: qsTr("All") + translationManager.emptyString inlineButton.onClicked: amountLine.text = "(all)" - validator: DoubleValidator { - bottom: 0.0 - top: 18446744.073709551615 - decimals: 12 - notation: DoubleValidator.StandardNotation - locale: "C" + validator: RegExpValidator { + regExp: /(\d{1,8})([.]\d{1,12})?$/ } } } |
