aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsentry.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-10-11 14:22:43 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-10-11 14:22:43 +0200
commit057bf35bc5c9e1fa3baaef41435984fc46516880 (patch)
treee97f2bd5039c61f8570c40235195b5d7551bf983 /src/qt/sendcoinsentry.cpp
parent56c0ba7a0f893c71eb871b95f36c18e37407bf00 (diff)
downloadbitcoin-057bf35bc5c9e1fa3baaef41435984fc46516880.tar.xz
sendcoinsentry: small clear() and setValue() changes
- clear(): clear all UI elements (for secure and insecure payments) - setValue(): only modify UI elements, which need to be set (for secure or insecure payments)
Diffstat (limited to 'src/qt/sendcoinsentry.cpp')
-rw-r--r--src/qt/sendcoinsentry.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index ee84f7bc11..59724c94f4 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -85,10 +85,17 @@ void SendCoinsEntry::setRemoveEnabled(bool enabled)
void SendCoinsEntry::clear()
{
+ // clear UI elements for insecure payments
ui->payTo->clear();
ui->addAsLabel->clear();
ui->payAmount->clear();
+ // and the ones for secure payments just to be sure
+ ui->payTo_s->clear();
+ ui->memoTextLabel_s->clear();
+ ui->payAmount_s->clear();
+
ui->payTo->setFocus();
+
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
@@ -154,17 +161,19 @@ void SendCoinsEntry::setValue(const SendCoinsRecipient &value)
{
recipient = value;
- ui->payTo->setText(value.address);
- ui->addAsLabel->setText(value.label);
- ui->payAmount->setValue(value.amount);
-
- if (!recipient.authenticatedMerchant.isEmpty())
+ if (recipient.authenticatedMerchant.isEmpty())
+ {
+ ui->payTo->setText(recipient.address);
+ ui->addAsLabel->setText(recipient.label);
+ ui->payAmount->setValue(recipient.amount);
+ }
+ else
{
- const payments::PaymentDetails& details = value.paymentRequest.getDetails();
+ const payments::PaymentDetails& details = recipient.paymentRequest.getDetails();
- ui->payTo_s->setText(value.authenticatedMerchant);
+ ui->payTo_s->setText(recipient.authenticatedMerchant);
ui->memoTextLabel_s->setText(QString::fromStdString(details.memo()));
- ui->payAmount_s->setValue(value.amount);
+ ui->payAmount_s->setValue(recipient.amount);
setCurrentWidget(ui->SendCoinsSecure);
}
}