improving item button logic
fix spelling
This commit is contained in:
parent
90934aa04f
commit
2026bb220c
9 changed files with 18 additions and 11 deletions
|
|
@ -766,7 +766,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
SlicerConfigName = SettingsKey.has_c_axis,
|
||||
PresentationName = "Has C Axis".Localize(),
|
||||
HelpText = "The printer has a c axis used by too changer (e3d quad extruder).".Localize(),
|
||||
HelpText = "The printer has a c axis used by a tool changer (e3d quad extruder).".Localize(),
|
||||
DataEditType = DataEditTypes.CHECK_BOX,
|
||||
ShowAsOverride = true,
|
||||
RequiredDisplayDetail = DisplayDetailRequired.Advanced,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,10 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
|
||||
public string HelpText { get; set; }
|
||||
|
||||
public Action<GuiWidget> SetStates { get; set; }
|
||||
/// <summary>
|
||||
/// First parameter is the actual button, second parameter is the row containing the button
|
||||
/// </summary>
|
||||
public Action<GuiWidget, GuiWidget> SetStates { get; set; }
|
||||
|
||||
public Action Action { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,13 +178,14 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
Margin = 5,
|
||||
ToolTipText = editorButtonData.HelpText,
|
||||
};
|
||||
editorButtonData.SetStates(editorButton);
|
||||
var row = new SettingsRow("".Localize(), null, editorButton, theme);
|
||||
editorButtonData.SetStates(editorButton, row);
|
||||
editorButton.Click += (s, e) =>
|
||||
{
|
||||
editorButtonData.Action?.Invoke();
|
||||
};
|
||||
|
||||
mainContainer.AddChild(new SettingsRow("".Localize(), null, editorButton, theme));
|
||||
mainContainer.AddChild(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
: base(theme)
|
||||
{
|
||||
this.nextButtonEnabled = nextButtonEnabled;
|
||||
this.ExistingPrinterNames = ProfileManager.Instance.ActiveProfiles.Select(p => p.Name).ToList();
|
||||
this.ExistingPrinterNames = new HashSet<string>(ProfileManager.Instance.ActiveProfiles.Select(p => p.Name));
|
||||
this.Name = "AddPrinterWidget";
|
||||
|
||||
horizontalSplitter.Panel2.Padding = theme.DefaultContainerPadding;
|
||||
|
|
@ -166,7 +166,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
}
|
||||
}
|
||||
|
||||
public IReadOnlyList<string> ExistingPrinterNames { get; private set; }
|
||||
public HashSet<string> ExistingPrinterNames { get; private set; }
|
||||
|
||||
public TextWidget PrinterNameError { get; private set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
// Copy selected item
|
||||
IObject3D newItem = await Task.Run(() =>
|
||||
{
|
||||
var namedItems = new HashSet<string>(scene.DescendantsAndSelf().Select((d) => d.Name));
|
||||
if (sourceItem != null)
|
||||
{
|
||||
if (sourceItem is SelectionGroupObject3D)
|
||||
|
|
@ -249,7 +250,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
var clonedItem = item.Clone();
|
||||
clonedItem.Translate(xOffset);
|
||||
// make the name unique
|
||||
var newName = agg_basics.GetNonCollidingName(item.Name, scene.DescendantsAndSelf().Select((d) => d.Name));
|
||||
var newName = agg_basics.GetNonCollidingName(item.Name, namedItems);
|
||||
clonedItem.Name = newName;
|
||||
// add it to the scene
|
||||
scene.Children.Add(clonedItem);
|
||||
|
|
@ -266,7 +267,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
if (!string.IsNullOrWhiteSpace(sourceItem.Name))
|
||||
{
|
||||
// make the name unique
|
||||
var newName = agg_basics.GetNonCollidingName(sourceItem.Name, scene.DescendantsAndSelf().Select((d) => d.Name));
|
||||
var newName = agg_basics.GetNonCollidingName(sourceItem.Name, namedItems);
|
||||
clonedItem.Name = newName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
|
||||
string fileName = Path.GetFileNameWithoutExtension(settingsFilePath);
|
||||
var existingPrinterNames = Instance.ActiveProfiles.Select(p => p.Name);
|
||||
var existingPrinterNames = new HashSet<string>(Instance.ActiveProfiles.Select(p => p.Name));
|
||||
|
||||
var printerInfo = new PrinterInfo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
duplicateButton.Click += (s, e) =>
|
||||
{
|
||||
string sanitizedName = numberMatch.Replace(inlineNameEdit.Text, "").Trim();
|
||||
string newProfileName = agg_basics.GetNonCollidingName(sanitizedName, presetsContext.PresetLayers.Select(preset => preset.ValueOrDefault(SettingsKey.layer_name)));
|
||||
string newProfileName = agg_basics.GetNonCollidingName(sanitizedName, new HashSet<string>(presetsContext.PresetLayers.Select(preset => preset.ValueOrDefault(SettingsKey.layer_name))));
|
||||
|
||||
var clonedLayer = presetsContext.PersistenceLayer.Clone();
|
||||
clonedLayer.Name = newProfileName;
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ namespace MatterHackers.MatterControl
|
|||
ApplicationVersion = VersionInfo.Instance.ReleaseVersion
|
||||
};
|
||||
|
||||
#if !DEBUG
|
||||
if (AggContext.OperatingSystem == OSType.Windows)
|
||||
{
|
||||
waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset, "MatterControl#Startup", out bool created);
|
||||
|
|
@ -147,6 +148,7 @@ namespace MatterHackers.MatterControl
|
|||
"Service started: {0};",
|
||||
string.Join(", ", serviceHost.Description.Endpoints.Select(s => s.ListenUri.AbsoluteUri).ToArray()));
|
||||
}
|
||||
#endif
|
||||
|
||||
// If MatterControl isn't running and valid files were shelled, schedule a StartupAction to open the files after load
|
||||
var shellFiles = args.Where(f => File.Exists(f) && shellFileExtensions.Contains(Path.GetExtension(f).ToLower()));
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit c7866db87cc4a8d1a7e0ae074d30b4a2986f7f0e
|
||||
Subproject commit 9693c16ef9df11e1ebb3a4ea5a2bf94916341207
|
||||
Loading…
Add table
Add a link
Reference in a new issue