aboutsummaryrefslogtreecommitdiff
path: root/gui/src/addressbookdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/addressbookdialog.cpp')
-rw-r--r--gui/src/addressbookdialog.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/gui/src/addressbookdialog.cpp b/gui/src/addressbookdialog.cpp
index 3f8e38152a..9b9e9bbc8e 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());
}
}