]> granicus.if.org Git - handbrake/commitdiff
WinGui: Hide the Debug Menu behind an option.
authorsr55 <sr55.hb@outlook.com>
Sat, 8 Sep 2012 17:54:15 +0000 (17:54 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 8 Sep 2012 17:54:15 +0000 (17:54 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4939 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/UserSettingConstants.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/defaultsettings.xml

index 865847d87d885906363840d970f15875cc661cc7..77cd9ab8f00dcc337c4f79a1939526b5022f15f5 100644 (file)
@@ -171,6 +171,11 @@ namespace HandBrakeWPF
         /// </summary>\r
         public const string ServerPort = "ServerPort";\r
 \r
+        /// <summary>\r
+        /// Enable Debugging features within the GUI.\r
+        /// </summary>\r
+        public const string EnableDebugFeatures = "EnableDebugFeatures";\r
+\r
         #endregion\r
     }\r
 }
\ No newline at end of file
index 3e8b5709f1bbeb8dded58ae5e978c859c2fd6553..e62abf174128006782864b31e77bad250df0f176 100644 (file)
@@ -599,6 +599,17 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets a value indicating whether show debug menu.\r
+        /// </summary>\r
+        public bool ShowDebugMenu\r
+        {\r
+           get\r
+           {\r
+               return this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);\r
+           }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Properties for Settings\r
index 963abdf60c429a454e6a2357a40daae59211b3fe..7b65a5ef8c5b2217e0423ae3a1af6bf5d6553c9c 100644 (file)
@@ -349,6 +349,11 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private int serverPort;\r
 \r
+        /// <summary>\r
+        /// The server port.\r
+        /// </summary>\r
+        private bool enableDebugFeatures;\r
+\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -1353,6 +1358,22 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Enable Debugging features in the UI.\r
+        /// </summary>\r
+        public bool EnableDebugFeatures\r
+        {\r
+            get\r
+            {\r
+                return this.enableDebugFeatures;\r
+            }\r
+            set\r
+            {\r
+                this.enableDebugFeatures = value;\r
+                this.NotifyOfPropertyChange(() => this.EnableDebugFeatures);\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #endregion\r
@@ -1648,6 +1669,7 @@ namespace HandBrakeWPF.ViewModels
             int.TryParse(userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort), out port);\r
             this.ServerPort = port;\r
             this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);\r
+            this.EnableDebugFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);\r
         }\r
 \r
         /// <summary>\r
@@ -1864,6 +1886,7 @@ namespace HandBrakeWPF.ViewModels
             userSettingService.SetUserSetting(ASUserSettingConstants.DisableLibDvdNav, this.DisableLibdvdNav);\r
             userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation);\r
             userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString());\r
+            userSettingService.SetUserSetting(UserSettingConstants.EnableDebugFeatures, this.EnableDebugFeatures);\r
         }\r
 \r
         /// <summary>\r
index fdf2047447ebc6d4b7996346aa6a7b349d8cf49a..d4cea73db34a9c93c18d42e48af66562833bc174 100644 (file)
                     <MenuItem Header="About..." Micro:Message.Attach="[Event Click] = [Action OpenAboutApplication]" />\r
                 </MenuItem>\r
 \r
-                <MenuItem Header="Debug" Foreground="Transparent" >\r
+                <MenuItem Header="Debug" Visibility="{Binding ShowDebugMenu, Converter={StaticResource boolToVisConverter}}" >\r
                     <MenuItem Header="Show CLI Equiv" Micro:Message.Attach="[Event Click] = [Action ShowCliQuery]" />\r
                     <MenuItem Header="Debug Scan Log" Micro:Message.Attach="[Event Click] = [Action DebugScanLog]" />\r
                     <MenuItem Header="Test Isolation Service" Micro:Message.Attach="[Event Click] = [Action EnableIsolationServices]" />\r
index 7c3ead9cfbf70ffc141f6fc974b9dfac2e4acc61..db918987aacc55a2692d7ea340671635bb1889ee 100644 (file)
                                 <TextBlock Text="Server Port:" VerticalAlignment="Center" />\r
                                 <TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />\r
                             </StackPanel>\r
-                        </StackPanel>\r
 \r
+                            <CheckBox Content="Enable Debug Features" IsChecked="{Binding EnableDebugFeatures}" Margin="0,10,0,0" />\r
+                        </StackPanel>\r
                     </StackPanel>\r
                 </StackPanel>\r
 \r
index 03dbccef2b3fe3472778f6565ec4c7ac130374b7..0c995c9e9b7ed8937c3381fdb8377181193a83ad 100644 (file)
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
     </value>\r
   </item>\r
+  <item>\r
+    <key>\r
+      <string>EnableDebugFeatures</string>\r
+    </key>\r
+    <value>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+    </value>\r
+  </item>\r
 </dictionary>
\ No newline at end of file