@@ -129,7 +129,7 @@ private void SaveSettings()
129129 regkey . SetValue ( "ShowConsole" , cbxShowConsole . Checked , RegistryValueKind . DWord ) ;
130130 regkey . SetValue ( "MinimizeToTray" , cbxMinimizeTray . Checked , RegistryValueKind . DWord ) ;
131131 regkey . SetValue ( "CloseToTray" , cbxCloseTray . Checked , RegistryValueKind . DWord ) ;
132- regkey . SetValue ( "LaunchTimeout" , int . Parse ( txtLaunchTimeout . Text ) , RegistryValueKind . DWord ) ;
132+ regkey . SetValue ( "LaunchTimeout" , Convert . ToInt32 ( txtLaunchTimeout . Text ) , RegistryValueKind . DWord ) ;
133133 regkey . SetValue ( "EnableLogging" , cbxLogging . Checked , RegistryValueKind . DWord ) ;
134134 regkey . SetValue ( "LogPath" , txtLogPath . Text , RegistryValueKind . String ) ;
135135 regkey . SetValue ( "EnableGridLines" , cbxGrid . Checked , RegistryValueKind . DWord ) ;
@@ -186,13 +186,13 @@ private void LoadSettings()
186186 {
187187 txtEXEdir . Text = regkey . GetValue ( "EXEdir" ) . ToString ( ) ;
188188 txtCFGdir . Text = regkey . GetValue ( "CFGdir" ) . ToString ( ) ;
189+ txtLaunchTimeout . Text = regkey . GetValue ( "LaunchTimeout" ) . ToString ( ) ;
190+ txtLogPath . Text = regkey . GetValue ( "LogPath" ) . ToString ( ) ;
189191 cbxMinimize . Checked = Convert . ToBoolean ( regkey . GetValue ( "MinimizeOnVMStart" ) ) ;
190192 cbxShowConsole . Checked = Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) ;
191193 cbxMinimizeTray . Checked = Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) ;
192194 cbxCloseTray . Checked = Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) ;
193195 cbxLogging . Checked = Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) ;
194- txtLaunchTimeout . Text = Convert . ToString ( regkey . GetValue ( "LaunchTimeout" ) ) ;
195- txtLogPath . Text = Convert . ToString ( regkey . GetValue ( "LogPath" ) ) ;
196196 cbxGrid . Checked = Convert . ToBoolean ( regkey . GetValue ( "EnableGridLines" ) ) ;
197197 txtLogPath . Enabled = cbxLogging . Checked ;
198198 btnBrowse3 . Enabled = cbxLogging . Checked ;
@@ -298,21 +298,65 @@ private bool CheckForChanges()
298298
299299 try
300300 {
301- btnApply . Enabled = ( txtEXEdir . Text != regkey . GetValue ( "EXEdir" ) . ToString ( ) ||
301+ if ( txtEXEdir . Text != regkey . GetValue ( "EXEdir" ) . ToString ( ) )
302+ {
303+ Console . WriteLine ( "EXEdir" ) ;
304+ }
305+ if ( txtCFGdir . Text != regkey . GetValue ( "CFGdir" ) . ToString ( ) )
306+ {
307+ Console . WriteLine ( "CFGdir" ) ;
308+ }
309+ if ( cbxMinimize . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeOnVMStart" ) ) )
310+ {
311+ Console . WriteLine ( "MinimizeOnVMStart" ) ;
312+ }
313+ if ( cbxShowConsole . Checked != Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) )
314+ {
315+ Console . WriteLine ( "ShowConsole" ) ;
316+ }
317+ if ( cbxMinimizeTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) )
318+ {
319+ Console . WriteLine ( "MinimizeToTray" ) ;
320+ }
321+ if ( cbxCloseTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) )
322+ {
323+ Console . WriteLine ( "CloseToTray" ) ;
324+ }
325+ if ( txtLaunchTimeout . Text != regkey . GetValue ( "LaunchTimeout" ) . ToString ( ) )
326+ {
327+ Console . WriteLine ( "LaunchTimeout: " + regkey . GetValue ( "LaunchTimeout" ) . ToString ( ) ) ;
328+ Console . WriteLine ( "txtLaunchTimeout.Text: " + txtLaunchTimeout . Text ) ;
329+ }
330+ if ( cbxLogging . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) )
331+ {
332+ Console . WriteLine ( "EnableLogging" ) ;
333+ }
334+ if ( txtLogPath . Text != regkey . GetValue ( "LogPath" ) . ToString ( ) )
335+ {
336+ Console . WriteLine ( "LogPath" ) ;
337+ }
338+ if ( cbxGrid . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableGridLines" ) ) )
339+ {
340+ Console . WriteLine ( "EnableGridLines" ) ;
341+ }
342+
343+ btnApply . Enabled = (
344+ txtEXEdir . Text != regkey . GetValue ( "EXEdir" ) . ToString ( ) ||
302345 txtCFGdir . Text != regkey . GetValue ( "CFGdir" ) . ToString ( ) ||
303- cbxMinimize . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeOnVMStart" ) ) ||
304- cbxShowConsole . Checked != Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) ||
305- cbxMinimizeTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) ||
306- cbxCloseTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) ||
307- txtLaunchTimeout . Text != Convert . ToString ( regkey . GetValue ( "LaunchTimeout" ) ) ||
308- cbxLogging . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) ||
309- txtLogPath . Text != regkey . GetValue ( "LogPath" ) . ToString ( ) ||
310- cbxGrid . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableGridLines" ) ) ) ;
346+ cbxMinimize . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeOnVMStart" ) ) ||
347+ cbxShowConsole . Checked != Convert . ToBoolean ( regkey . GetValue ( "ShowConsole" ) ) ||
348+ cbxMinimizeTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "MinimizeToTray" ) ) ||
349+ cbxCloseTray . Checked != Convert . ToBoolean ( regkey . GetValue ( "CloseToTray" ) ) ||
350+ txtLaunchTimeout . Text != regkey . GetValue ( "LaunchTimeout" ) . ToString ( ) ||
351+ cbxLogging . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableLogging" ) ) ||
352+ txtLogPath . Text != regkey . GetValue ( "LogPath" ) . ToString ( ) ||
353+ cbxGrid . Checked != Convert . ToBoolean ( regkey . GetValue ( "EnableGridLines" ) ) ) ;
311354
312355 return btnApply . Enabled ;
313356 }
314357 catch ( Exception ex )
315358 {
359+ MessageBox . Show ( "Error: " + ex . Message ) ;
316360 return true ; //For now let's just return true if anything goes wrong
317361 }
318362 finally
0 commit comments