Making error messages coming back as list

fixing regression with dialog window showing as markdown (there were
assumptions on it not being markdown)
This commit is contained in:
Lars Brubaker 2019-01-03 16:58:05 -08:00
parent 45b1a32e03
commit 34b57c43b0
13 changed files with 127 additions and 141 deletions

View file

@ -226,7 +226,7 @@ namespace MatterHackers.MatterControl
savePath += targetExtension;
}
ExportResult exportResult = ExportResult.Failure;
List<string> exportErrors = null;
if (activePlugin != null)
{
@ -234,18 +234,18 @@ namespace MatterHackers.MatterControl
{
gCodeExport.CenterOnBed = centerOnBed;
}
exportResult = await activePlugin.Generate(libraryItems, savePath, reporter, cancellationToken);
exportErrors = await activePlugin.Generate(libraryItems, savePath, reporter, cancellationToken);
}
if (exportResult == ExportResult.Success)
if (exportErrors == null || exportErrors.Count == 0)
{
ShowFileIfRequested(savePath);
}
else if(exportResult == ExportResult.Failure)
else
{
UiThread.RunOnIdle(() =>
{
StyledMessageBox.ShowMessageBox("Export failed".Localize(), title);
StyledMessageBox.ShowMessageBox(String.Join("\n\n\n\n", exportErrors.ToArray()), "Export Error".Localize());
});
}
});