From: sr55 Date: Sat, 22 Sep 2018 20:56:29 +0000 (+0100) Subject: WinGui: Add Retry Selected and Retry All Jobs to the Queue List right click menu... X-Git-Tag: 1.2.0~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56042d5a8a9eae3b1127650b79a4604fdeccf4f1;p=handbrake WinGui: Add Retry Selected and Retry All Jobs to the Queue List right click menu. #1087 --- diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index e1e5222c4..c4c264908 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -2258,6 +2258,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Retry All Jobs. + /// + public static string QueueView_ResetAllJobs { + get { + return ResourceManager.GetString("QueueView_ResetAllJobs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Retry Selected Jobs. + /// + public static string QueueView_ResetSelectedJobs { + get { + return ResourceManager.GetString("QueueView_ResetSelectedJobs", resourceCulture); + } + } + /// /// Looks up a localized string similar to Shutdown. /// diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 9f7a186b9..fb2bc3da7 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -1079,6 +1079,12 @@ This will not affect your current settings in the Subtitle tab. The log will be available after the encode completes. + + Retry All Jobs + + + Retry Selected Jobs + Statistics diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index c393176fd..83240d586 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -541,6 +541,28 @@ namespace HandBrakeWPF.ViewModels } } + public void ResetSelectedJobs() + { + foreach (var task in this.SelectedItems) + { + if (task.Status == QueueItemStatus.Completed || task.Status == QueueItemStatus.Error) + { + this.RetryJob(task); + } + } + } + + public void ResetAllJobs() + { + foreach (var task in this.QueueTasks) + { + if (task.Status == QueueItemStatus.Completed || task.Status == QueueItemStatus.Error) + { + this.RetryJob(task); + } + } + } + #endregion #region Methods diff --git a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml index 61acb9962..5df7832d2 100644 --- a/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml +++ b/win/CS/HandBrakeWPF/Views/Queue/QueueTwoContent.xaml @@ -153,6 +153,9 @@ + + +