diff --git a/AboutPage/AboutPage.cs b/AboutPage/AboutPage.cs index 056fb1ba3..fe8bd4ba6 100644 --- a/AboutPage/AboutPage.cs +++ b/AboutPage/AboutPage.cs @@ -370,15 +370,42 @@ namespace MatterHackers.MatterControl } } - // Enumerate every file and if it is a mesh file or image file and not in our list, delete it. - foreach (string file in Directory.EnumerateFiles(userDataPath, "*.*", SearchOption.AllDirectories)) + // If the count is less than 0 then we have never run and we need to populate the library and queue still. So don't delete anything yet. + if (referencedPrintItemsFilePaths.Count > 0) + { + CleanDirectory(userDataPath, referencedPrintItemsFilePaths, referencedThumbnailFiles); + } + } + + static int CleanDirectory(string path, HashSet referencedPrintItemsFilePaths, HashSet referencedThumbnailFiles) + { + int contentCount = 0; + foreach (string directory in Directory.EnumerateDirectories(path)) + { + int directoryContentCount = CleanDirectory(directory, referencedPrintItemsFilePaths, referencedThumbnailFiles); + if (directoryContentCount == 0) + { + Directory.Delete(directory); + } + else + { + // it has a directory that has content + contentCount++; + } + } + + foreach (string file in Directory.EnumerateFiles(path, "*.*")) { switch (Path.GetExtension(file).ToUpper()) { case ".STL": case ".AMF": case ".GCODE": - if (!referencedPrintItemsFilePaths.Contains(file)) + if (referencedPrintItemsFilePaths.Contains(file)) + { + contentCount++; + } + else { File.Delete(file); } @@ -386,7 +413,11 @@ namespace MatterHackers.MatterControl case ".PNG": case ".TGA": - if (!referencedThumbnailFiles.Contains(file)) + if (referencedThumbnailFiles.Contains(file)) + { + contentCount++; + } + else { File.Delete(file); } @@ -394,11 +425,17 @@ namespace MatterHackers.MatterControl case ".JSON": // may want to clean these up eventually + contentCount++; // if we delete these we should not incement this + break; + + default: + // we have something in the directory that we are not going to delete + contentCount++; break; } } - // We could also clean up any empty directories. + return contentCount; } #if false // kevin code 2014 04 22 diff --git a/ApplicationView/MainApplicationWidget.cs b/ApplicationView/MainApplicationWidget.cs index 611ed0ec3..cfcb79878 100644 --- a/ApplicationView/MainApplicationWidget.cs +++ b/ApplicationView/MainApplicationWidget.cs @@ -58,8 +58,7 @@ namespace MatterHackers.MatterControl public abstract void AddElements(); public abstract void HideTopContainer(); - public abstract void ToggleTopContainer(); - + public abstract void ToggleTopContainer(); } public class CompactApplicationView : ApplicationView @@ -153,10 +152,8 @@ namespace MatterHackers.MatterControl public TopContainerWidget() : base(FlowDirection.TopToBottom) { - } - public void SetOriginalHeight() { originalHeight = this.Height; diff --git a/PartPreviewWindow/BaseClasses/PartPreview3DWidget.cs b/PartPreviewWindow/BaseClasses/PartPreview3DWidget.cs index 6ee871a8a..9bb771d17 100644 --- a/PartPreviewWindow/BaseClasses/PartPreview3DWidget.cs +++ b/PartPreviewWindow/BaseClasses/PartPreview3DWidget.cs @@ -130,8 +130,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow protected static SolidSlider InsertUiForSlider(FlowLayoutWidget wordOptionContainer, string header, double min = 0, double max = .5) { - double scrollBarWidth = 10; - TextWidget spacingText = new TextWidget(header, textColor: ActiveTheme.Instance.PrimaryTextColor); + double scrollBarWidth = 10; + if (ActiveTheme.Instance.DisplayMode == ActiveTheme.ApplicationDisplayType.Touchscreen) + { + scrollBarWidth = 20; + } + + TextWidget spacingText = new TextWidget(header, textColor: ActiveTheme.Instance.PrimaryTextColor); spacingText.Margin = new BorderDouble(10, 3, 3, 5); spacingText.HAnchor = HAnchor.ParentLeft; wordOptionContainer.AddChild(spacingText); diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index f9cee21c7..808295ed1 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -817,7 +817,7 @@ { "SlicerConfigName": "start_gcode", "PresentationName": "Start G-Code", - "HelpText": "This gcode will be inserted into the output right after the temperature setting. If you have the commands to set temperature in this section they will not be generated outside of this section. You can also include values from other settings such as [first_layer_temperature].", + "HelpText": "This gcode will be inserted into the output right after the temperature setting. If you have the commands to set temperature in this section they will not be generated outside of this section. You can also include values from other settings such as [temperature].", "DataEditType": "MULTI_LINE_TEXT", "ExtraSettings": "" }, diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index b1ac94d5e..a5a122e22 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3122,3 +3122,6 @@ Translated:Heat Before Homing English:Clear Print History Translated:Clear Print History +English:This gcode will be inserted into the output right after the temperature setting. If you have the commands to set temperature in this section they will not be generated outside of this section. You can also include values from other settings such as [temperature]. +Translated:This gcode will be inserted into the output right after the temperature setting. If you have the commands to set temperature in this section they will not be generated outside of this section. You can also include values from other settings such as [temperature]. +