mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-07 06:27:39 +03:00
Add settings option to control if previous databases are opened on startup.
Closes #36
This commit is contained in:
parent
6f92188323
commit
bbf183bef7
4 changed files with 24 additions and 9 deletions
|
@ -398,15 +398,21 @@ void MainWindow::databaseTabChanged(int tabIndex)
|
|||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
openDatabases.clear();
|
||||
connect(m_ui->tabWidget, SIGNAL(databaseWithFileClosed(QString)), this, SLOT(rememberOpenDatabases(QString)));
|
||||
bool openPreviousDatabasesOnStartup = config()->get("OpenPreviousDatabasesOnStartup").toBool();
|
||||
|
||||
if (openPreviousDatabasesOnStartup) {
|
||||
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()) {
|
||||
|
||||
if (openPreviousDatabasesOnStartup) {
|
||||
disconnect(m_ui->tabWidget, SIGNAL(databaseWithFileClosed(QString)), this, SLOT(rememberOpenDatabases(QString)));
|
||||
config()->set("OpenDatabasesOnExit", openDatabases);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue