mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-15 23:10:59 -04:00
parent
ba3baf3595
commit
f0985ff9d9
5 changed files with 22 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue