diff options
| author | Wladimir J. van der Laan <[email protected]> | 2011-06-03 15:16:11 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2011-06-03 15:16:11 +0200 |
| commit | 48208883de8397dbd13bec351e71fe62d5cd5db1 (patch) | |
| tree | 2ab0a347c1514da3974f30a7020cb2caf38ab994 /gui/src/addressbookdialog.cpp | |
| parent | Make base58 validator explicit (diff) | |
| download | discoin-48208883de8397dbd13bec351e71fe62d5cd5db1.tar.xz discoin-48208883de8397dbd13bec351e71fe62d5cd5db1.zip | |
Finish implementation of address book
Diffstat (limited to 'gui/src/addressbookdialog.cpp')
| -rw-r--r-- | gui/src/addressbookdialog.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gui/src/addressbookdialog.cpp b/gui/src/addressbookdialog.cpp index 3f8e38152..9b9e9bbc8 100644 --- a/gui/src/addressbookdialog.cpp +++ b/gui/src/addressbookdialog.cpp @@ -100,7 +100,10 @@ void AddressBookDialog::on_editButton_clicked() EditAddressDialog::EditReceivingAddress); dlg.setModel(model); dlg.loadRow(indexes.at(0).row()); - dlg.exec(); + if(dlg.exec()) + { + dlg.saveCurrentRow(); + } } void AddressBookDialog::on_newAddressButton_clicked() @@ -110,7 +113,10 @@ void AddressBookDialog::on_newAddressButton_clicked() EditAddressDialog::NewSendingAddress : EditAddressDialog::NewReceivingAddress); dlg.setModel(model); - dlg.exec(); + if(dlg.exec()) + { + dlg.saveCurrentRow(); + } } void AddressBookDialog::on_tabWidget_currentChanged(int index) @@ -130,9 +136,9 @@ void AddressBookDialog::on_deleteButton_clicked() { QTableView *table = getCurrentTable(); QModelIndexList indexes = table->selectionModel()->selectedRows(); - - foreach (QModelIndex index, indexes) { - table->model()->removeRow(index.row()); + if(!indexes.isEmpty()) + { + table->model()->removeRow(indexes.at(0).row()); } } |