summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-03-26 19:09:12 +0000
committersr55 <[email protected]>2016-03-26 19:09:12 +0000
commitce9543f4b6ac63f413287081d5ee4bd1ab14f56b (patch)
treed6bba978008b681498375bb2e377acf0fea53ea1 /win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
parent441d09f5e86b43135958beae4cc2359fa675eb2d (diff)
WinGui: Add a new JSON file type to the queue export functionality. This exports the standardised JSON format that can be imported into the CLI.
Note, the GUI can not yet import the JSON formatted queue file. The old hbq format is still there for that.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index e3dccd32c..3ad23d605 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.IO;
using System.Linq;
using System.Windows;
@@ -332,14 +333,22 @@ namespace HandBrakeWPF.ViewModels
{
SaveFileDialog dialog = new SaveFileDialog
{
- Filter = "HandBrake Queue Files (*.hbq)|*.hbq",
+ Filter = "Legacy Queue Files (*.hbq)|*.hbq|Json for CLI (*.json)|*.json",
OverwritePrompt = true,
DefaultExt = ".hbq",
AddExtension = true
};
+
if (dialog.ShowDialog() == true)
{
- this.queueProcessor.BackupQueue(dialog.FileName);
+ if (Path.GetExtension(dialog.FileName).ToLower().Trim() == ".json")
+ {
+ this.queueProcessor.ExportJson(dialog.FileName);
+ }
+ else
+ {
+ this.queueProcessor.BackupQueue(dialog.FileName);
+ }
}
}
@@ -348,7 +357,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void Import()
{
- OpenFileDialog dialog = new OpenFileDialog { Filter = "HandBrake Queue Files (*.hbq)|*.hbq", CheckFileExists = true };
+ OpenFileDialog dialog = new OpenFileDialog { Filter = "Legacy Queue Files (*.hbq)|*.hbq", CheckFileExists = true };
if (dialog.ShowDialog() == true)
{
this.queueProcessor.RestoreQueue(dialog.FileName);