| 254 | } |
| 255 | |
| 256 | void AddressBookPage::done(int retval) |
| 257 | { |
| 258 | QTableView *table = ui->tableView; |
| 259 | if(!table->selectionModel() || !table->model()) |
| 260 | return; |
| 261 | |
| 262 | // Figure out which address was selected, and return it |
| 263 | QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); |
| 264 | |
| 265 | for (const QModelIndex& index : indexes) { |
| 266 | QVariant address = table->model()->data(index); |
| 267 | returnValue = address.toString(); |
| 268 | } |
| 269 | |
| 270 | if(returnValue.isEmpty()) |
| 271 | { |
| 272 | // If no address entry selected, return rejected |
| 273 | retval = Rejected; |
| 274 | } |
| 275 | |
| 276 | QDialog::done(retval); |
| 277 | } |
| 278 | |
| 279 | void AddressBookPage::on_exportButton_clicked() |
| 280 | { |