Allow to mark preferences as immutable or deprecated

- Deprecated: The option is read from the settings, but not written back
  when saving. This can be used for migrating options to a new name or
  format. (Not used yet.)
- Immutable: The option can not be changed from Lua. Used for
  security-relevant options that should not be changable by the theme or
  mod charts. Currently that's networking and some file system access
  options.
This commit is contained in:
Martin Natano
2022-02-20 17:24:43 +01:00
parent eb0ab83d89
commit d8b6d36a78
6 changed files with 55 additions and 23 deletions
+2 -2
View File
@@ -17,8 +17,8 @@
NetworkManager* NETWORK = nullptr; // global and accessible from anywhere in our program
Preference<bool> NetworkManager::httpEnabled("HttpEnabled", false);
Preference<RString> NetworkManager::httpAllowHosts("HttpAllowHosts", "");
Preference<bool> NetworkManager::httpEnabled("HttpEnabled", false, nullptr, PreferenceType::Immutable);
Preference<RString> NetworkManager::httpAllowHosts("HttpAllowHosts", "", nullptr, PreferenceType::Immutable);
static const char *HttpErrorCodeNames[] = {
"Blocked",