settings: Add update/getPersistent/isIgnored methods

Add interfaces::Node methods to give GUI finer grained control over
settings.json file. Update method is used to write settings to the file,
getPersistent and isIgnored methods are used to find out about settings
file and command line option interactions.
This commit is contained in:
Ryan Ofsky
2019-04-29 15:29:00 -04:00
parent 0de36941ec
commit 0e55bc6e7f
7 changed files with 101 additions and 10 deletions

View File

@@ -161,6 +161,10 @@ struct SectionInfo
int m_line;
};
std::string SettingToString(const util::SettingsValue&, const std::string&);
int64_t SettingToInt(const util::SettingsValue&, int64_t);
bool SettingToBool(const util::SettingsValue&, bool);
class ArgsManager
{
public:
@@ -448,6 +452,12 @@ protected:
*/
bool WriteSettingsFile(std::vector<std::string>* errors = nullptr) const;
/**
* Get current setting from config file or read/write settings file,
* ignoring nonpersistent command line or forced settings values.
*/
util::SettingsValue GetPersistentSetting(const std::string& name) const;
/**
* Access settings with lock held.
*/