From 55f5039f4fc54566693aab4ead1b2755d08ed44c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 9 Jul 2008 13:39:55 -0400 Subject: [PATCH] Use prefernce values to set the port and IDE key, rather than hard-coded values * Source/DebuggerWindowController.m+h: (initWithPort:session:): Renamed to -[init] and use preference values to set the port and IDE key * Source/AppDelegate.m: (applicationDidFinishLaunching:): Simply call init on DebuggerWindowController --- Source/AppDelegate.m | 3 +-- Source/DebuggerWindowController.h | 2 -- Source/DebuggerWindowController.m | 10 +++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 9b684c0..496de10 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -49,8 +49,7 @@ */ - (void)applicationDidFinishLaunching:(NSNotification *)notif { - // TODO: use preference values - debugger = [[DebuggerWindowController alloc] initWithPort:9000 session:@"macgdbp"]; + debugger = [[DebuggerWindowController alloc] init]; breakpoint = [[BreakpointWindowController alloc] init]; [NSThread detachNewThreadSelector:@selector(versionCheck:) toTarget:self withObject:self]; } diff --git a/Source/DebuggerWindowController.h b/Source/DebuggerWindowController.h index ddfe46a..b3fe5d0 100644 --- a/Source/DebuggerWindowController.h +++ b/Source/DebuggerWindowController.h @@ -45,8 +45,6 @@ @property(readonly) DebuggerConnection *connection; @property(readonly) BSSourceView *sourceViewer; -- (id)initWithPort:(int)aPort session:(NSString *)aSession; - - (void)resetDisplays; - (void)setStatus:(NSString *)aStatus; diff --git a/Source/DebuggerWindowController.m b/Source/DebuggerWindowController.m index a02e9e3..e904201 100644 --- a/Source/DebuggerWindowController.m +++ b/Source/DebuggerWindowController.m @@ -29,13 +29,17 @@ @synthesize connection, sourceViewer; /** - * Initializes the window controller and sets the connection + * Initializes the window controller and sets the connection using preference + * values */ -- (id)initWithPort:(int)aPort session:(NSString *)aSession +- (id)init { if (self = [super initWithWindowNibName:@"Debugger"]) { - connection = [[DebuggerConnection alloc] initWithWindowController:self port:aPort session:aSession]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + connection = [[DebuggerConnection alloc] initWithWindowController:self + port:[defaults integerForKey:@"Port"] + session:[defaults stringForKey:@"IDEKey"]]; expandedRegisters = [[NSMutableSet alloc] init]; [[self window] makeKeyAndOrderFront:nil]; } -- 2.43.5