Do not open a new SQL tab when a DB file is open or created unless there

is not any yet.

See issue #1706
This commit is contained in:
mgrojo
2019-11-14 23:59:27 +01:00
parent c9f5d3138e
commit d567f3856f

View File

@@ -517,7 +517,8 @@ bool MainWindow::fileOpen(const QString& fileName, bool openFromProject, bool re
if(!currentProjectFilename.isEmpty())
isProjectModified = true;
}
openSqlTab(true);
if(ui->tabSqlAreas->count() == 0)
openSqlTab(true);
if(ui->mainTab->currentWidget() == ui->browser)
populateTable();
else if(ui->mainTab->currentWidget() == ui->pragmas)
@@ -551,7 +552,8 @@ void MainWindow::fileNew()
statusEncryptionLabel->setVisible(false);
statusReadOnlyLabel->setVisible(false);
populateTable();
openSqlTab(true);
if(ui->tabSqlAreas->count() == 0)
openSqlTab(true);
createTable();
}
}
@@ -564,7 +566,8 @@ void MainWindow::fileNewInMemoryDatabase()
statusEncryptionLabel->setVisible(false);
statusReadOnlyLabel->setVisible(false);
populateTable();
openSqlTab(true);
if(ui->tabSqlAreas->count() == 0)
openSqlTab(true);
createTable();
}