From 929eb9dc6cc65d1ff47ff21dcb9fa5974a9278ee Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 30 Jun 2011 17:32:19 +0200 Subject: [PATCH] show an error if amount is not valid (either the amount or decimals is empty) --- src/qt/bitcoinamountfield.cpp | 2 ++ src/qt/sendcoinsdialog.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 8166ce6e6ec..a4cbbe0a7eb 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -49,6 +49,8 @@ void BitcoinAmountField::setText(const QString &text) QString BitcoinAmountField::text() const { + if(amount->text().isEmpty() || decimals->text().isEmpty()) + return QString(); return amount->text() + QString(".") + decimals->text(); } diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 33d9a25477c..d83962d1bd9 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -48,10 +48,10 @@ void SendCoinsDialog::on_sendButton_clicked() valid = GUIUtil::parseMoney(payAmount, &payAmountParsed); - if(!valid) + if(!valid || payAmount.isEmpty()) { QMessageBox::warning(this, tr("Send Coins"), - tr("The amount to pay must be a valid number."), + tr("Must fill in an amount to pay."), QMessageBox::Ok, QMessageBox::Ok); return; }