From d567f3856ffeb2eaa6523583c04b557c0622f804 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Thu, 14 Nov 2019 23:59:27 +0100 Subject: [PATCH] Do not open a new SQL tab when a DB file is open or created unless there is not any yet. See issue #1706 --- src/MainWindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 5941dcb0..6b5689db 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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(); }