diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index fd65c9c67..9fce1956c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -87,7 +87,7 @@ namespace HandBrakeWPF.ViewModels private bool isEncoding;
private bool showStatusWindow;
private Preset selectedPreset;
- private EncodeTask queueEditTask;
+ private QueueTask queueEditTask;
private int lastEncodePercentage;
private bool isPresetPanelShowing;
private bool showSourceSelection;
@@ -1504,7 +1504,7 @@ namespace HandBrakeWPF.ViewModels return false;
}
- QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath);
+ QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, this.SelectedPreset);
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))
{
@@ -1711,13 +1711,15 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Edit a Queue Task
/// </summary>
- /// <param name="task">
+ /// <param name="queueTask">
/// The task.
/// </param>
- public void EditQueueJob(EncodeTask task)
+ public void EditQueueJob(QueueTask queueTask)
{
// Rescan the source to make sure it's still valid
- this.queueEditTask = task;
+ EncodeTask task = queueTask.Task;
+
+ this.queueEditTask = queueTask;
this.scanService.Scan(task.Source, task.Title, QueueEditAction, HBConfigurationFactory.Create());
}
@@ -2200,6 +2202,16 @@ namespace HandBrakeWPF.ViewModels /* TODO Fix this. */
Execute.OnUIThread(() =>
{
+ if (this.queueEditTask != null && this.selectedPreset.Name != this.queueEditTask.SelectedPresetKey)
+ {
+ Preset foundPreset = this.presetService.GetPreset(this.queueEditTask.SelectedPresetKey);
+ if (foundPreset != null)
+ {
+ this.selectedPreset = foundPreset;
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
+ }
+ }
+
// Copy all the Scan data into the UI
scannedSource.CopyTo(this.ScannedSource);
this.NotifyOfPropertyChange(() => this.ScannedSource);
@@ -2207,7 +2219,7 @@ namespace HandBrakeWPF.ViewModels // Select the Users Title
this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault();
- this.CurrentTask = new EncodeTask(queueEditTask);
+ this.CurrentTask = new EncodeTask(this.queueEditTask.Task);
this.NotifyOfPropertyChange(() => this.CurrentTask);
this.HasSource = true;
@@ -2221,6 +2233,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedEndPoint = end;
// Update the Tab Controls
+ this.SummaryViewModel.UpdateTask(this.CurrentTask);
this.PictureSettingsViewModel.UpdateTask(this.CurrentTask);
this.VideoViewModel.UpdateTask(this.CurrentTask);
this.FiltersViewModel.UpdateTask(this.CurrentTask);
@@ -2229,8 +2242,7 @@ namespace HandBrakeWPF.ViewModels this.ChaptersViewModel.UpdateTask(this.CurrentTask);
this.AdvancedViewModel.UpdateTask(this.CurrentTask);
this.MetaDataViewModel.UpdateTask(this.CurrentTask);
- this.SummaryViewModel.UpdateTask(this.CurrentTask);
-
+
// Cleanup
this.ShowStatusWindow = false;
this.SourceLabel = this.SourceName;
|