Ask confirmation before removing connection.

Close #5
This commit is contained in:
eelke 2018-04-30 20:17:44 +02:00
parent d67224858d
commit c2d725ec6d
2 changed files with 9 additions and 4 deletions

View file

@ -62,8 +62,13 @@ void ConnectionManagerWindow::on_actionDelete_connection_triggered()
{
auto ci = ui->listView->selectionModel()->currentIndex();
if (ci.isValid()) {
auto clm = m_masterController->getConnectionListModel();
clm->removeRow(ci.row());
auto res = QMessageBox::question(this, "pglab",
tr("Are you sure you want to remove this connection?"), QMessageBox::Yes, QMessageBox::No);
if (res == QMessageBox::Yes) {
auto clm = m_masterController->getConnectionListModel();
clm->removeRow(ci.row());
}
}
}