summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-09-08 17:54:15 +0000
committersr55 <[email protected]>2012-09-08 17:54:15 +0000
commit0db4fa3ac171c254a8611a9de1eba93e91346388 (patch)
treecdea34d4e7a29f072b7895b07e2bc3a85138bc72 /win
parentd5bcce8f440245352742d35422fe913eb013bbbd (diff)
WinGui: Hide the Debug Menu behind an option.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4939 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs23
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml2
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml3
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml8
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
/// </summary>
public const string ServerPort = "ServerPort";
+ /// <summary>
+ /// Enable Debugging features within the GUI.
+ /// </summary>
+ 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
}
}
+ /// <summary>
+ /// Gets a value indicating whether show debug menu.
+ /// </summary>
+ public bool ShowDebugMenu
+ {
+ get
+ {
+ return this.userSettingService.GetUserSetting<bool>(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
/// </summary>
private int serverPort;
+ /// <summary>
+ /// The server port.
+ /// </summary>
+ private bool enableDebugFeatures;
+
#endregion
#region Constructors and Destructors
@@ -1353,6 +1358,22 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Enable Debugging features in the UI.
+ /// </summary>
+ 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<string>(UserSettingConstants.ServerPort), out port);
this.ServerPort = port;
this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
+ this.EnableDebugFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);
}
/// <summary>
@@ -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);
}
/// <summary>
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 @@
<MenuItem Header="About..." Micro:Message.Attach="[Event Click] = [Action OpenAboutApplication]" />
</MenuItem>
- <MenuItem Header="Debug" Foreground="Transparent" >
+ <MenuItem Header="Debug" Visibility="{Binding ShowDebugMenu, Converter={StaticResource boolToVisConverter}}" >
<MenuItem Header="Show CLI Equiv" Micro:Message.Attach="[Event Click] = [Action ShowCliQuery]" />
<MenuItem Header="Debug Scan Log" Micro:Message.Attach="[Event Click] = [Action DebugScanLog]" />
<MenuItem Header="Test Isolation Service" Micro:Message.Attach="[Event Click] = [Action EnableIsolationServices]" />
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 @@
<TextBlock Text="Server Port:" VerticalAlignment="Center" />
<TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />
</StackPanel>
- </StackPanel>
+ <CheckBox Content="Enable Debug Features" IsChecked="{Binding EnableDebugFeatures}" Margin="0,10,0,0" />
+ </StackPanel>
</StackPanel>
</StackPanel>
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 @@
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
</value>
</item>
+ <item>
+ <key>
+ <string>EnableDebugFeatures</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
</dictionary> \ No newline at end of file