]> granicus.if.org Git - handbrake/commitdiff
WinGui: Order presets by name. Fixes #1102
authorsr55 <sr55.hb@outlook.com>
Fri, 12 Jan 2018 22:04:13 +0000 (22:04 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 12 Jan 2018 22:04:13 +0000 (22:04 +0000)
win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs

index d3a114376b391b18656e0f1687d33d6254962054..1baa99a602936fe99308f4054b909149f83346f4 100644 (file)
@@ -41,7 +41,7 @@ namespace HandBrakeWPF.Converters
             }
             
             Dictionary<string, MenuItem> groupedMenu = new Dictionary<string, MenuItem>();
-            foreach (IPresetObject item in presets)
+            foreach (IPresetObject item in presets.OrderBy(p => p.Category))
             {
                 PresetDisplayCategory category = item as PresetDisplayCategory;
                 if (category != null)
@@ -103,7 +103,7 @@ namespace HandBrakeWPF.Converters
 
         private void ProcessCategory(Dictionary<string, MenuItem> groupedMenu, PresetDisplayCategory category)
         {
-            foreach (Preset preset in category.Presets)
+            foreach (Preset preset in category.Presets.OrderBy(p => p.Name))
             {
                 this.ProcessPreset(groupedMenu, preset);
             }