@@ -130,6 +130,7 @@ private void SaveSettings()
130130 regkey . SetValue ( "MinimizeToTray" , cbxMinimizeTray . Checked , RegistryValueKind . DWord ) ;
131131 regkey . SetValue ( "CloseToTray" , cbxCloseTray . Checked , RegistryValueKind . DWord ) ;
132132 regkey . SetValue ( "LaunchTimeout" , int . Parse ( txtLaunchTimeout . Text ) , RegistryValueKind . DWord ) ;
133+ regkey . SetValue ( "EnableLogging" , cbxLogging . Checked , RegistryValueKind . DWord ) ;
133134 regkey . Close ( ) ;
134135
135136 settingsChanged = CheckForChanges ( ) ;
@@ -170,6 +171,7 @@ private void LoadSettings()
170171 cbxShowConsole . Checked = true ;
171172 cbxMinimizeTray . Checked = false ;
172173 cbxCloseTray . Checked = false ;
174+ cbxLogging . Checked = false ;
173175 txtLaunchTimeout . Text = "5000" ;
174176
175177 SaveSettings ( ) ; //This will write the default values to the registry
@@ -182,6 +184,7 @@ private void LoadSettings()
182184 cbxShowConsole . Checked = Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) ;
183185 cbxMinimizeTray . Checked = Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) ;
184186 cbxCloseTray . Checked = Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) ;
187+ cbxLogging . Checked = Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) ;
185188 txtLaunchTimeout . Text = Convert . ToString ( regkey . GetValue ( "LaunchTimeout" ) ) ;
186189 }
187190
@@ -195,6 +198,7 @@ private void LoadSettings()
195198 cbxShowConsole . Checked = true ;
196199 cbxMinimizeTray . Checked = false ;
197200 cbxCloseTray . Checked = false ;
201+ cbxLogging . Checked = false ;
198202 txtLaunchTimeout . Text = "5000" ;
199203 }
200204 }
@@ -235,16 +239,6 @@ private void btnBrowse2_Click(object sender, EventArgs e)
235239 }
236240 }
237241
238- private void cbxMinimize_CheckedChanged ( object sender , EventArgs e )
239- {
240- settingsChanged = CheckForChanges ( ) ;
241- }
242-
243- private void cbxShowConsole_CheckedChanged ( object sender , EventArgs e )
244- {
245- settingsChanged = CheckForChanges ( ) ;
246- }
247-
248242 private void btnDefaults_Click ( object sender , EventArgs e )
249243 {
250244 DialogResult result = MessageBox . Show ( "All settings will be reset to their default values. Do you wish to continue?" , "Settings will be reset" , MessageBoxButtons . YesNo , MessageBoxIcon . Warning ) ;
@@ -272,22 +266,13 @@ private void ResetSettings()
272266 cbxShowConsole . Checked = true ;
273267 cbxMinimizeTray . Checked = false ;
274268 cbxCloseTray . Checked = false ;
269+ cbxLogging . Checked = false ;
275270 txtLaunchTimeout . Text = "5000" ;
276271
277272 SaveSettings ( ) ;
278273 regkey . Close ( ) ;
279274 }
280275
281- private void cbxCloseTray_CheckedChanged ( object sender , EventArgs e )
282- {
283- settingsChanged = CheckForChanges ( ) ;
284- }
285-
286- private void cbxMinimizeTray_CheckedChanged ( object sender , EventArgs e )
287- {
288- settingsChanged = CheckForChanges ( ) ;
289- }
290-
291276 //Checks if all controls match the currently saved settings to determine if any changes were made
292277 private bool CheckForChanges ( )
293278 {
@@ -301,7 +286,8 @@ private bool CheckForChanges()
301286 cbxShowConsole . Checked != Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) ||
302287 cbxMinimizeTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) ||
303288 cbxCloseTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) ||
304- txtLaunchTimeout . Text != Convert . ToString ( regkey . GetValue ( "LaunchTimeout" ) ) ) ;
289+ txtLaunchTimeout . Text != Convert . ToString ( regkey . GetValue ( "LaunchTimeout" ) ) ||
290+ cbxLogging . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) ) ;
305291
306292 return btnApply . Enabled ;
307293 }
@@ -314,5 +300,10 @@ private bool CheckForChanges()
314300 regkey . Close ( ) ;
315301 }
316302 }
303+
304+ private void cbx_CheckedChanged ( object sender , EventArgs e )
305+ {
306+ settingsChanged = CheckForChanges ( ) ;
307+ }
317308 }
318309}
0 commit comments