diff options
author | sr55 <[email protected]> | 2019-07-05 23:11:04 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-07-05 23:11:22 +0100 |
commit | cfb4a33b6eb05db67406010299dfb883de9b60ed (patch) | |
tree | d1eae10d1b0ee12b1b4970376a4d068832eb6300 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | faf10b6ae3683e7361c0907255ddb3066b651bb0 (diff) |
WinGui: Build out code for active monitoring of storage and battery power on the system. (Similar to what the LinUI does)
- Automatic pause on "Low" or "Critical" battery alarms. The % level is set in Windows power settings. Automatic Resume when AC returns, if it was paused by an alarm.
- Automatic encode pause when destination drive drops below 2GB. (May make this a preference set later)
- Behaviour of pause queue on low disk space with a user defined level in preferences is unchanged.
#2109 #2181
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index c1cd1aafb..731a2e090 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -110,12 +110,26 @@ namespace HandBrakeWPF.ViewModels /// The viewmodel for HandBrakes main window.
/// </summary>
/// <remarks>whenDoneService must be a serivce here!</remarks>
- public MainViewModel(IUserSettingService userSettingService, IScan scanService, IPresetService presetService,
- IErrorService errorService, IUpdateService updateService,
- IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, ISummaryViewModel summaryViewModel,
- IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,
- IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,
- IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel, INotifyIconService notifyIconService)
+ public MainViewModel(
+ IUserSettingService userSettingService,
+ IScan scanService,
+ IPresetService presetService,
+ IErrorService errorService,
+ IUpdateService updateService,
+ IPrePostActionService whenDoneService,
+ IWindowManager windowManager,
+ IPictureSettingsViewModel pictureSettingsViewModel,
+ IVideoViewModel videoViewModel,
+ ISummaryViewModel summaryViewModel,
+ IFiltersViewModel filtersViewModel,
+ IAudioViewModel audioViewModel,
+ ISubtitlesViewModel subtitlesViewModel,
+ IChaptersViewModel chaptersViewModel,
+ IStaticPreviewViewModel staticPreviewViewModel,
+ IQueueViewModel queueViewModel,
+ IMetaDataViewModel metaDataViewModel,
+ INotifyIconService notifyIconService,
+ ISystemService systemService)
: base(userSettingService)
{
this.scanService = scanService;
@@ -184,6 +198,8 @@ namespace HandBrakeWPF.ViewModels // Setup Commands
this.QueueCommand = new QueueCommands(this.QueueViewModel);
+ // Monitor the system.
+ systemService.Start();
}
#region View Model Properties
@@ -1377,7 +1393,7 @@ namespace HandBrakeWPF.ViewModels if (!DriveUtilities.HasMinimumDiskSpace(
this.Destination,
- this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel)))
+ this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseQueueOnLowDiskspaceLevel)))
{
return new AddQueueError(Resources.Main_LowDiskspace, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
}
|