Skip to content

Commit

Permalink
Remember "Advanced Settings" toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
phoerious committed May 26, 2018
1 parent ba6affe commit 55c9e51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("GUI/MinimizeOnClose", false);
m_defaults.insert("GUI/HideUsernames", false);
m_defaults.insert("GUI/HidePasswords", true);
m_defaults.insert("GUI/AdvancedSettings", false);
}

Config* Config::instance()
Expand Down
4 changes: 4 additions & 0 deletions src/gui/dbsettings/DatabaseSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "DatabaseSettingsWidgetEncryption.h"
#include "DatabaseSettingsWidgetChangeMasterKey.h"

#include "core/Config.h"
#include "core/FilePath.h"

DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
Expand Down Expand Up @@ -66,6 +67,7 @@ void DatabaseSettingsDialog::load(Database* db)
m_generalWidget->load(db);
m_masterKeyWidget->load(db);
m_encryptionWidget->load(db);
m_ui->advancedSettingsToggle->setChecked(config()->get("GUI/AdvancedSettings", false).toBool());
}

/**
Expand Down Expand Up @@ -121,4 +123,6 @@ void DatabaseSettingsDialog::toggleAdvancedMode(bool advanced)

if (m_encryptionWidget->hasAdvancedMode())
m_encryptionWidget->setAdvancedMode(advanced);

config()->set("GUI/AdvancedSettings", advanced);
}

0 comments on commit 55c9e51

Please sign in to comment.