summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-08-23 20:57:26 +0100
committersr55 <[email protected]>2017-08-23 20:57:26 +0100
commit43ad6cbbde4c48c6342753d74dbb440db70e1396 (patch)
tree70dcfc6bd4c361ecebfedf2d39fcadb9890fc9a8 /win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
parentb8b07482d5f92296070aee0ea4427e0226d651ec (diff)
WinGui: Implement "Open Source" and "Open Destination" on the Queue context menu. #863
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 5e9f45aa7..f2b2d7b9b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels
using System;
using System.Collections.Generic;
using System.ComponentModel;
+ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows;
@@ -452,6 +453,22 @@ namespace HandBrakeWPF.ViewModels
mvm.EditQueueJob(new EncodeTask(task.Task));
}
+ public void OpenSourceDirectory(QueueTask task)
+ {
+ if (task != null)
+ {
+ this.OpenDirectory(task.ScannedSourcePath);
+ }
+ }
+
+ public void OpenDestinationDirectory(QueueTask task)
+ {
+ if (task != null)
+ {
+ this.OpenDirectory(task.Task.Destination);
+ }
+ }
+
#endregion
#region Methods
@@ -510,6 +527,26 @@ namespace HandBrakeWPF.ViewModels
base.OnDeactivate(close);
}
+ private void OpenDirectory(string directory)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(directory))
+ {
+ directory = Path.GetDirectoryName(directory);
+ if (directory != null && Directory.Exists(directory))
+ {
+ Process.Start(directory);
+
+ }
+ }
+ }
+ catch (Exception exc)
+ {
+ this.errorService.ShowError(Resources.MainViewModel_UnableToLaunchDestDir, Resources.MainViewModel_UnableToLaunchDestDirSolution, exc);
+ }
+ }
+
/// <summary>
/// Handle the Encode Status Changed Event.
/// </summary>