Adding ability to cancel rebuilding
This commit is contained in:
parent
aa795f1d3b
commit
dd3912a504
86 changed files with 257 additions and 67 deletions
|
|
@ -230,12 +230,12 @@ namespace MatterHackers.MatterControl
|
|||
ApplicationController.Instance.Tasks.Execute(
|
||||
"Saving".Localize() + "...",
|
||||
printer,
|
||||
async (reporter, cancellationToken) =>
|
||||
async (reporter, cancellationTokenSource) =>
|
||||
{
|
||||
string path = openParams.FolderPath;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
await exportPlugin.Generate(libraryItems, path, reporter, cancellationToken);
|
||||
await exportPlugin.Generate(libraryItems, path, reporter, cancellationTokenSource.Token);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -264,7 +264,7 @@ namespace MatterHackers.MatterControl
|
|||
ApplicationController.Instance.Tasks.Execute(
|
||||
"Exporting".Localize() + "...",
|
||||
printer,
|
||||
async (reporter, cancellationToken) =>
|
||||
async (reporter, cancellationTokenSource) =>
|
||||
{
|
||||
string extension = Path.GetExtension(savePath);
|
||||
if (!extension.Equals(targetExtension, StringComparison.OrdinalIgnoreCase))
|
||||
|
|
@ -281,7 +281,7 @@ namespace MatterHackers.MatterControl
|
|||
gCodeExport.CenterOnBed = centerOnBed;
|
||||
}
|
||||
|
||||
exportErrors = await exportPlugin.Generate(libraryItems, savePath, reporter, cancellationToken);
|
||||
exportErrors = await exportPlugin.Generate(libraryItems, savePath, reporter, cancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
if (exportErrors == null || exportErrors.Count == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue