diff --git a/Application/FileConverter/ConversionPreset/ConversionPreset.cs b/Application/FileConverter/ConversionPreset/ConversionPreset.cs index 2b3657a..38add56 100644 --- a/Application/FileConverter/ConversionPreset/ConversionPreset.cs +++ b/Application/FileConverter/ConversionPreset/ConversionPreset.cs @@ -96,6 +96,13 @@ namespace FileConverter } } + [XmlAttribute] + public bool IsDefaultSettings + { + get; + set; + } = false; + [XmlElement] public List InputTypes { diff --git a/Application/FileConverter/Settings.cs b/Application/FileConverter/Settings.cs index 83e126c..4544160 100644 --- a/Application/FileConverter/Settings.cs +++ b/Application/FileConverter/Settings.cs @@ -129,10 +129,25 @@ namespace FileConverter System.IO.File.Delete(userFilePath); } - if (userSettings != null && userSettings.SerializationVersion != Version) + if (userSettings != null) { - Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version); - userSettings.SerializationVersion = Version; + if (userSettings.SerializationVersion != Version) + { + Diagnostics.Debug.Log("File converter settings has been imported from version {0} to version {1}.", userSettings.SerializationVersion, Version); + userSettings.SerializationVersion = Version; + } + + // Remove default settings. + if (userSettings.ConversionPresets != null) + { + for (int index = userSettings.ConversionPresets.Count - 1; index >= 0; index--) + { + if (userSettings.ConversionPresets[index].IsDefaultSettings) + { + userSettings.ConversionPresets.RemoveAt(index); + } + } + } } } @@ -468,7 +483,7 @@ namespace FileConverter { return this; } - + for (int index = 0; index < settings.conversionPresets.Count; index++) { ConversionPreset conversionPreset = settings.conversionPresets[index]; diff --git a/Application/FileConverter/Settings.default.xml b/Application/FileConverter/Settings.default.xml index 9e1facd..4b1c9d6 100644 --- a/Application/FileConverter/Settings.default.xml +++ b/Application/FileConverter/Settings.default.xml @@ -2,7 +2,7 @@ true 3 - + 3gp avi bik @@ -21,7 +21,7 @@ (p)(f) - + avi bik flv @@ -40,7 +40,7 @@ (p)(f) - + avi bik flv @@ -59,7 +59,7 @@ (p)(f) - + avi bik flv @@ -78,7 +78,7 @@ (p)(f) - + avi bik flv @@ -97,7 +97,7 @@ (p)(f) - + avi bik flv @@ -115,7 +115,7 @@ (p)(f) - + aac aiff ape @@ -138,7 +138,7 @@ (p)(f) - + avi bik flv @@ -155,7 +155,7 @@ None (p)(f) - + aac aiff ape @@ -178,7 +178,7 @@ (p)(f) - + aac aiff ape @@ -202,7 +202,7 @@ (p)(f) - + aiff ape m4a @@ -225,25 +225,25 @@ (p)(f) - + cda None (p:m)CDA Extraction\(f) - + cda None (p:m)CDA Extraction\(f) - + cda None (p:m)CDA Extraction\(f) - + bmp exr ico @@ -262,7 +262,7 @@ (p)(f) - + bmp exr ico @@ -281,7 +281,7 @@ (p)(f)-small - + bmp exr ico @@ -299,7 +299,7 @@ (p)(f) - + bmp exr ico @@ -317,7 +317,7 @@ (p)(f) - + bmp exr ico @@ -336,7 +336,7 @@ (p)(f) - + bmp exr ico