Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsentry.cpp
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | void SendCoinsEntry::setValue(const SendCoinsRecipient &value) { | ||||
recipient = value; | recipient = value; | ||||
if (recipient.paymentRequest.IsInitialized()) // payment request | if (recipient.paymentRequest.IsInitialized()) // payment request | ||||
{ | { | ||||
if (recipient.authenticatedMerchant.isEmpty()) // unauthenticated | if (recipient.authenticatedMerchant.isEmpty()) // unauthenticated | ||||
{ | { | ||||
ui->payTo_is->setText(recipient.address); | ui->payTo_is->setText(recipient.address); | ||||
ui->memoTextLabel_is->setText(recipient.message); | ui->memoTextLabel_is->setText(recipient.message); | ||||
ui->payAmount_is->setValue(recipient.amount); | ui->payAmount_is->setValue((qint64)recipient.amount); | ||||
ui->payAmount_is->setReadOnly(true); | ui->payAmount_is->setReadOnly(true); | ||||
setCurrentWidget(ui->SendCoins_UnauthenticatedPaymentRequest); | setCurrentWidget(ui->SendCoins_UnauthenticatedPaymentRequest); | ||||
} else // authenticated | } else // authenticated | ||||
{ | { | ||||
ui->payTo_s->setText(recipient.authenticatedMerchant); | ui->payTo_s->setText(recipient.authenticatedMerchant); | ||||
ui->memoTextLabel_s->setText(recipient.message); | ui->memoTextLabel_s->setText(recipient.message); | ||||
ui->payAmount_s->setValue(recipient.amount); | ui->payAmount_s->setValue((qint64)recipient.amount); | ||||
ui->payAmount_s->setReadOnly(true); | ui->payAmount_s->setReadOnly(true); | ||||
setCurrentWidget(ui->SendCoins_AuthenticatedPaymentRequest); | setCurrentWidget(ui->SendCoins_AuthenticatedPaymentRequest); | ||||
} | } | ||||
} else // normal payment | } else // normal payment | ||||
{ | { | ||||
// message | // message | ||||
ui->messageTextLabel->setText(recipient.message); | ui->messageTextLabel->setText(recipient.message); | ||||
ui->messageTextLabel->setVisible(!recipient.message.isEmpty()); | ui->messageTextLabel->setVisible(!recipient.message.isEmpty()); | ||||
ui->messageLabel->setVisible(!recipient.message.isEmpty()); | ui->messageLabel->setVisible(!recipient.message.isEmpty()); | ||||
ui->addAsLabel->clear(); | ui->addAsLabel->clear(); | ||||
ui->payTo->setText( | ui->payTo->setText( | ||||
recipient.address); // this may set a label from addressbook | recipient.address); // this may set a label from addressbook | ||||
if (!recipient.label.isEmpty()) // if a label had been set from the | if (!recipient.label.isEmpty()) // if a label had been set from the | ||||
// addressbook, don't overwrite with an | // addressbook, don't overwrite with an | ||||
// empty label | // empty label | ||||
ui->addAsLabel->setText(recipient.label); | ui->addAsLabel->setText(recipient.label); | ||||
ui->payAmount->setValue(recipient.amount); | ui->payAmount->setValue((qint64)recipient.amount); | ||||
} | } | ||||
} | } | ||||
void SendCoinsEntry::setAddress(const QString &address) { | void SendCoinsEntry::setAddress(const QString &address) { | ||||
ui->payTo->setText(address); | ui->payTo->setText(address); | ||||
ui->payAmount->setFocus(); | ui->payAmount->setFocus(); | ||||
} | } | ||||
Show All 34 Lines |