Inline 'Success' method
This commit is contained in:
parent
a94523e6d5
commit
6bc8dc9c16
2 changed files with 12 additions and 13 deletions
|
|
@ -197,7 +197,16 @@ namespace MatterHackers.MatterControl
|
|||
printer.Settings.Merge(printerSettingsLayer, settingsToImport, sourceFilter, copyName);
|
||||
|
||||
var layerName = (printerSettingsLayer.ContainsKey(SettingsKey.layer_name)) ? printerSettingsLayer[SettingsKey.layer_name] : "none";
|
||||
Success(settingsFilePath, layerName, destIsMaterial ? "Material".Localize() : "Quality".Localize());
|
||||
|
||||
string sectionName = destIsMaterial ? "Material".Localize() : "Quality".Localize();
|
||||
|
||||
string importSettingSuccessMessage = $"You have successfully imported a new {sectionName} setting. You can find '{layerName}' in your list of {sectionName} settings.".Localize();
|
||||
|
||||
WizardWindow.ChangeToPage(
|
||||
new ImportSucceeded(importSettingSuccessMessage)
|
||||
{
|
||||
WizardWindow = this.WizardWindow,
|
||||
});
|
||||
|
||||
if (destIsMaterial)
|
||||
{
|
||||
|
|
@ -221,17 +230,6 @@ namespace MatterHackers.MatterControl
|
|||
this.AddPageAction(mergeButton);
|
||||
}
|
||||
|
||||
private void Success(string settingsFilePath, string sourceName, string sectionName)
|
||||
{
|
||||
string importSettingSuccessMessage = $"You have successfully imported a new {sectionName} setting. You can find '{sourceName}' in your list of {sectionName} settings.".Localize();
|
||||
|
||||
WizardWindow.ChangeToPage(
|
||||
new ImportSucceeded(importSettingSuccessMessage)
|
||||
{
|
||||
WizardWindow = this.WizardWindow,
|
||||
});
|
||||
}
|
||||
|
||||
private static void DisplayFailedToImportMessage(string settingsFilePath)
|
||||
{
|
||||
StyledMessageBox.ShowMessageBox("Oops! Settings file '{0}' did not contain any settings we could import.".Localize().FormatWith(Path.GetFileName(settingsFilePath)), "Unable to Import".Localize());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue