diff options
author | sr55 <[email protected]> | 2017-02-04 15:51:34 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-02-04 15:51:34 +0000 |
commit | 3f7de0497ef78699204fd3cfa0282b3076c208b1 (patch) | |
tree | 3e388a54d731d37d14c6e658da4e39489c7e0c0c /win/CS/HandBrakeWPF | |
parent | 41a737dc5f73013d245d8d64ca2461551adfcf75 (diff) |
WinGui: Order By Name R-Click option on Add to queue selection window.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs | 32 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml | 1 |
2 files changed, 33 insertions, 0 deletions
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<IEnumerable<SelectionTitle>> addToQueue;
private string currentPreset;
@@ -117,6 +118,23 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Gets or sets a value indicating whether ordered by name.
+ /// </summary>
+ public bool OrderedByName
+ {
+ get
+ {
+ return this.orderedByName;
+ }
+
+ set
+ {
+ this.orderedByName = value;
+ this.NotifyOfPropertyChange(() => OrderedByName);
+ }
+ }
+
+ /// <summary>
/// Gets a value indicating whether is auto naming enabled.
/// </summary>
public bool IsAutoNamingEnabled
@@ -136,6 +154,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => TitleList);
this.OrderedByTitle = true;
this.OrderedByDuration = false;
+ this.OrderedByName = false;
}
/// <summary>
@@ -147,6 +166,19 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => TitleList);
this.OrderedByTitle = false;
this.OrderedByDuration = true;
+ this.OrderedByName = false;
+ }
+
+ /// <summary>
+ /// The order by name.
+ /// </summary>
+ public void OrderByName()
+ {
+ TitleList = new BindingList<SelectionTitle>(TitleList.OrderBy(o => o.Title.SourceName).ToList());
+ this.NotifyOfPropertyChange(() => TitleList);
+ this.OrderedByTitle = false;
+ this.OrderedByDuration = false;
+ this.OrderedByName = true;
}
/// <summary>
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 @@ <Separator />
<MenuItem Header="Order by Title" IsChecked="{Binding OrderedByTitle}" cal:Message.Attach="[Event Click] = [Action OrderByTitle]" />
<MenuItem Header="Order by Duration" IsChecked="{Binding OrderedByDuration}" cal:Message.Attach="[Event Click] = [Action OrderByDuration]" />
+ <MenuItem Header="Order by Name" IsChecked="{Binding OrderedByName}" cal:Message.Attach="[Event Click] = [Action OrderByName]" />
</ContextMenu>
</ListBox.ContextMenu>
|