Remove unused EnforceGuiOnlyConfigValues function
This commit is contained in:
parent
4ea2a6107f
commit
d0de99a00c
@ -606,7 +606,6 @@ public partial class MainWindowViewModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
_configReturnScreen = CurrentScreen;
|
_configReturnScreen = CurrentScreen;
|
||||||
EnforceGuiOnlyConfigValues(configService.CurrentConfig);
|
|
||||||
BuildConfigFields(configService.CurrentConfig);
|
BuildConfigFields(configService.CurrentConfig);
|
||||||
ConfigScreenMessage = "Edit configuration values and save to apply changes.";
|
ConfigScreenMessage = "Edit configuration values and save to apply changes.";
|
||||||
CurrentScreen = AppScreen.Config;
|
CurrentScreen = AppScreen.Config;
|
||||||
@ -616,7 +615,6 @@ public partial class MainWindowViewModel(
|
|||||||
private async Task CancelConfigAsync()
|
private async Task CancelConfigAsync()
|
||||||
{
|
{
|
||||||
bool loaded = await configService.LoadConfigurationAsync([]);
|
bool loaded = await configService.LoadConfigurationAsync([]);
|
||||||
EnforceGuiOnlyConfigValues(configService.CurrentConfig);
|
|
||||||
BuildConfigFields(configService.CurrentConfig);
|
BuildConfigFields(configService.CurrentConfig);
|
||||||
|
|
||||||
if (!loaded)
|
if (!loaded)
|
||||||
@ -676,12 +674,10 @@ public partial class MainWindowViewModel(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnforceGuiOnlyConfigValues(newConfig);
|
|
||||||
configService.UpdateConfig(newConfig);
|
configService.UpdateConfig(newConfig);
|
||||||
await configService.SaveConfigurationAsync();
|
await configService.SaveConfigurationAsync();
|
||||||
|
|
||||||
bool reloaded = await configService.LoadConfigurationAsync([]);
|
bool reloaded = await configService.LoadConfigurationAsync([]);
|
||||||
EnforceGuiOnlyConfigValues(configService.CurrentConfig);
|
|
||||||
if (!reloaded)
|
if (!reloaded)
|
||||||
{
|
{
|
||||||
ConfigScreenMessage = "config.conf could not be loaded after saving. Please review your values.";
|
ConfigScreenMessage = "config.conf could not be loaded after saving. Please review your values.";
|
||||||
@ -1245,13 +1241,11 @@ public partial class MainWindowViewModel(
|
|||||||
ApplyThemeFromConfigFileIfAvailable();
|
ApplyThemeFromConfigFileIfAvailable();
|
||||||
_configReturnScreen = CurrentScreen;
|
_configReturnScreen = CurrentScreen;
|
||||||
SetLoading("Loading configuration...");
|
SetLoading("Loading configuration...");
|
||||||
EnforceGuiOnlyConfigValues(configService.CurrentConfig);
|
|
||||||
BuildConfigFields(configService.CurrentConfig);
|
BuildConfigFields(configService.CurrentConfig);
|
||||||
UserLists.Clear();
|
UserLists.Clear();
|
||||||
AvailableUsers.Clear();
|
AvailableUsers.Clear();
|
||||||
|
|
||||||
bool configLoaded = await configService.LoadConfigurationAsync([]);
|
bool configLoaded = await configService.LoadConfigurationAsync([]);
|
||||||
EnforceGuiOnlyConfigValues(configService.CurrentConfig);
|
|
||||||
BuildConfigFields(configService.CurrentConfig);
|
BuildConfigFields(configService.CurrentConfig);
|
||||||
if (!configLoaded)
|
if (!configLoaded)
|
||||||
{
|
{
|
||||||
@ -1799,7 +1793,6 @@ public partial class MainWindowViewModel(
|
|||||||
private bool TryBuildConfig(out Config config)
|
private bool TryBuildConfig(out Config config)
|
||||||
{
|
{
|
||||||
config = CloneConfig(configService.CurrentConfig);
|
config = CloneConfig(configService.CurrentConfig);
|
||||||
EnforceGuiOnlyConfigValues(config);
|
|
||||||
ClearSpecialConfigErrors();
|
ClearSpecialConfigErrors();
|
||||||
Dictionary<string, object?> parsedValues = new(StringComparer.Ordinal);
|
Dictionary<string, object?> parsedValues = new(StringComparer.Ordinal);
|
||||||
Dictionary<string, ConfigFieldViewModel> fieldMap = ConfigFields
|
Dictionary<string, ConfigFieldViewModel> fieldMap = ConfigFields
|
||||||
@ -1834,7 +1827,6 @@ public partial class MainWindowViewModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ApplySpecialConfigValues(config);
|
ApplySpecialConfigValues(config);
|
||||||
EnforceGuiOnlyConfigValues(config);
|
|
||||||
config.CreatorConfigs = CreatorConfigEditor.ToDictionary();
|
config.CreatorConfigs = CreatorConfigEditor.ToDictionary();
|
||||||
ValidateSpecialConfigValues();
|
ValidateSpecialConfigValues();
|
||||||
if (HasSpecialConfigErrors())
|
if (HasSpecialConfigErrors())
|
||||||
@ -2360,8 +2352,6 @@ public partial class MainWindowViewModel(
|
|||||||
return JsonConvert.DeserializeObject<Config>(json) ?? new Config();
|
return JsonConvert.DeserializeObject<Config>(json) ?? new Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EnforceGuiOnlyConfigValues(Config config) => _ = config;
|
|
||||||
|
|
||||||
private static bool IsHiddenConfigField(string propertyName) =>
|
private static bool IsHiddenConfigField(string propertyName) =>
|
||||||
propertyName is nameof(Config.NonInteractiveMode)
|
propertyName is nameof(Config.NonInteractiveMode)
|
||||||
or nameof(Config.NonInteractiveModeListName)
|
or nameof(Config.NonInteractiveModeListName)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user