From: sr55 Date: Sat, 4 Feb 2017 15:51:34 +0000 (+0000) Subject: WinGui: Order By Name R-Click option on Add to queue selection window. X-Git-Tag: 1.1.0~743 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f7de0497ef78699204fd3cfa0282b3076c208b1;p=handbrake WinGui: Order By Name R-Click option on Add to queue selection window. --- diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs index 5e41c0a28..6705670d5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs @@ -30,6 +30,7 @@ namespace HandBrakeWPF.ViewModels private readonly IUserSettingService userSettingService; private bool orderedByDuration; private bool orderedByTitle; + private bool orderedByName; private Action> addToQueue; private string currentPreset; @@ -116,6 +117,23 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether ordered by name. + /// + public bool OrderedByName + { + get + { + return this.orderedByName; + } + + set + { + this.orderedByName = value; + this.NotifyOfPropertyChange(() => OrderedByName); + } + } + /// /// Gets a value indicating whether is auto naming enabled. /// @@ -136,6 +154,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => TitleList); this.OrderedByTitle = true; this.OrderedByDuration = false; + this.OrderedByName = false; } /// @@ -147,6 +166,19 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => TitleList); this.OrderedByTitle = false; this.OrderedByDuration = true; + this.OrderedByName = false; + } + + /// + /// The order by name. + /// + public void OrderByName() + { + TitleList = new BindingList(TitleList.OrderBy(o => o.Title.SourceName).ToList()); + this.NotifyOfPropertyChange(() => TitleList); + this.OrderedByTitle = false; + this.OrderedByDuration = false; + this.OrderedByName = true; } /// diff --git a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml index 977338110..bd1e9bce5 100644 --- a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml @@ -66,6 +66,7 @@ +