diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 43 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 3 |
3 files changed, 46 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 1d013bd26..c93f0005e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -978,7 +978,7 @@ namespace HandBrakeWPF.ViewModels public void Shutdown()
{
// Shutdown Service
- this.queueProcessor.Stop();
+ this.queueProcessor.Stop(true);
this.presetService.SaveCategoryStates();
// Unsubscribe from Events.
@@ -1388,7 +1388,7 @@ namespace HandBrakeWPF.ViewModels public void PauseEncode()
{
- this.queueProcessor.Pause();
+ this.queueProcessor.Pause(true);
this.NotifyOfPropertyChange(() => this.IsEncoding);
}
@@ -1402,7 +1402,7 @@ namespace HandBrakeWPF.ViewModels if (result == MessageBoxResult.Yes)
{
- this.queueProcessor.Stop();
+ this.queueProcessor.Stop(true);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 67e0c3804..ccb79faad 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -227,17 +227,57 @@ namespace HandBrakeWPF.ViewModels public void PauseQueue()
{
- this.queueProcessor.Pause();
+ this.queueProcessor.Pause(true);
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
this.IsQueueRunning = false;
}
+ public void PauseJob(QueueTask task)
+ {
+ if (task != null)
+ {
+ this.queueProcessor.Pause(task);
+ }
+ }
+
public void PauseQueueToolbar()
{
this.PauseQueue();
}
+ public void StopQueue()
+ {
+ if (this.queueProcessor.IsEncoding)
+ {
+ MessageBoxResult result = this.errorService.ShowMessageBox(
+ "There are currently jobs running. Would you like to complete the current jobs before stopping the queue?",
+ "Confirm",
+ MessageBoxButton.YesNoCancel,
+ MessageBoxImage.Question);
+
+ if (result == MessageBoxResult.Yes)
+ {
+ this.queueProcessor.Stop(false);
+ }
+ else if (result == MessageBoxResult.Cancel)
+ {
+ return;
+ }
+ else
+ {
+ this.queueProcessor.Stop(true);
+ }
+ }
+ else
+ {
+ this.queueProcessor.Stop(true);
+ }
+
+ this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
+ this.IsQueueRunning = false;
+ }
+
public void RemoveSelectedJobs()
{
if (this.SelectedItems.Count == 0)
@@ -286,7 +326,6 @@ namespace HandBrakeWPF.ViewModels if (result == MessageBoxResult.Yes)
{
- this.queueProcessor.Stop();
this.queueProcessor.Remove(task);
removed = true;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index 56d8f719f..3e38a35eb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -201,11 +201,12 @@ namespace HandBrakeWPF.ViewModels if (result == MessageBoxResult.Yes)
{
- processor.Stop();
+ processor.Stop(true);
this.MainViewModel?.Shutdown();
return true;
}
+
return false;
}
|