aboutsummaryrefslogtreecommitdiff
path: root/gui/src/addressbookdialog.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-06-02 17:48:45 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-06-02 17:56:51 +0200
commit44384a4602821216023ee63157ac6e376d1e9e10 (patch)
tree8820866d45114cdc0cec86fcde05a4fb80ff8317 /gui/src/addressbookdialog.cpp
parent5c94371f9a9bf41a5544403ee87ac331c2b0b1c3 (diff)
edit address dialog: basic data/widget binding
Diffstat (limited to 'gui/src/addressbookdialog.cpp')
-rw-r--r--gui/src/addressbookdialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/src/addressbookdialog.cpp b/gui/src/addressbookdialog.cpp
index 853da5852e..3f8e38152a 100644
--- a/gui/src/addressbookdialog.cpp
+++ b/gui/src/addressbookdialog.cpp
@@ -87,11 +87,19 @@ void AddressBookDialog::on_copyToClipboard_clicked()
void AddressBookDialog::on_editButton_clicked()
{
+ QModelIndexList indexes = getCurrentTable()->selectionModel()->selectedRows();
+ if(indexes.isEmpty())
+ {
+ return;
+ }
+
/* Double click also triggers edit button */
EditAddressDialog dlg(
ui->tabWidget->currentIndex() == SendingTab ?
EditAddressDialog::EditSendingAddress :
EditAddressDialog::EditReceivingAddress);
+ dlg.setModel(model);
+ dlg.loadRow(indexes.at(0).row());
dlg.exec();
}
@@ -101,6 +109,7 @@ void AddressBookDialog::on_newAddressButton_clicked()
ui->tabWidget->currentIndex() == SendingTab ?
EditAddressDialog::NewSendingAddress :
EditAddressDialog::NewReceivingAddress);
+ dlg.setModel(model);
dlg.exec();
}