mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-07 22:12:59 -04:00
Fix crash when canceling save of new database (#2601)
* Fix crash when canceling save of new database * Standardize use of DatabaseWidget::save() function * Close new database tabs that are "discarded" * Fixes #2604. autoSaveOnExit setting * Re-implement autosave functionality
This commit is contained in:
parent
d66299260c
commit
c74664097b
7 changed files with 48 additions and 18 deletions
|
@ -79,9 +79,9 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
|
|||
connect(this, SIGNAL(rejected()), SLOT(reject()));
|
||||
|
||||
// clang-format off
|
||||
connect(m_generalUi->autoSaveAfterEveryChangeCheckBox, SIGNAL(toggled(bool)), SLOT(enableAutoSaveOnExit(bool)));
|
||||
connect(m_generalUi->systrayShowCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableSystray(bool)));
|
||||
connect(m_generalUi->toolbarHideCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableToolbarSettings(bool)));
|
||||
connect(m_generalUi->autoSaveAfterEveryChangeCheckBox, SIGNAL(toggled(bool)), SLOT(autoSaveToggled(bool)));
|
||||
connect(m_generalUi->systrayShowCheckBox, SIGNAL(toggled(bool)), SLOT(systrayToggled(bool)));
|
||||
connect(m_generalUi->toolbarHideCheckBox, SIGNAL(toggled(bool)), SLOT(enableToolbarSettings(bool)));
|
||||
|
||||
connect(m_secUi->clearClipboardCheckBox, SIGNAL(toggled(bool)),
|
||||
m_secUi->clearClipboardSpinBox, SLOT(setEnabled(bool)));
|
||||
|
@ -308,12 +308,16 @@ void ApplicationSettingsWidget::reject()
|
|||
}
|
||||
}
|
||||
|
||||
void ApplicationSettingsWidget::enableAutoSaveOnExit(bool checked)
|
||||
void ApplicationSettingsWidget::autoSaveToggled(bool checked)
|
||||
{
|
||||
// Explicitly enable auto-save on exit if it wasn't already
|
||||
if (checked && !m_generalUi->autoSaveOnExitCheckBox->isChecked()) {
|
||||
m_generalUi->autoSaveOnExitCheckBox->setChecked(true);
|
||||
}
|
||||
m_generalUi->autoSaveOnExitCheckBox->setEnabled(!checked);
|
||||
}
|
||||
|
||||
void ApplicationSettingsWidget::enableSystray(bool checked)
|
||||
void ApplicationSettingsWidget::systrayToggled(bool checked)
|
||||
{
|
||||
m_generalUi->systrayDarkIconCheckBox->setEnabled(checked);
|
||||
m_generalUi->systrayMinimizeToTrayCheckBox->setEnabled(checked);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue