aboutsummaryrefslogtreecommitdiff
path: root/src/qt/editaddressdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/editaddressdialog.cpp')
-rw-r--r--src/qt/editaddressdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp
index dd0541760b..58ecb49486 100644
--- a/src/qt/editaddressdialog.cpp
+++ b/src/qt/editaddressdialog.cpp
@@ -19,9 +19,11 @@ EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
case NewReceivingAddress:
setWindowTitle(tr("New receiving address"));
ui->addressEdit->setEnabled(false);
+ ui->setAsDefault->setChecked(true);
break;
case NewSendingAddress:
setWindowTitle(tr("New sending address"));
+ ui->setAsDefault->setVisible(false);
break;
case EditReceivingAddress:
setWindowTitle(tr("Edit receiving address"));
@@ -29,6 +31,7 @@ EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
break;
case EditSendingAddress:
setWindowTitle(tr("Edit sending address"));
+ ui->setAsDefault->setVisible(false);
break;
}
@@ -47,6 +50,7 @@ void EditAddressDialog::setModel(AddressTableModel *model)
mapper->setModel(model);
mapper->addMapping(ui->labelEdit, AddressTableModel::Label);
mapper->addMapping(ui->addressEdit, AddressTableModel::Address);
+ mapper->addMapping(ui->setAsDefault, AddressTableModel::IsDefaultAddress);
}
void EditAddressDialog::loadRow(int row)
@@ -64,7 +68,8 @@ QString EditAddressDialog::saveCurrentRow()
address = model->addRow(
mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,
ui->labelEdit->text(),
- ui->addressEdit->text());
+ ui->addressEdit->text(),
+ ui->setAsDefault->isChecked());
if(address.isEmpty())
{
QMessageBox::warning(this, windowTitle(),