summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-05-27 19:46:55 +0100
committersr55 <[email protected]>2017-05-27 19:47:08 +0100
commit05faa1f855472e8783905b7fa2a8ce1ad4267722 (patch)
treef7b786b7acd59a92a55c317cd2caf7b39557a481 /win/CS/HandBrakeWPF/ViewModels
parentd9c418e08089da33d6580cdba32439866fb12924 (diff)
WinGui: Add a log message whent he queue is paused due to low disk space. Improve handling of automated queue pausing. #748
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs16
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs36
2 files changed, 27 insertions, 25 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index c8a59bbbc..5056f99a6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -205,6 +205,7 @@ namespace HandBrakeWPF.ViewModels
this.scanService.ScanCompleted += this.ScanCompleted;
this.scanService.ScanStatusChanged += this.ScanStatusChanged;
this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
+ this.queueProcessor.QueuePaused += this.QueueProcessor_QueuePaused;
this.queueProcessor.QueueCompleted += this.QueueCompleted;
this.queueProcessor.QueueChanged += this.QueueChanged;
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
@@ -1318,6 +1319,7 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.QueueCompleted -= this.QueueCompleted;
this.queueProcessor.QueueChanged -= this.QueueChanged;
this.queueProcessor.JobProcessingStarted -= this.QueueProcessorJobProcessingStarted;
+ this.queueProcessor.QueuePaused -= this.QueueProcessor_QueuePaused;
this.queueProcessor.EncodeService.EncodeStatusChanged -= this.EncodeStatusChanged;
this.userSettingService.SettingChanged -= this.UserSettingServiceSettingChanged;
}
@@ -2528,6 +2530,20 @@ namespace HandBrakeWPF.ViewModels
}
this.ProgramStatusLabel = Resources.Main_QueueFinished + errorDesc;
+
+ if (this.windowsSeven.IsWindowsSeven)
+ {
+ this.windowsSeven.SetTaskBarProgressToNoProgress();
+ }
+ });
+ }
+
+ private void QueueProcessor_QueuePaused(object sender, EventArgs e)
+ {
+ Execute.OnUIThread(
+ () =>
+ {
+ this.ProgramStatusLabel = Resources.Main_QueuePaused;
this.IsEncoding = false;
if (this.windowsSeven.IsWindowsSeven)
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 2267c1a44..0c984e032 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -459,6 +459,7 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;
this.queueProcessor.QueueChanged += this.QueueManager_QueueChanged;
this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
+ this.queueProcessor.QueuePaused += this.QueueProcessor_QueuePaused;
}
public void Deactivate()
@@ -466,6 +467,7 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.QueueCompleted -= this.queueProcessor_QueueCompleted;
this.queueProcessor.QueueChanged -= this.QueueManager_QueueChanged;
this.queueProcessor.JobProcessingStarted -= this.QueueProcessorJobProcessingStarted;
+ this.queueProcessor.QueuePaused -= this.QueueProcessor_QueuePaused;
}
/// <summary>
@@ -480,7 +482,7 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeService_EncodeStatusChanged;
this.queueProcessor.EncodeService.EncodeCompleted += this.EncodeService_EncodeCompleted;
this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
- this.queueProcessor.LowDiskspaceDetected += this.QueueProcessor_LowDiskspaceDetected;
+ this.queueProcessor.QueuePaused += this.QueueProcessor_QueuePaused;
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
this.JobStatus = Resources.QueueViewModel_QueueReady;
@@ -501,7 +503,7 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.EncodeService.EncodeStatusChanged -= this.EncodeService_EncodeStatusChanged;
this.queueProcessor.EncodeService.EncodeCompleted -= this.EncodeService_EncodeCompleted;
this.queueProcessor.JobProcessingStarted -= this.QueueProcessorJobProcessingStarted;
- this.queueProcessor.LowDiskspaceDetected -= this.QueueProcessor_LowDiskspaceDetected;
+ this.queueProcessor.QueuePaused -= this.QueueProcessor_QueuePaused;
base.OnDeactivate(close);
}
@@ -555,29 +557,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Detect Low Disk Space before starting new queue tasks.
- /// </summary>
- /// <param name="sender">Event invoker. </param>
- /// <param name="e">Event Args.</param>
- private void QueueProcessor_LowDiskspaceDetected(object sender, EventArgs e)
- {
- Execute.OnUIThreadAsync(
- () =>
- {
- this.queueProcessor.Pause();
- this.JobStatus = Resources.QueueViewModel_QueuePending;
- this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
- this.IsQueueRunning = false;
-
- this.errorService.ShowMessageBox(
- Resources.MainViewModel_LowDiskSpaceWarning,
- Resources.MainViewModel_LowDiskSpace,
- MessageBoxButton.OK,
- MessageBoxImage.Warning);
- });
- }
-
- /// <summary>
/// Handle the Queue Changed Event.
/// </summary>
/// <param name="sender">
@@ -646,6 +625,13 @@ namespace HandBrakeWPF.ViewModels
this.IsQueueRunning = true;
}
+ private void QueueProcessor_QueuePaused(object sender, EventArgs e)
+ {
+ this.JobStatus = Resources.QueueViewModel_QueuePaused;
+ this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
+ this.IsQueueRunning = false;
+ }
+
#endregion
}
} \ No newline at end of file