Copy the thumbnail image, for the default queue parts if available
Fixed spelling Made the ray tracer multi thread when not printing Changed 'don't ask me again' to 'don't remind me again' Added a thumbnail for the MatterControl coin
This commit is contained in:
parent
eb30c8de33
commit
5637e25d9e
7 changed files with 33 additions and 4 deletions
|
|
@ -280,11 +280,34 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
|
||||
// Finally, make sure that we always add at least one item to the queue.
|
||||
QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(Path.GetFileNameWithoutExtension(tempFilesToImport[0]), tempFilesToImport[0])));
|
||||
PreLoadItemToQueue(tempFilesToImport[0]);
|
||||
|
||||
PreloadingCalibrationFiles = false;
|
||||
}
|
||||
|
||||
private void PreLoadItemToQueue(string fileDest)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(fileDest)
|
||||
&& File.Exists(fileDest))
|
||||
{
|
||||
PrintItemWrapper printItemToAdd = new PrintItemWrapper(new PrintItem(Path.GetFileNameWithoutExtension(fileDest), fileDest));
|
||||
|
||||
// check if there is a thumbnail image for this file and load it into the user cache if so
|
||||
string justThumbFile = Path.ChangeExtension(Path.GetFileNameWithoutExtension(fileDest), ".png");
|
||||
string applicationUserDataPath = StaticData.Instance.MapPath(Path.Combine("OEMSettings", "SampleParts"));
|
||||
string thumbnailSourceFile = Path.Combine(applicationUserDataPath, justThumbFile);
|
||||
if (File.Exists(thumbnailSourceFile))
|
||||
{
|
||||
string thumbnailDestFile = PartThumbnailWidget.GetImageFileName(printItemToAdd);
|
||||
|
||||
// copy it to the right place
|
||||
File.Copy(thumbnailSourceFile, thumbnailDestFile);
|
||||
}
|
||||
|
||||
QueueData.Instance.AddItem(printItemToAdd);
|
||||
}
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetCollectionItem(int collectionIndex)
|
||||
{
|
||||
return childCollections[collectionIndex];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue