aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsentry.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-07-23 18:02:19 +0200
committerWladimir J. van der Laan <[email protected]>2014-07-23 18:02:28 +0200
commit7bf8ab9dd3efb7ebc685e4ac02b05e6d5eba107d (patch)
tree4cf2d1d0411ab8c558a4980b02b44840de2c4e30 /src/qt/sendcoinsentry.cpp
parentMerge pull request #4571 (diff)
parentui: Make sure sendcoinsentry signals only connected once (diff)
downloaddiscoin-7bf8ab9dd3efb7ebc685e4ac02b05e6d5eba107d.tar.xz
discoin-7bf8ab9dd3efb7ebc685e4ac02b05e6d5eba107d.zip
Merge pull request #4556
29eaa31 ui: Make sure sendcoinsentry signals only connected once (Wladimir J. van der Laan) 2a05101 qt: Remove unused functions from BitcoinUnits (Wladimir J. van der Laan) 91cce17 qt: Use fixed-point arithmetic in amount spinbox (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/sendcoinsentry.cpp')
-rw-r--r--src/qt/sendcoinsentry.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index e0f56f8cd..52545c385 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -34,6 +34,12 @@ SendCoinsEntry::SendCoinsEntry(QWidget *parent) :
GUIUtil::setupAddressWidget(ui->payTo, this);
// just a label for displaying bitcoin address(es)
ui->payTo_is->setFont(GUIUtil::bitcoinAddressFont());
+
+ // Connect signals
+ connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged()));
+ connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
+ connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked()));
+ connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked()));
}
SendCoinsEntry::~SendCoinsEntry()
@@ -72,11 +78,6 @@ void SendCoinsEntry::setModel(WalletModel *model)
if (model && model->getOptionsModel())
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
- connect(ui->payAmount, SIGNAL(textChanged()), this, SIGNAL(payAmountChanged()));
- connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
- connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked()));
- connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked()));
-
clear();
}
@@ -130,6 +131,13 @@ bool SendCoinsEntry::validate()
retval = false;
}
+ // Sending a zero amount is invalid
+ if (ui->payAmount->value(0) <= 0)
+ {
+ ui->payAmount->setValid(false);
+ retval = false;
+ }
+
// Reject dust outputs:
if (retval && GUIUtil::isDust(ui->payTo->text(), ui->payAmount->value())) {
ui->payAmount->setValid(false);