mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
parent
f300ca5b7b
commit
1e2d1a1b17
@ -417,11 +417,24 @@ void MainWindow::databaseTabChanged(int tabIndex)
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
saveWindowInformation();
|
||||
saveLastDatabases(event);
|
||||
bool accept = saveLastDatabases();
|
||||
|
||||
if (accept) {
|
||||
event->accept();
|
||||
}
|
||||
else {
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::saveLastDatabases(QCloseEvent* event)
|
||||
void MainWindow::saveWindowInformation()
|
||||
{
|
||||
config()->set("Window/Geometry", saveGeometry());
|
||||
}
|
||||
|
||||
bool MainWindow::saveLastDatabases()
|
||||
{
|
||||
bool accept;
|
||||
m_openDatabases.clear();
|
||||
bool openPreviousDatabasesOnStartup = config()->get("OpenPreviousDatabasesOnStartup").toBool();
|
||||
|
||||
@ -431,10 +444,10 @@ void MainWindow::saveLastDatabases(QCloseEvent* event)
|
||||
}
|
||||
|
||||
if (!m_ui->tabWidget->closeAllDatabases()) {
|
||||
event->ignore();
|
||||
accept = false;
|
||||
}
|
||||
else {
|
||||
event->accept();
|
||||
accept = true;
|
||||
}
|
||||
|
||||
if (openPreviousDatabasesOnStartup) {
|
||||
@ -442,11 +455,8 @@ void MainWindow::saveLastDatabases(QCloseEvent* event)
|
||||
this, SLOT(rememberOpenDatabases(QString)));
|
||||
config()->set("LastOpenedDatabases", m_openDatabases);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::saveWindowInformation()
|
||||
{
|
||||
config()->set("Window/Geometry", saveGeometry());
|
||||
return accept;
|
||||
}
|
||||
|
||||
void MainWindow::showEntryContextMenu(const QPoint& globalPos)
|
||||
|
@ -68,7 +68,7 @@ private:
|
||||
static const QString BaseWindowTitle;
|
||||
|
||||
void saveWindowInformation();
|
||||
void saveLastDatabases(QCloseEvent* event);
|
||||
bool saveLastDatabases();
|
||||
|
||||
const QScopedPointer<Ui::MainWindow> m_ui;
|
||||
SignalMultiplexer m_actionMultiplexer;
|
||||
|
Loading…
Reference in New Issue
Block a user