Remove unused PrinterConnection parameters and local references
This commit is contained in:
parent
c00f7c2139
commit
b7749fe8cc
8 changed files with 14 additions and 25 deletions
|
|
@ -37,16 +37,13 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
public class PresetsToolbar : FlowLayoutWidget
|
||||
{
|
||||
PrinterConnection printerConnection;
|
||||
|
||||
public PresetsToolbar(PrinterConnection printerConnection)
|
||||
public PresetsToolbar()
|
||||
{
|
||||
this.printerConnection = printerConnection;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.Helpers.NumberOfHotEnds();
|
||||
|
||||
this.AddChild(new PresetSelectorWidget(printerConnection, "Quality".Localize(), RGBA_Bytes.Yellow, NamedSettingsLayers.Quality, 0));
|
||||
this.AddChild(new PresetSelectorWidget("Quality".Localize(), RGBA_Bytes.Yellow, NamedSettingsLayers.Quality, 0));
|
||||
this.AddChild(new GuiWidget(8, 0));
|
||||
|
||||
if (numberOfHeatedExtruders > 1)
|
||||
|
|
@ -61,12 +58,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
int colorIndex = i % colorList.Count;
|
||||
RGBA_Bytes color = colorList[colorIndex];
|
||||
this.AddChild(new PresetSelectorWidget(printerConnection, string.Format("{0} {1}", "Material".Localize(), i + 1), color, NamedSettingsLayers.Material, i));
|
||||
this.AddChild(new PresetSelectorWidget(string.Format("{0} {1}", "Material".Localize(), i + 1), color, NamedSettingsLayers.Material, i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddChild(new PresetSelectorWidget(printerConnection, "Material".Localize(), RGBA_Bytes.Orange, NamedSettingsLayers.Material, 0));
|
||||
this.AddChild(new PresetSelectorWidget("Material".Localize(), RGBA_Bytes.Orange, NamedSettingsLayers.Material, 0));
|
||||
}
|
||||
|
||||
this.Height = 60 * GuiWidget.DeviceScale;
|
||||
|
|
|
|||
|
|
@ -52,13 +52,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public DropDownList DropDownList;
|
||||
|
||||
private int extruderIndex; //For multiple materials
|
||||
PrinterConnection printerConnection;
|
||||
|
||||
public PresetSelectorWidget(PrinterConnection printerConnection, string label, RGBA_Bytes accentColor, NamedSettingsLayers layerType, int extruderIndex, bool whiteBackground = false)
|
||||
public PresetSelectorWidget(string label, RGBA_Bytes accentColor, NamedSettingsLayers layerType, int extruderIndex, bool whiteBackground = false)
|
||||
: base(FlowDirection.TopToBottom)
|
||||
{
|
||||
this.whiteBackground = whiteBackground;
|
||||
this.printerConnection = printerConnection;
|
||||
Name = label;
|
||||
|
||||
ActiveSliceSettings.SettingChanged.RegisterEvent((s, e) =>
|
||||
|
|
@ -159,7 +157,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
};
|
||||
|
||||
ApplicationController.Instance.EditMaterialPresetsWindow = new SlicePresetsWindow(printerConnection, presetsContext);
|
||||
ApplicationController.Instance.EditMaterialPresetsWindow = new SlicePresetsWindow(presetsContext);
|
||||
ApplicationController.Instance.EditMaterialPresetsWindow.Closed += (s, e2) =>
|
||||
{
|
||||
ApplicationController.Instance.EditMaterialPresetsWindow = null;
|
||||
|
|
@ -199,7 +197,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
};
|
||||
|
||||
ApplicationController.Instance.EditQualityPresetsWindow = new SlicePresetsWindow(printerConnection, presetsContext);
|
||||
ApplicationController.Instance.EditQualityPresetsWindow = new SlicePresetsWindow(presetsContext);
|
||||
ApplicationController.Instance.EditQualityPresetsWindow.Closed += (s, e2) =>
|
||||
{
|
||||
ApplicationController.Instance.EditQualityPresetsWindow = null;
|
||||
|
|
|
|||
|
|
@ -69,12 +69,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
private string initialPresetName = null;
|
||||
|
||||
private GuiWidget middleRow;
|
||||
PrinterConnection printerConnection;
|
||||
|
||||
public SlicePresetsWindow(PrinterConnection printerConnection, PresetsContext presetsContext)
|
||||
public SlicePresetsWindow(PresetsContext presetsContext)
|
||||
: base(641, 481)
|
||||
{
|
||||
this.printerConnection = printerConnection;
|
||||
this.presetsContext = presetsContext;
|
||||
this.AlwaysOnTopOfMain = true;
|
||||
this.Title = "Slice Presets Editor".Localize();
|
||||
|
|
@ -154,7 +152,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
},
|
||||
presetsContext.LayerType);
|
||||
|
||||
return new SliceSettingsWidget(printerConnection, settingsContext)
|
||||
return new SliceSettingsWidget(settingsContext)
|
||||
{
|
||||
ShowControlBar = false
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,15 +75,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
private SettingsContext settingsContext;
|
||||
|
||||
private PrinterConnection printerConnection;
|
||||
|
||||
private Dictionary<string, UIField> allUiFields = new Dictionary<string, UIField>();
|
||||
|
||||
private EventHandler unregisterEvents;
|
||||
|
||||
public SliceSettingsWidget(PrinterConnection printerConnection, SettingsContext settingsContext)
|
||||
public SliceSettingsWidget(SettingsContext settingsContext)
|
||||
{
|
||||
this.printerConnection = printerConnection;
|
||||
this.BackgroundColor = ApplicationController.Instance.Theme.TabBodyBackground;
|
||||
|
||||
this.settingsContext = settingsContext;
|
||||
|
|
@ -96,7 +93,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
pageTopToBottomLayout.AnchorAll();
|
||||
this.AddChild(pageTopToBottomLayout);
|
||||
|
||||
settingsControlBar = new PresetsToolbar(printerConnection)
|
||||
settingsControlBar = new PresetsToolbar()
|
||||
{
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Padding = new BorderDouble(8, 12, 8, 8)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue