diff --git a/MatterControlLib/ApplicationView/Config/ThumbnailsConfig.cs b/MatterControlLib/ApplicationView/Config/ThumbnailsConfig.cs index 4369ad0ec..b5b8cd855 100644 --- a/MatterControlLib/ApplicationView/Config/ThumbnailsConfig.cs +++ b/MatterControlLib/ApplicationView/Config/ThumbnailsConfig.cs @@ -178,7 +178,7 @@ namespace MatterHackers.MatterControl CacheFilename(libraryItem, width, height)); } - internal void QueueForGeneration(Func func) + public void QueueForGeneration(Func func) { lock (ThumbsLock) { diff --git a/MatterControlLib/Library/Providers/FileSystem/SceneReplacementFileItem.cs b/MatterControlLib/Library/Providers/FileSystem/SceneReplacementFileItem.cs deleted file mode 100644 index 946c529f6..000000000 --- a/MatterControlLib/Library/Providers/FileSystem/SceneReplacementFileItem.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright (c) 2017, John Lewin -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - - -namespace MatterHackers.MatterControl.Library -{ - public class SceneReplacementFileItem : FileSystemFileItem - { - public SceneReplacementFileItem(string filePath) - : base(filePath) - { - } - } -} diff --git a/MatterControlLib/Library/Providers/LibraryConfig.cs b/MatterControlLib/Library/Providers/LibraryConfig.cs index 2605a0a3c..673c0e678 100644 --- a/MatterControlLib/Library/Providers/LibraryConfig.cs +++ b/MatterControlLib/Library/Providers/LibraryConfig.cs @@ -207,11 +207,13 @@ namespace MatterHackers.MatterControl.Library && ApplicationSettings.ValidFileExtensions.Contains(fileExtensionLower); } - public async Task LoadItemThumbnail(Action thumbnailListener, Action buildThumbnail, ILibraryItem libraryItem, ILibraryContainer libraryContainer, int thumbWidth, int thumbHeight, ThemeConfig theme) + public async Task LoadItemThumbnail(Action thumbnailListenerIn, Action buildThumbnail, ILibraryItem libraryItem, ILibraryContainer libraryContainer, int thumbWidth, int thumbHeight, ThemeConfig theme) { async void setItemThumbnail(ImageBuffer icon) { - if (icon != null) + var thumbnailListener = thumbnailListenerIn; + + if (icon != null) { if (icon.Width == 0) { diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index 7afbc88b0..196409821 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -1233,7 +1233,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if ((firstItem is ILibraryAssetStream contentStream && contentStream.ContentType == "gcode") - || firstItem is SceneReplacementFileItem) + || firstItem is FileSystemFileItem) { DragDropObject = null; this.SceneReplacement = firstItem as ILibraryAssetStream; diff --git a/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs b/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs index 5d4923d25..51a99b5a8 100644 --- a/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs +++ b/MatterControlLib/PartPreviewWindow/ViewToolBarControls.cs @@ -610,7 +610,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow int maxItemWidth = 0; var recentFiles = new DirectoryInfo(ApplicationDataStorage.Instance.PlatingDirectory).GetFiles("*.mcx").OrderByDescending(f => f.LastWriteTime); - foreach (var item in recentFiles.Where(f => f.Length > 215).Select(f => new SceneReplacementFileItem(f.FullName)).Take(12)) + foreach (var item in recentFiles.Where(f => f.Length > 215).Select(f => new FileSystemFileItem(f.FullName)).Take(12)) { var imageBuffer = new ImageBuffer(thumbWidth, thumbWidth);