Mercurial > hg > bitcoin
changeset 1207:81614a118931 draft
Merge pull request #9 from celil-kj/master
allow decimals such as .05 for amount of bitcoins to send
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Sat, 23 Jul 2011 17:34:32 -0700 |
parents | 5b1a1eeed2bb (current diff) a80ee00d5097 (diff) |
children | 6f01ff08874f |
files | bitcoin-qt.pro src/qt/bitcoinamountfield.cpp |
diffstat | 1 files changed, 2 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -11,7 +11,7 @@ QWidget(parent), amount(0), decimals(0) { amount = new QValidatedLineEdit(this); - amount->setValidator(new QRegExpValidator(QRegExp("[0-9]+"), this)); + amount->setValidator(new QRegExpValidator(QRegExp("[0-9]?"), this)); amount->setAlignment(Qt::AlignRight|Qt::AlignVCenter); amount->installEventFilter(this); amount->setMaximumWidth(100); @@ -64,11 +64,6 @@ bool BitcoinAmountField::validate() { bool valid = true; - if(amount->text().isEmpty()) - { - amount->setValid(false); - valid = false; - } if(decimals->text().isEmpty()) { decimals->setValid(false); @@ -79,7 +74,7 @@ QString BitcoinAmountField::text() const { - if(amount->text().isEmpty() || decimals->text().isEmpty()) + if(decimals->text().isEmpty()) { return QString(); }