aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoinamountfield.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-07-23 17:34:32 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2011-07-24 02:41:19 +0200
commit1a925b8e60e4d5cf0876c9f94a2564dad7f09eb1 (patch)
tree1d71f3c2f62c2a346b1006456af2c6b503ce49ad /src/qt/bitcoinamountfield.cpp
parent7beada58cd24b1e1121d038bbb61436ebc782770 (diff)
parent2eac3a6decf3353e5db8a8b07f3307d04e77d329 (diff)
Merge pull request #9 from celil-kj/master
allow decimals such as .05 for amount of bitcoins to send
Diffstat (limited to 'src/qt/bitcoinamountfield.cpp')
-rw-r--r--src/qt/bitcoinamountfield.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp
index f9df91b333..b312b9792e 100644
--- a/src/qt/bitcoinamountfield.cpp
+++ b/src/qt/bitcoinamountfield.cpp
@@ -11,7 +11,7 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent):
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 @@ void BitcoinAmountField::clear()
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 @@ bool BitcoinAmountField::validate()
QString BitcoinAmountField::text() const
{
- if(amount->text().isEmpty() || decimals->text().isEmpty())
+ if(decimals->text().isEmpty())
{
return QString();
}