Making it possible to hide control settings based on machine hardware settings.
This commit is contained in:
parent
6b2b611496
commit
3edee26813
3 changed files with 38 additions and 9 deletions
|
|
@ -63,6 +63,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public List<string> SetSettingsOnChange = new List<string>();
|
||||
|
||||
public string ShowIfSet { get; set; }
|
||||
|
||||
static public OrganizerSettingsData NewOrganizerSettingData(string slicerConfigName, string presentationName, OrganizerSettingsData.DataEditTypes dataEditType, string extraSettings = "", string helpText = "")
|
||||
{
|
||||
return new OrganizerSettingsData(slicerConfigName, presentationName, dataEditType, extraSettings, helpText);
|
||||
|
|
|
|||
|
|
@ -545,7 +545,26 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
foreach (OrganizerSettingsData settingInfo in subGroup.SettingDataList)
|
||||
{
|
||||
if (ActivePrinterProfile.Instance.ActiveSliceEngine.MapContains(settingInfo.SlicerConfigName))
|
||||
bool settingShouldBeShown = true;
|
||||
if (settingInfo.ShowIfSet != null
|
||||
&& settingInfo.ShowIfSet != "")
|
||||
{
|
||||
string showValue = "0";
|
||||
string checkName = settingInfo.ShowIfSet;
|
||||
if(checkName.StartsWith("!"))
|
||||
{
|
||||
showValue = "1";
|
||||
checkName = checkName.Substring(1);
|
||||
}
|
||||
string sliceSettingValue = ActiveSliceSettings.Instance.GetActiveValue(checkName);
|
||||
if (sliceSettingValue == showValue)
|
||||
{
|
||||
settingShouldBeShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ActivePrinterProfile.Instance.ActiveSliceEngine.MapContains(settingInfo.SlicerConfigName)
|
||||
&& settingShouldBeShown)
|
||||
{
|
||||
addedSettingToSubGroup = true;
|
||||
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, minSettingNameWidth, copyIndex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue