Remember opened databases on quit.

Refs #36
This commit is contained in:
Florian Geyer committed 2013-04-18 21:52:08 +02:00
1 parent ba3baf3595
commit f0985ff9d9
5 files changed
+22

No files matched your search

+11
View File
@@ -397,12 +397,18 @@ void MainWindow::databaseTabChanged(int tabIndex)
void MainWindow::closeEvent(QCloseEvent* event)
{
openDatabases.clear();
connect(m_ui->tabWidget, SIGNAL(databaseWithFileClosed(QString)), this, SLOT(rememberOpenDatabases(QString)));
if (!m_ui->tabWidget->closeAllDatabases()) {
event->ignore();
}
else {
event->accept();
}
disconnect(m_ui->tabWidget, SIGNAL(databaseWithFileClosed(QString)), this, SLOT(rememberOpenDatabases(QString)));
if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) {
config()->set("OpenDatabasesOnExit", openDatabases);
}
}
void MainWindow::showEntryContextMenu(const QPoint& globalPos)
@@ -429,3 +435,8 @@ void MainWindow::setShortcut(QAction* action, QKeySequence::StandardKey standard
action->setShortcut(QKeySequence(fallback));
}
}
void MainWindow::rememberOpenDatabases(QString filePath)
{
openDatabases.append(filePath);
}