summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs37
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs36
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs11
5 files changed, 56 insertions, 48 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index eeb3def77..516fc7642 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -23,6 +23,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -167,6 +169,15 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
index 7805aea63..c2d48f8e5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
@@ -9,10 +9,19 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrakeWPF.Model;
+
/// <summary>
/// The Options Screen View Model Interface
/// </summary>
public interface IOptionsViewModel
{
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ void GotoTab(OptionsTab tab);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 7a9461b25..335509150 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -896,16 +896,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void OpenAboutApplication()
{
- Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(AboutView));
-
- if (window != null)
- {
- window.Activate();
- }
- else
- {
- this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());
- }
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.About);
}
/// <summary>
@@ -983,8 +975,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void CheckForUpdates()
{
- this.ProgramStatusLabel = "Checking for Updates ...";
- this.updateService.CheckForUpdates(this.HandleManualUpdateCheckResults);
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.Updates);
}
/// <summary>
@@ -1614,27 +1606,6 @@ namespace HandBrakeWPF.ViewModels
this.ProgramStatusLabel = "A New Update is Available. Goto Tools Menu > Options to Install";
}
}
-
- /// <summary>
- /// Handle Update Check Results
- /// </summary>
- /// <param name="information">
- /// The information.
- /// </param>
- private void HandleManualUpdateCheckResults(UpdateCheckInformation information)
- {
- if (information.NewVersionAvailable)
- {
- MessageBox.Show("A New Version is available. Goto Tools Menu > Options to Install or visit http://handbrake.fr for details.", "Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- else
- {
- MessageBox.Show("There is no new updates at this time.", "No Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
-
- this.ProgramStatusLabel = "Ready";
- }
-
#endregion
#region Event Handlers
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 6dc2a44dc..36fa35985 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -309,7 +309,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The options tab that is selected.
/// </summary>
- private string selectedTab;
+ private OptionsTab selectedTab;
/// <summary>
/// Update Message
@@ -380,7 +380,7 @@ namespace HandBrakeWPF.ViewModels
this.updateService = updateService;
this.OnLoad();
- this.SelectedTab = "General";
+ this.SelectedTab = OptionsTab.General;
this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
}
@@ -389,20 +389,9 @@ namespace HandBrakeWPF.ViewModels
#region Window Properties
/// <summary>
- /// Gets OptionTabs.
- /// </summary>
- public IEnumerable<string> OptionTabs
- {
- get
- {
- return new List<string> { "General", "Output Files", "Audio and Subtitles", "Advanced", "Updates" };
- }
- }
-
- /// <summary>
/// Gets or sets SelectedTab.
/// </summary>
- public string SelectedTab
+ public OptionsTab SelectedTab
{
get
{
@@ -415,6 +404,12 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedTab);
}
}
+
+ /// <summary>
+ /// Gets or sets the about view model.
+ /// </summary>
+ public IAboutViewModel AboutViewModel { get; set; }
+
#endregion
#region Properties
@@ -1344,7 +1339,7 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Enable Debugging features in the UI.
+ /// Gets or sets a value indicating whether debug features are enabled.
/// </summary>
public bool EnableDebugFeatures
{
@@ -1962,5 +1957,16 @@ namespace HandBrakeWPF.ViewModels
Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
Application.Current.Shutdown();
}
+
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ public void GotoTab(OptionsTab tab)
+ {
+ this.SelectedTab = tab;
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index b52dd961a..3fcca18aa 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -22,6 +22,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
using Ookii.Dialogs.Wpf;
@@ -279,6 +281,15 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces