From 8644f55a4e49256e684f92a30d50cd70a32339b4 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 24 Jun 2012 12:30:28 +0000 Subject: WinGui: Assorted Fixes git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4773 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 46 ++-------------------- 1 file changed, 4 insertions(+), 42 deletions(-) (limited to 'win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs') diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index ff402a9ed..bb2bff804 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1393,6 +1393,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedLangaugesToMove = new BindingList(); IDictionary langList = LanguageUtilities.MapLanguages(); + langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); this.selectedLangauges.Clear(); foreach (string selectedItem in this.userSettingService.GetUserSetting(UserSettingConstants.SelectedLanguages)) @@ -1553,7 +1554,7 @@ namespace HandBrakeWPF.ViewModels /// public void LanguageMoveLeft() { - if (this.SelectedLangauges.Count > 0) + if (this.SelectedAvailableToMove.Count > 0) { List copiedList = SelectedAvailableToMove.ToList(); foreach (string item in copiedList) @@ -1580,6 +1581,8 @@ namespace HandBrakeWPF.ViewModels this.AvailableLanguages.Add(item); } } + + this.AvailableLanguages = new BindingList(this.AvailableLanguages.OrderBy(o => o).ToList()); } /// @@ -1596,47 +1599,6 @@ namespace HandBrakeWPF.ViewModels this.SelectedLangauges.Clear(); } - /// - /// Audio List Language Move UP - /// - public void LanguageMoveUp() - { - List langauges = this.SelectedLangauges.ToList(); - foreach (string item in langauges) - { - if (this.SelectedLangaugesToMove.Contains(item)) - { - int index = this.SelectedLangauges.IndexOf(item); - if (index != 0) - { - this.SelectedLangauges.Remove(item); - this.SelectedLangauges.Insert(index - 1, item); - } - } - } - } - - /// - /// Audio List Language Move Down - /// - public void LanguageMoveDown() - { - List langauges = this.SelectedLangauges.ToList(); - int count = this.SelectedLangauges.Count; - foreach (string item in langauges) - { - if (this.SelectedLangaugesToMove.Contains(item)) - { - int index = this.SelectedLangauges.IndexOf(item); - if ((index + 1) != count) - { - this.SelectedLangauges.Remove(item); - this.SelectedLangauges.Insert(index + 1, item); - } - } - } - } - /// /// Browse - Log Path /// -- cgit v1.2.3