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)
|
void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
{
|
{
|
||||||
saveWindowInformation();
|
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();
|
m_openDatabases.clear();
|
||||||
bool openPreviousDatabasesOnStartup = config()->get("OpenPreviousDatabasesOnStartup").toBool();
|
bool openPreviousDatabasesOnStartup = config()->get("OpenPreviousDatabasesOnStartup").toBool();
|
||||||
|
|
||||||
@ -431,10 +444,10 @@ void MainWindow::saveLastDatabases(QCloseEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_ui->tabWidget->closeAllDatabases()) {
|
if (!m_ui->tabWidget->closeAllDatabases()) {
|
||||||
event->ignore();
|
accept = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event->accept();
|
accept = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (openPreviousDatabasesOnStartup) {
|
if (openPreviousDatabasesOnStartup) {
|
||||||
@ -442,11 +455,8 @@ void MainWindow::saveLastDatabases(QCloseEvent* event)
|
|||||||
this, SLOT(rememberOpenDatabases(QString)));
|
this, SLOT(rememberOpenDatabases(QString)));
|
||||||
config()->set("LastOpenedDatabases", m_openDatabases);
|
config()->set("LastOpenedDatabases", m_openDatabases);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::saveWindowInformation()
|
return accept;
|
||||||
{
|
|
||||||
config()->set("Window/Geometry", saveGeometry());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showEntryContextMenu(const QPoint& globalPos)
|
void MainWindow::showEntryContextMenu(const QPoint& globalPos)
|
||||||
|
@ -68,7 +68,7 @@ private:
|
|||||||
static const QString BaseWindowTitle;
|
static const QString BaseWindowTitle;
|
||||||
|
|
||||||
void saveWindowInformation();
|
void saveWindowInformation();
|
||||||
void saveLastDatabases(QCloseEvent* event);
|
bool saveLastDatabases();
|
||||||
|
|
||||||
const QScopedPointer<Ui::MainWindow> m_ui;
|
const QScopedPointer<Ui::MainWindow> m_ui;
|
||||||
SignalMultiplexer m_actionMultiplexer;
|
SignalMultiplexer m_actionMultiplexer;
|
||||||
|
Loading…
Reference in New Issue
Block a user