diff options
author | sr55 <[email protected]> | 2017-08-23 20:57:26 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-08-23 20:57:26 +0100 |
commit | 43ad6cbbde4c48c6342753d74dbb440db70e1396 (patch) | |
tree | 70dcfc6bd4c361ecebfedf2d39fcadb9890fc9a8 /win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | |
parent | b8b07482d5f92296070aee0ea4427e0226d651ec (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.cs | 37 |
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>
|