diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-21 20:34:43 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-06-21 20:36:03 +0200 |
commit | b9e80983a5c076fed655a7c3c67b53bd9ecc3dda (patch) | |
tree | 8160290efeef086d82cd7b156a0538e922363ad8 /src/qt/editaddressdialog.cpp | |
parent | f5927f5b32c9e28033fb7a00dd43f3162781c1d0 (diff) |
Allow changing default address (fixes issue #6)
Diffstat (limited to 'src/qt/editaddressdialog.cpp')
-rw-r--r-- | src/qt/editaddressdialog.cpp | 7 |
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(), |