From: sr55 Date: Sun, 24 Jun 2012 12:30:28 +0000 (+0000) Subject: WinGui: Assorted Fixes X-Git-Tag: 0.9.9~540 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8644f55a4e49256e684f92a30d50cd70a32339b4;p=handbrake WinGui: Assorted Fixes git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4773 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs index ff56be2dc..59010c2a3 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs @@ -1,7 +1,11 @@ -/* LanguageUtilities.cs $ - This file is part of the HandBrake source code. - Homepage: . - It may be used under the terms of the GNU General Public License. */ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Language Utilities +// +// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Utilities { diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index a47b6c8c0..fe1e333eb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -107,6 +107,11 @@ namespace HandBrakeWPF.ViewModels /// private string statusLabel; + /// + /// Program Status Label + /// + private string programStatusLabel; + /// /// Backing field for the scanned source. /// @@ -251,6 +256,27 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets the Program Status Toolbar Label + /// This indicates the status of HandBrake + /// + public string ProgramStatusLabel + { + get + { + return string.IsNullOrEmpty(this.programStatusLabel) ? "Ready" : this.programStatusLabel; + } + + set + { + if (!Equals(this.statusLabel, value)) + { + this.programStatusLabel = value; + this.NotifyOfPropertyChange(() => this.ProgramStatusLabel); + } + } + } + /// /// Gets or sets the Program Status Toolbar Label /// This indicates the status of HandBrake @@ -913,7 +939,7 @@ namespace HandBrakeWPF.ViewModels if (!this.IsEncoding) { - this.StatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count); + this.ProgramStatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count); } } @@ -1463,7 +1489,6 @@ namespace HandBrakeWPF.ViewModels this.StatusLabel = "Scanning source, please wait..."; this.ShowStatusWindow = true; }); - // TODO - Disable relevant parts of the UI. } /// @@ -1480,7 +1505,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.StatusLabel = + this.ProgramStatusLabel = string.Format( "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}", e.PercentComplete, @@ -1506,7 +1531,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.StatusLabel = "Preparing to encode ..."; + this.ProgramStatusLabel = "Preparing to encode ..."; this.IsEncoding = true; }); @@ -1544,7 +1569,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.StatusLabel = "Queue Finished"; + this.ProgramStatusLabel = "Queue Finished"; this.IsEncoding = false; }); 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 /// diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index a4bce1863..1d00b3cf4 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -30,7 +30,6 @@ @@ -634,7 +632,7 @@ Padding="0" >