mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-30 09:46:30 -05:00
Checking config access errors in settings.
This commit is contained in:
parent
e6b4528028
commit
a3840963e1
@ -99,6 +99,12 @@ void SettingsWidget::addSettingsPage(ISettingsPage* page)
|
|||||||
|
|
||||||
void SettingsWidget::loadSettings()
|
void SettingsWidget::loadSettings()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (config()->hasAccessError()) {
|
||||||
|
showMessage(
|
||||||
|
tr("Access error for config file ") + config()->getFileName(), MessageWidget::Error);
|
||||||
|
}
|
||||||
|
|
||||||
m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get("RememberLastDatabases").toBool());
|
m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get("RememberLastDatabases").toBool());
|
||||||
m_generalUi->rememberLastKeyFilesCheckBox->setChecked(config()->get("RememberLastKeyFiles").toBool());
|
m_generalUi->rememberLastKeyFilesCheckBox->setChecked(config()->get("RememberLastKeyFiles").toBool());
|
||||||
m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(
|
m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked(
|
||||||
@ -154,6 +160,15 @@ void SettingsWidget::loadSettings()
|
|||||||
|
|
||||||
void SettingsWidget::saveSettings()
|
void SettingsWidget::saveSettings()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (config()->hasAccessError()) {
|
||||||
|
showMessage(
|
||||||
|
tr("Access error for config file ") + config()->getFileName(), MessageWidget::Error);
|
||||||
|
// We prevent closing the settings page if we could not write to
|
||||||
|
// the config file.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
config()->set("RememberLastDatabases", m_generalUi->rememberLastDatabasesCheckBox->isChecked());
|
config()->set("RememberLastDatabases", m_generalUi->rememberLastDatabasesCheckBox->isChecked());
|
||||||
config()->set("RememberLastKeyFiles", m_generalUi->rememberLastKeyFilesCheckBox->isChecked());
|
config()->set("RememberLastKeyFiles", m_generalUi->rememberLastKeyFilesCheckBox->isChecked());
|
||||||
config()->set("OpenPreviousDatabasesOnStartup",
|
config()->set("OpenPreviousDatabasesOnStartup",
|
||||||
|
Loading…
Reference in New Issue
Block a user