From 0db4fa3ac171c254a8611a9de1eba93e91346388 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 8 Sep 2012 17:54:15 +0000 Subject: [PATCH] WinGui: Hide the Debug Menu behind an option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4939 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/UserSettingConstants.cs | 5 ++++ .../HandBrakeWPF/ViewModels/MainViewModel.cs | 11 +++++++++ .../ViewModels/OptionsViewModel.cs | 23 +++++++++++++++++++ win/CS/HandBrakeWPF/Views/MainView.xaml | 2 +- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 3 ++- win/CS/HandBrakeWPF/defaultsettings.xml | 8 +++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 865847d87..77cd9ab8f 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -171,6 +171,11 @@ namespace HandBrakeWPF /// public const string ServerPort = "ServerPort"; + /// + /// Enable Debugging features within the GUI. + /// + public const string EnableDebugFeatures = "EnableDebugFeatures"; + #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 3e8b5709f..e62abf174 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -599,6 +599,17 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets a value indicating whether show debug menu. + /// + public bool ShowDebugMenu + { + get + { + return this.userSettingService.GetUserSetting(UserSettingConstants.EnableDebugFeatures); + } + } + #endregion #region Properties for Settings diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 963abdf60..7b65a5ef8 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -349,6 +349,11 @@ namespace HandBrakeWPF.ViewModels /// private int serverPort; + /// + /// The server port. + /// + private bool enableDebugFeatures; + #endregion #region Constructors and Destructors @@ -1353,6 +1358,22 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Enable Debugging features in the UI. + /// + public bool EnableDebugFeatures + { + get + { + return this.enableDebugFeatures; + } + set + { + this.enableDebugFeatures = value; + this.NotifyOfPropertyChange(() => this.EnableDebugFeatures); + } + } + #endregion #endregion @@ -1648,6 +1669,7 @@ namespace HandBrakeWPF.ViewModels int.TryParse(userSettingService.GetUserSetting(UserSettingConstants.ServerPort), out port); this.ServerPort = port; this.EnableProcessIsolation = userSettingService.GetUserSetting(UserSettingConstants.EnableProcessIsolation); + this.EnableDebugFeatures = userSettingService.GetUserSetting(UserSettingConstants.EnableDebugFeatures); } /// @@ -1864,6 +1886,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(ASUserSettingConstants.DisableLibDvdNav, this.DisableLibdvdNav); userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation); userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString()); + userSettingService.SetUserSetting(UserSettingConstants.EnableDebugFeatures, this.EnableDebugFeatures); } /// diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index fdf204744..d4cea73db 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -131,7 +131,7 @@ - + diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 7c3ead9cf..db918987a 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -346,8 +346,9 @@ - + + diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 03dbccef2..0c995c9e9 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -457,4 +457,12 @@ false + + + EnableDebugFeatures + + + false + + \ No newline at end of file -- 2.40.0