From 24489766431858d9818e5961d4158c2ba5b2be68 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Wed, 30 May 2012 15:17:51 +0200 Subject: [PATCH] Switch back to WelcomeWidget when settings widget is closed and there are no open databases. --- src/gui/MainWindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 5d5d838ad..c445ffe32 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -241,7 +241,12 @@ void MainWindow::showAboutDialog() void MainWindow::switchToDatabases() { - m_ui->stackedWidget->setCurrentIndex(0); + if (m_ui->tabWidget->currentIndex() == -1) { + m_ui->stackedWidget->setCurrentIndex(2); + } + else { + m_ui->stackedWidget->setCurrentIndex(0); + } } void MainWindow::switchToSettings() @@ -253,7 +258,7 @@ void MainWindow::switchToSettings() void MainWindow::databaseTabChanged(int tabIndex) { if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == 2) { - switchToDatabases(); + m_ui->stackedWidget->setCurrentIndex(0); } else if (tabIndex == -1 && m_ui->stackedWidget->currentIndex() == 0) { m_ui->stackedWidget->setCurrentIndex(2);