Settings: Only write out config on setting change for persistent changes

This commit is contained in:
Jonathan G Rennison
2023-08-24 17:27:47 +01:00
parent f8c8ba2670
commit 547c00b465
8 changed files with 81 additions and 38 deletions

View File

@@ -14,9 +14,9 @@ static const SettingTable _network_private_settings = {
[post-amble]
};
[templates]
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, $length, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_BOOL = SDTC_BOOL( $var, $flags | SF_PRIVATE, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags | SF_PRIVATE, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags | SF_PRIVATE, $def, $length, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
[validation]
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");

View File

@@ -17,7 +17,7 @@ static const SettingTable _network_secrets_settings = {
[post-amble]
};
[templates]
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, $length, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags | SF_SECRET, $def, $length, $pre_cb, $post_cb, $from, $to, $extver, $cat, $guiproc, $startup, nullptr),
[validation]