From 874b07e72120cd55d5fe5373005de693c5d33f32 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 5 Aug 2007 12:55:34 -0700 Subject: [PATCH] Making the buttons change their enabled state depending on where we are in debugging * Source/DebuggerWindowController.m: ([DebuggerWindowController setStatus:]): Disable all the buttons and reenable "step in" and "run" if we're connected ([DebuggerWindowController setStack:]): Enable the step in/out/over and run buttons appropriately --- Source/DebuggerWindowController.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/DebuggerWindowController.m b/Source/DebuggerWindowController.m index a2e100c..86482f8 100644 --- a/Source/DebuggerWindowController.m +++ b/Source/DebuggerWindowController.m @@ -70,6 +70,20 @@ [_error setHidden: YES]; [_status setStringValue: status]; [[self window] setTitle: [NSString stringWithFormat: @"GDBp @ %@:%d/%@", [_connection remoteHost], [_connection port], [_connection session]]]; + + [_stepInButton setEnabled: NO]; + [_stepOutButton setEnabled: NO]; + [_stepOverButton setEnabled: NO]; + [_runButton setEnabled: NO]; + + if ([_connection isConnected]) + { + if ([status isEqualToString: @"Starting"]) + { + [_stepInButton setEnabled: YES]; + [_runButton setEnabled: YES]; + } + } } /** @@ -94,6 +108,15 @@ _stack = stack; [_stack retain]; + + if ([_stack count] > 1) + { + [_stepOutButton setEnabled: YES]; + } + [_stepInButton setEnabled: YES]; + [_stepOverButton setEnabled: YES]; + [_runButton setEnabled: YES]; + [self updateSourceViewer]; } -- 2.43.5