Proper SQL Execution behaviour when DB is closed

Remove completion for identifiers when closing DB.

Do not enable the execute SQL actions when the DB is closed.

See issue #1800
This commit is contained in:
mgrojo
2019-03-16 16:38:18 +01:00
parent d4ef409711
commit 780ff3f65d

View File

@@ -922,6 +922,9 @@ bool MainWindow::fileClose()
ui->editLogUser->clear();
ui->editLogErrorLog->clear();
// Remove completion for identifiers
SqlTextEdit::sqlLexer->setTableNames(SqlUiLexer::QualifiedTablesMap());
return true;
}
@@ -2253,8 +2256,8 @@ void MainWindow::changeSqlTab(int index)
{
// Not running a query
ui->actionSqlExecuteLine->setEnabled(true);
ui->actionExecuteSql->setEnabled(true);
ui->actionSqlExecuteLine->setEnabled(db.isOpen());
ui->actionExecuteSql->setEnabled(db.isOpen());
ui->actionSqlStop->setEnabled(false);
} else {
// Running a query