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 | |
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')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 61 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 71 |
2 files changed, 34 insertions, 98 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
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index d27b8dc26..20fc39918 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -14,6 +14,8 @@ namespace HandBrakeWPF.ViewModels using System.IO;
using System.Linq;
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.Model.Subtitles;
@@ -35,28 +37,13 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public class SubtitlesViewModel : ViewModelBase, ISubtitlesViewModel
{
+ private readonly IWindowManager windowManager;
+
#region Constants and Fields
- /// <summary>
- /// The Foreign Audio Search Track
- /// </summary>
private readonly Subtitle ForeignAudioSearchTrack;
-
- /// <summary>
- /// Backing field for the source subtitle tracks.
- /// </summary>
private IList<Subtitle> sourceTracks;
- /// <summary>
- /// The show defaults panel.
- /// </summary>
- private bool showDefaultsPanel;
-
- /// <summary>
- /// The audio behaviours.
- /// </summary>
- private SubtitleBehaviours subtitleBehaviours;
-
#endregion
#region Constructors and Destructors
@@ -64,8 +51,12 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.SubtitlesViewModel"/> class.
/// </summary>
- public SubtitlesViewModel()
+ /// <param name="windowManager">
+ /// The window Manager.
+ /// </param>
+ public SubtitlesViewModel(IWindowManager windowManager)
{
+ this.windowManager = windowManager;
this.SubtitleDefaultsViewModel = new SubtitlesDefaultsViewModel();
this.Task = new EncodeTask();
@@ -118,35 +109,13 @@ namespace HandBrakeWPF.ViewModels public EncodeTask Task { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether show defaults panel.
- /// </summary>
- public bool ShowDefaultsPanel
- {
- get
- {
- return this.showDefaultsPanel;
- }
- set
- {
- if (value.Equals(this.showDefaultsPanel))
- {
- return;
- }
- this.showDefaultsPanel = value;
- this.NotifyOfPropertyChange(() => this.ShowDefaultsPanel);
- this.NotifyOfPropertyChange(() => this.PanelTitle);
- this.NotifyOfPropertyChange(() => this.SwitchDisplayTitle);
- }
- }
-
- /// <summary>
/// Gets the panel title.
/// </summary>
public string PanelTitle
{
get
{
- return this.ShowDefaultsPanel ? Resources.SubtitlesViewModel_SubDefaults : Resources.SubtitlesViewModel_SubTracks;
+ return Resources.SubtitlesViewModel_SubTracks;
}
}
@@ -157,7 +126,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return this.ShowDefaultsPanel ? Resources.SubtitlesViewModel_SwitchToTracks : Resources.SubtitlesViewModel_ConfigureDefaults;
+ return Resources.SubtitlesViewModel_ConfigureDefaults;
}
}
@@ -435,19 +404,19 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Open the options screen to the Audio and Subtitles tab.
- /// </summary>
- public void SetDefaultBehaviour()
- {
- this.ShowDefaultsPanel = true;
- }
-
- /// <summary>
/// The show audio defaults.
/// </summary>
public void ShowSubtitleDefaultsPanel()
{
- this.ShowDefaultsPanel = !this.ShowDefaultsPanel;
+ IPopupWindowViewModel popup = new PopupWindowViewModel(this.SubtitleDefaultsViewModel, 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)
+ }
}
/// <summary>
|