allow adding address to address book in send dialog

This commit is contained in:
Wladimir J. van der Laan
2011-06-25 19:32:36 +02:00
parent c88e14fe26
commit 38deedc1b5
5 changed files with 47 additions and 7 deletions

View File

@@ -46,6 +46,7 @@ void SendCoinsDialog::on_sendButton_clicked()
{
bool valid;
QString payAmount = ui->payAmount->text();
QString label;
qint64 payAmountParsed;
valid = ParseMoney(payAmount.toStdString(), payAmountParsed);
@@ -58,7 +59,13 @@ void SendCoinsDialog::on_sendButton_clicked()
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"),
@@ -110,3 +117,8 @@ void SendCoinsDialog::on_buttonBox_rejected()
{
reject();
}
void SendCoinsDialog::on_addToAddressBook_toggled(bool checked)
{
ui->addAsLabel->setEnabled(checked);
}