diff options
author | sr55 <[email protected]> | 2018-09-14 20:49:27 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-09-14 20:49:27 +0100 |
commit | 4d7a05ed8dd8ab8fb04ddf6722a30e9b05485933 (patch) | |
tree | 7e0dd49c5c8fd548b9d7967f1be5784bdeb3055a | |
parent | 09ed0b5574c92972b23ae44e60c718450d16d388 (diff) |
WinGui: When opening preferences, reset to General tab if the last tab used was the About tab. #1592
3 files changed, 14 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs index 5bfbb22d7..238e6655f 100644 --- a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs +++ b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs @@ -50,11 +50,17 @@ namespace HandBrakeWPF.Commands public void Execute(object parameter)
{
var shellViewModel = IoC.Get<IShellViewModel>();
+ var optionsViewModel = IoC.Get<IOptionsViewModel>();
+
shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
+ if (parameter == null && optionsViewModel.SelectedTab == OptionsTab.About)
+ {
+ optionsViewModel.GotoTab(OptionsTab.General);
+ }
+
if (parameter != null && parameter.GetType() == typeof(OptionsTab))
{
- var optionsViewModel = IoC.Get<IOptionsViewModel>();
optionsViewModel.GotoTab((OptionsTab)parameter);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs index e37f1da07..827d0a0fb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs @@ -17,6 +17,11 @@ namespace HandBrakeWPF.ViewModels.Interfaces public interface IOptionsViewModel
{
/// <summary>
+ /// The currently selected Tab in the options pane.
+ /// </summary>
+ OptionsTab SelectedTab { get; }
+
+ /// <summary>
/// The goto tab.
/// </summary>
/// <param name="tab">
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 47a34e4e8..a41fb01dc 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1368,8 +1368,8 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void OpenOptionsWindow()
{
- IShellViewModel shellViewModel = IoC.Get<IShellViewModel>();
- shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(null);
}
/// <summary>
|