Made any save of a file unsure that we put it in the library.
Took out dead CreateCopyInQueue code Made it possible to update the FileLocation of a PrintItem.
This commit is contained in:
parent
398bb55c22
commit
3386bba281
4 changed files with 23 additions and 74 deletions
|
|
@ -33,12 +33,13 @@ using System.Collections.ObjectModel;
|
|||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
|
|
@ -55,9 +56,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public partial class View3DWidget : PartPreview3DWidget
|
||||
{
|
||||
public WindowType windowType { get; set; }
|
||||
public PrintItemWrapper PrintItemWrapper {
|
||||
get { return this.printItemWrapper; }
|
||||
}
|
||||
|
||||
EventHandler SelectionChanged;
|
||||
|
||||
|
|
@ -535,7 +533,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
if (exportingWindowIsOpen == false)
|
||||
{
|
||||
exportingWindow = new ExportPrintItemWindow(this.PrintItemWrapper);//
|
||||
exportingWindow = new ExportPrintItemWindow(this.printItemWrapper);
|
||||
this.exportingWindowIsOpen = true;
|
||||
exportingWindow.Closed += new EventHandler(ExportQueueItemWindow_Closed);
|
||||
exportingWindow.ShowAsSystemWindow();
|
||||
|
|
@ -1686,8 +1684,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
backgroundWorker.ReportProgress(nextPercent);
|
||||
}
|
||||
|
||||
MeshOutputSettings outputInfo = new MeshOutputSettings(MeshOutputSettings.OutputType.Binary, new string[] { "Created By", "MatterControl" });
|
||||
MeshFileIo.Save(asynchMeshGroups, printItemWrapper.FileLocation, outputInfo);
|
||||
if (printItemWrapper.FileLocation.Contains(ApplicationDataStorage.Instance.ApplicationLibraryDataPath))
|
||||
{
|
||||
MeshOutputSettings outputInfo = new MeshOutputSettings(MeshOutputSettings.OutputType.Binary, new string[] { "Created By", "MatterControl" });
|
||||
MeshFileIo.Save(asynchMeshGroups, printItemWrapper.FileLocation, outputInfo);
|
||||
}
|
||||
else // save a copy to the library and update this to point at it
|
||||
{
|
||||
string fileName = Path.ChangeExtension(Path.GetRandomFileName(), ".amf");
|
||||
printItemWrapper.FileLocation = Path.Combine(ApplicationDataStorage.Instance.ApplicationLibraryDataPath, fileName);
|
||||
|
||||
MeshOutputSettings outputInfo = new MeshOutputSettings(MeshOutputSettings.OutputType.Binary, new string[] { "Created By", "MatterControl" });
|
||||
MeshFileIo.Save(asynchMeshGroups, printItemWrapper.FileLocation, outputInfo);
|
||||
|
||||
printItemWrapper.PrintItem.Commit();
|
||||
}
|
||||
|
||||
printItemWrapper.OnFileHasChanged();
|
||||
}
|
||||
catch (System.UnauthorizedAccessException)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue