aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsentry.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-07-26 13:08:34 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-07-26 13:08:34 +0200
commit587e52855a4c6c4f672ecec28ab9a029d4e4f850 (patch)
treeb8fb9c4bf66d6af8643a779f142df2ccceb90950 /src/qt/sendcoinsentry.cpp
parentca1dbe10ed3c8cf253ee79e71d4f76363daae17b (diff)
downloadbitcoin-587e52855a4c6c4f672ecec28ab9a029d4e4f850.tar.xz
allow multiple units in bitcoin amount widget (for example, for sending) using a combobox
Diffstat (limited to 'src/qt/sendcoinsentry.cpp')
-rw-r--r--src/qt/sendcoinsentry.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index 9fc041111f..f3847f1693 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -87,6 +87,16 @@ bool SendCoinsEntry::validate()
{
retval = false;
}
+ else
+ {
+ if(ui->payAmount->value() <= 0)
+ {
+ // Cannot send 0 coins or less
+ ui->payAmount->setValid(false);
+ retval = false;
+ }
+ }
+
if(!ui->payTo->hasAcceptableInput() ||
(model && !model->validateAddress(ui->payTo->text())))
@@ -104,7 +114,7 @@ SendCoinsRecipient SendCoinsEntry::getValue()
rv.address = ui->payTo->text();
rv.label = ui->addAsLabel->text();
- BitcoinUnits::parse(BitcoinUnits::BTC, ui->payAmount->text(), &rv.amount);
+ rv.amount = ui->payAmount->value();
return rv;
}