summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-09-11 19:48:03 +0100
committersr55 <[email protected]>2017-09-11 19:48:03 +0100
commit6f5e5ea1703a9a40a54d8d677b1c24e45dff7b32 (patch)
treeda4b3eb7253e9ef0c4eefa62b6b4796b48947367 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
parentd0abd0c3f6cc67a74c2280e63c86d2aea2d84204 (diff)
WinGui: Improve selection behaviour of the new preset controls.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs44
1 files changed, 26 insertions, 18 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index de4476367..c8cf354ac 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -418,6 +418,11 @@ namespace HandBrakeWPF.ViewModels
{
this.selectedPreset = value;
this.NotifyOfPropertyChange(() => this.SelectedPreset);
+
+ if (value != null)
+ {
+ this.PresetSelect(value);
+ }
}
}
}
@@ -1192,6 +1197,7 @@ namespace HandBrakeWPF.ViewModels
this.presetService.Load();
this.PresetsCategories = this.presetService.Presets;
this.NotifyOfPropertyChange(() => this.PresetsCategories);
+ this.presetService.LoadCategoryStates();
this.SummaryViewModel.OutputFormatChanged += this.SummaryViewModel_OutputFormatChanged;
@@ -1249,6 +1255,7 @@ namespace HandBrakeWPF.ViewModels
{
// Shutdown Service
this.queueProcessor.Stop();
+ this.presetService.SaveCategoryStates();
// Unsubscribe from Events.
this.scanService.ScanStarted -= this.ScanStared;
@@ -1897,7 +1904,8 @@ namespace HandBrakeWPF.ViewModels
Preset preset = presetViewModel.Preset;
this.NotifyOfPropertyChange(() => this.CategoryPresets);
- this.SelectedPreset = preset; // Reselect the preset
+ this.selectedPreset = preset; // Reselect the preset
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
}
/// <summary>
@@ -2037,23 +2045,24 @@ namespace HandBrakeWPF.ViewModels
this.SelectedPresetCategory = this.PresetsCategories.FirstOrDefault(c => c.Category == preset.Category);
}
- this.SelectedPreset = preset;
- }
+ this.selectedPreset = preset;
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
- this.presetService.SetSelected(this.selectedPreset);
-
- if (this.selectedPreset != null)
- {
- // Tab Settings
- this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.VideoViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.FiltersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.AudioViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.SubtitleViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.ChaptersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.AdvancedViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.MetaDataViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
- this.SummaryViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.presetService.SetSelected(this.selectedPreset);
+
+ if (this.selectedPreset != null)
+ {
+ // Tab Settings
+ this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.VideoViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.FiltersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.AudioViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.SubtitleViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.ChaptersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.AdvancedViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.MetaDataViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ this.SummaryViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
+ }
}
}
@@ -2252,7 +2261,6 @@ namespace HandBrakeWPF.ViewModels
this.SelectedPresetCategory = category;
this.SelectedPreset = this.presetService.DefaultPreset;
- this.PresetSelect();
}
}