summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
authorScott <[email protected]>2015-11-10 23:21:57 +0000
committerScott <[email protected]>2015-11-10 23:21:57 +0000
commit6b713adaa58a127a65a5e69a6507d894a4760884 (patch)
tree56a37c568826e3ab1503e6523b6ad1ebc5bacce9 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
parent6fd35381a879def5e76f99cded43a2a3c265c333 (diff)
WinGui: Add warning dialog on Destination Browse Button if disk space is low. Added new Advanced Option in preferences that will force the queue to check for low disk space before starting each job and pause if necessary.
Low Disk Space level is currently set at 10GB. Will add a preference to adjust this at a later point
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index bc6caa38a..20a779e43 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1668,6 +1668,21 @@ namespace HandBrakeWPF.ViewModels
this.Destination = saveFileDialog.FileName;
+ // Disk Space Check
+ string drive = Path.GetPathRoot(this.Destination);
+ if (drive != null)
+ {
+ DriveInfo c = new DriveInfo(drive);
+ if (c.AvailableFreeSpace < this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel))
+ {
+ this.errorService.ShowMessageBox(
+ Resources.MainViewModel_LowDiskSpaceWarning,
+ Resources.MainViewModel_LowDiskSpace,
+ MessageBoxButton.OK,
+ MessageBoxImage.Warning);
+ }
+ }
+
// Set the Extension Dropdown. This will also set Mp4/m4v correctly.
if (!string.IsNullOrEmpty(saveFileDialog.FileName))
{