diff options
author | sr55 <[email protected]> | 2016-04-17 15:17:51 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2016-04-17 15:17:51 +0100 |
commit | 0023b69f26cb79492c5c32e5ba227a5d91da418c (patch) | |
tree | cff4eb13fa33ca8af6aff6cde4c408edbe894a66 /win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | |
parent | dc0c8ac59176e94f7d2c0338ca286c5a4b73c6ea (diff) |
WinGui: Change the Audio Default and Subtitle panels to be modal windows. (Similar to the MacGUI). This should allow for more space needed to implement Audio templates. Also fixed a sanitise mixdown call crash.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 61 |
1 files changed, 14 insertions, 47 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 04115d5b8..86f8b36d2 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -38,21 +38,10 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public class AudioViewModel : ViewModelBase, IAudioViewModel
{
- /// <summary>
- /// Backing field for the source tracks list.
- /// </summary>
+ private readonly IWindowManager windowManager;
private IEnumerable<Audio> sourceTracks;
-
- /// <summary>
- /// The current preset.
- /// </summary>
private Preset currentPreset;
- /// <summary>
- /// The show audio defaults panel.
- /// </summary>
- private bool showAudioDefaultsPanel;
-
#region Constructors and Destructors
/// <summary>
@@ -65,7 +54,8 @@ namespace HandBrakeWPF.ViewModels /// The user Setting Service.
/// </param>
public AudioViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
- {
+ {
+ this.windowManager = windowManager;
this.Task = new EncodeTask();
this.AudioDefaultsViewModel = new AudioDefaultsViewModel(this.Task);
@@ -124,27 +114,6 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public EncodeTask Task { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether show audio defaults panel.
- /// </summary>
- public bool ShowAudioDefaultsPanel
- {
- get
- {
- return this.showAudioDefaultsPanel;
- }
- set
- {
- if (value.Equals(this.showAudioDefaultsPanel))
- {
- return;
- }
- this.showAudioDefaultsPanel = value;
- this.NotifyOfPropertyChange(() => this.ShowAudioDefaultsPanel);
- this.NotifyOfPropertyChange(() => this.PanelTitle);
- this.NotifyOfPropertyChange(() => this.SwitchDisplayTitle);
- }
- }
/// <summary>
/// Gets the panel title.
@@ -153,7 +122,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return this.ShowAudioDefaultsPanel ? Resources.AudioViewModel_AudioDefaults : Resources.AudioViewModel_AudioTracks;
+ return Resources.AudioViewModel_AudioTracks;
}
}
@@ -164,7 +133,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return this.ShowAudioDefaultsPanel ? Resources.AudioViewModel_SwitchBackToTracks : Resources.AudioViewModel_ConfigureDefaults;
+ return Resources.AudioViewModel_ConfigureDefaults;
}
}
@@ -246,21 +215,19 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Open the options screen to the Audio and Subtitles tab.
- /// </summary>
- public void SetDefaultBehaviour()
- {
- this.ShowAudioDefaultsPanel = true;
- }
-
- /// <summary>
/// The show audio defaults.
/// </summary>
public void ShowAudioDefaults()
{
- // OpenOverlayPanelCommand command = new OpenOverlayPanelCommand();
- // command.Execute(new AudioDefaultsViewModel(this.WindowManager, this.UserSettingService));
- this.ShowAudioDefaultsPanel = !this.ShowAudioDefaultsPanel;
+ IPopupWindowViewModel popup = new PopupWindowViewModel(this.AudioDefaultsViewModel, ResourcesUI.Preset_AudioDefaults_Title, ResourcesUI.AudioView_AudioDefaultsDescription);
+ if (this.windowManager.ShowDialog(popup) == true)
+ {
+ // Nothing to do yet, it's by reference.
+ }
+ else
+ {
+ // Handle other case(s)
+ }
}
#endregion
|