comparison main.cpp @ 24:0e0948aec438

De-select active person when deleting.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Apr 2017 12:46:21 +0300
parents 6e7ab784f7a4
children a7e746642599
comparison
equal deleted inserted replaced
23:6e7ab784f7a4 24:0e0948aec438
367 367
368 if (dlg.exec() == QMessageBox::Yes) 368 if (dlg.exec() == QMessageBox::Yes)
369 { 369 {
370 int rv = model_People->deletePerson(info.id); 370 int rv = model_People->deletePerson(info.id);
371 updatePersonList(); 371 updatePersonList();
372 setActivePerson(-1);
372 if (rv != 0) 373 if (rv != 0)
373 { 374 {
374 errorMsg(tr("SQL-tietokantavirhe"), 375 errorMsg(tr("SQL-tietokantavirhe"),
375 tr("Henkilön tietoja poistettaessa tapahtui virhe #%1."). 376 tr("Henkilön tietoja poistettaessa tapahtui virhe #%1.").
376 arg(rv)); 377 arg(rv));