Merge pull request #4363 from jlewin/master
Remove layer before causing action that fires SettingChanged
This commit is contained in:
commit
18bc6239ab
2 changed files with 11 additions and 4 deletions
|
|
@ -167,9 +167,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
SetAsActive = (qualityKey) => printer.Settings.ActiveQualityKey = qualityKey,
|
||||
DeleteLayer = () =>
|
||||
{
|
||||
printer.Settings.ActiveQualityKey = "";
|
||||
printer.Settings.QualityLayers.Remove(layerToEdit);
|
||||
printer.Settings.Save();
|
||||
|
||||
// Clear QualityKey after removing layer to ensure listeners see update
|
||||
printer.Settings.ActiveQualityKey = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -216,7 +218,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (stringEvent != null
|
||||
&& (stringEvent.Data == SettingsKey.default_material_presets
|
||||
|| stringEvent.Data == SettingsKey.active_material_key
|
||||
|| (layerType == NamedSettingsLayers.Material && stringEvent.Data == SettingsKey.active_material_key)
|
||||
|| (layerType == NamedSettingsLayers.Quality && stringEvent.Data == SettingsKey.active_quality_key)
|
||||
|| stringEvent.Data == SettingsKey.layer_name))
|
||||
{
|
||||
RebuildDropDownList();
|
||||
|
|
@ -247,7 +250,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
menuItem.Selected += MenuItem_Selected;
|
||||
}
|
||||
|
||||
MenuItem addNewPreset = dropDownList.AddItem(AggContext.StaticData.LoadIcon("icon_plus.png", 16, 16), "Add New Setting".Localize() + "...", "new");
|
||||
MenuItem addNewPreset = dropDownList.AddItem(
|
||||
AggContext.StaticData.LoadIcon("icon_plus.png", 16, 16),
|
||||
"Add New Setting".Localize() + "...",
|
||||
"new",
|
||||
pointSize: theme.DefaultFontSize);
|
||||
addNewPreset.Selected += (s, e) =>
|
||||
{
|
||||
var newLayer = new PrinterSettingsLayer();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 68fbc9038707549c1d08f7dd24a8b1c34a944cb1
|
||||
Subproject commit 1acd5c622811c775df0bb74fb0d219c3abce8520
|
||||
Loading…
Add table
Add a link
Reference in a new issue