From 15c9eeaa9c32773dd11efc7c1ef0aefb075efb22 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 5 Jan 2008 14:07:07 -0800 Subject: [PATCH] Finish the refactoring in the previous commit and now the window title is properly set * Source/DebuggerConnection.h: Removed the definition for -[windowDidClose] * Source/DebuggerConnection.m: ([DebuggerConnection initWithWindowController:port:session:]): Don't set the status in this method because the nib isn't awake yet * Source/DebuggerWindowController.m: ([DebuggerWindowController initWithPort:session:]): Make self key and front ([DebuggerWindowController awakeFromNib]): Set the default status to be "Connecting" ([DebuggerWindowController windowWillClose:]): Removed --- Source/DebuggerConnection.h | 2 -- Source/DebuggerConnection.m | 1 - Source/DebuggerWindowController.m | 11 +++-------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Source/DebuggerConnection.h b/Source/DebuggerConnection.h index 8efc2ff..72c7b9c 100644 --- a/Source/DebuggerConnection.h +++ b/Source/DebuggerConnection.h @@ -34,8 +34,6 @@ // initializer - (id)initWithWindowController:(DebuggerWindowController *)wc port:(int)aPort session:(NSString *)aSession; -- (void)windowDidClose; - // getter - (int)port; - (NSString *)session; diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index 99a0975..d1a71a0 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -42,7 +42,6 @@ // now that we have our host information, open the socket socket = [[SocketWrapper alloc] initWithPort:port]; [socket setDelegate:self]; - [windowController setStatus:@"Connecting"]; [socket connect]; } return self; diff --git a/Source/DebuggerWindowController.m b/Source/DebuggerWindowController.m index d7bbb21..8373c4e 100644 --- a/Source/DebuggerWindowController.m +++ b/Source/DebuggerWindowController.m @@ -36,6 +36,7 @@ { connection = [[DebuggerConnection alloc] initWithWindowController:self port:aPort session:aSession]; expandedRegisters = [[NSMutableArray alloc] init]; + [[self window] makeKeyAndOrderFront:nil]; } return self; } @@ -52,14 +53,8 @@ [sourceViewer setHorizontallyResizable:YES]; [sourceViewerScroller setHasHorizontalScroller:YES]; [sourceViewerScroller display]; -} - -/** - * Called when the window is going to be closed so we can clean up all of our stuff - */ -- (void)windowWillClose:(NSNotification *)aNotification -{ - [connection windowDidClose]; + + [self setStatus:@"Connecting"]; } /** -- 2.22.5