Show error messages when exporting files fails
This commit is contained in:
parent
6c4a2eeb7d
commit
dae087f87f
2 changed files with 67 additions and 11 deletions
|
|
@ -379,9 +379,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
},
|
||||
(saveParams) =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
try
|
||||
{
|
||||
File.WriteAllText(saveParams.FileName, JsonConvert.SerializeObject(printerSettings, Formatting.Indented));
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
{
|
||||
File.WriteAllText(saveParams.FileName, JsonConvert.SerializeObject(printerSettings, Formatting.Indented));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UiThread.RunOnIdle (() => {
|
||||
StyledMessageBox.ShowMessageBox(null, e.Message, "Couldn't save file".Localize());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -395,9 +404,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
},
|
||||
(saveParams) =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
try
|
||||
{
|
||||
GenerateConfigFile(saveParams.FileName, false);
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
{
|
||||
GenerateConfigFile(saveParams.FileName, false);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UiThread.RunOnIdle (() => {
|
||||
StyledMessageBox.ShowMessageBox(null, e.Message, "Couldn't save file".Localize());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue