Switch back to WelcomeWidget when settings widget is closed and there are no open databases.

This commit is contained in:
Florian Geyer 2012-05-30 15:17:51 +02:00
parent cf5f56af6f
commit 2448976643

View File

@ -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);