Propagate changes to SetSettingsOnChange values on ClearValue
- Issue MatterHackers/MCCentral#3754 Network printing is not disabled when clearing the setting using the X button.
This commit is contained in:
parent
7274ebdbab
commit
475a5b3af8
1 changed files with 20 additions and 0 deletions
|
|
@ -1296,6 +1296,26 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
RestoreUserOverride(layer, settingsKey);
|
||||
}
|
||||
|
||||
if (SettingsOrganizer.SettingsData.TryGetValue(settingsKey, out SliceSettingData settingData))
|
||||
{
|
||||
if (settingData.DataEditType == SliceSettingData.DataEditTypes.CHECK_BOX)
|
||||
{
|
||||
string checkedKey = this.GetValue<bool>(settingsKey) ? "OnValue" : "OffValue";
|
||||
|
||||
// Linked settings should be updated in all cases (user clicked checkbox, user clicked clear)
|
||||
foreach (var setSettingsData in settingData.SetSettingsOnChange)
|
||||
{
|
||||
if (setSettingsData.TryGetValue(checkedKey, out string targetValue))
|
||||
{
|
||||
if (this.GetValue(setSettingsData["TargetSetting"]) != targetValue)
|
||||
{
|
||||
this.SetValue(setSettingsData["TargetSetting"], targetValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Save();
|
||||
|
||||
ActiveSliceSettings.OnSettingChanged(settingsKey);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue