ui->setupUi(this);
GUIUtil::setupAddressWidget(ui->payTo, this);
- GUIUtil::setupAmountWidget(ui->payAmount, this);
- /* Set initial address if provided */
+ // Set initial send-to address if provided
if(!address.isEmpty())
{
ui->payTo->setText(address);
{
bool valid;
QString payAmount = ui->payAmount->text();
+ QString label;
qint64 payAmountParsed;
valid = ParseMoney(payAmount.toStdString(), payAmountParsed);
return;
}
- switch(model->sendCoins(ui->payTo->text(), payAmountParsed))
+ if(ui->addToAddressBook->isChecked())
+ {
+ // Add address to address book under label, if specified
+ label = ui->addAsLabel->text();
+ }
+
+ switch(model->sendCoins(ui->payTo->text(), payAmountParsed, label))
{
case ClientModel::InvalidAddress:
QMessageBox::warning(this, tr("Send Coins"),
void SendCoinsDialog::on_pasteButton_clicked()
{
- /* Paste text from clipboard into recipient field */
+ // Paste text from clipboard into recipient field
ui->payTo->setText(QApplication::clipboard()->text());
}
void SendCoinsDialog::on_addressBookButton_clicked()
{
- AddressBookDialog dlg;
+ AddressBookDialog dlg(AddressBookDialog::ForSending);
dlg.setModel(model->getAddressTableModel());
dlg.setTab(AddressBookDialog::SendingTab);
dlg.exec();
{
reject();
}
+
+void SendCoinsDialog::on_addToAddressBook_toggled(bool checked)
+{
+ ui->addAsLabel->setEnabled(checked);
+}