Fixed: Issue where preset parent folder was not initialized correctly.

This commit is contained in:
Adrien Allard committed 2019-05-04 13:31:20 +02:00
1 parent b9756ea8e7
commit 5c2ce17007
4 files changed
+11 -9

No files matched your search

@@ -47,7 +47,7 @@ namespace FileConverter.ConversionJobs
this.intermediateFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + ".png");
// Convert input in png file to send it to ffmpeg for the gif conversion.
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", null, OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
this.pngConversionJob = ConversionJobFactory.Create(intermediatePreset, this.InputFilePath);
this.pngConversionJob.PrepareConversion(this.intermediateFilePath);
@@ -38,7 +38,7 @@ namespace FileConverter.ConversionJobs
this.intermediateFilePath = PathHelpers.GenerateUniquePath(tempPath + fileName + ".png");
// Convert input in png file to send it to ffmpeg for the ico conversion.
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
ConversionPreset intermediatePreset = new ConversionPreset("To compatible image", null, OutputType.Png, this.ConversionPreset.InputTypes.ToArray());
intermediatePreset.SetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2, "True");
intermediatePreset.SetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "256");
this.pngConversionJob = ConversionJobFactory.Create(intermediatePreset, this.InputFilePath);
@@ -32,9 +32,10 @@ namespace FileConverter
this.FullName = Properties.Resources.DefaultPresetName;
}
public ConversionPreset(string fullName, OutputType outputType, params string[] inputTypes)
public ConversionPreset(string shortName, string[] parentFoldersNames, OutputType outputType, params string[] inputTypes)
{
this.FullName = fullName;
this.ShortName = shortName;
this.ParentFoldersNames = parentFoldersNames;
this.OutputType = outputType;
List<string> inputTypeList = new List<string>();
inputTypeList.AddRange(inputTypes);
@@ -43,9 +44,10 @@ namespace FileConverter
this.outputFileNameTemplate = "(p)(f)";
}
public ConversionPreset(string fullName, ConversionPreset source, params string[] additionalInputTypes)
public ConversionPreset(string shortName, ConversionPreset source, params string[] additionalInputTypes)
{
this.FullName = fullName;
this.ShortName = shortName;
this.ParentFoldersNames = source.ParentFoldersNames;
this.OutputType = source.outputType;
List<string> inputTypeList = new List<string>();
if (source.inputTypes != null)
@@ -65,8 +65,8 @@ namespace FileConverter.ViewModels
{
// Code runs in Blend --> create design time data.
this.Settings = new Settings();
this.Settings.ConversionPresets.Add(new ConversionPreset("Test", OutputType.Mp3));
this.SelectedPreset = new ConversionPreset("Test", OutputType.Mp3);
this.Settings.ConversionPresets.Add(new ConversionPreset("Test", null, OutputType.Mp3));
this.SelectedPreset = new ConversionPreset("Test", null, OutputType.Mp3);
}
else
{
@@ -602,7 +602,7 @@ namespace FileConverter.ViewModels
}
else
{
newPreset = new ConversionPreset(presetName, OutputType.Mkv, new string[0]);
newPreset = new ConversionPreset(presetName, parent.FoldersNames, OutputType.Mkv, new string[0]);
}
parent.Children.Insert(insertIndex, newPreset);