From 6f9b4c773ae1f13d547e121920cc9f4a36c757ab Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 4 Aug 2016 01:10:02 -0400 Subject: [PATCH] Move Breakpoints from a window to a view in the main debugger. --- English.lproj/Breakpoints.xib | 255 ++++++++++++++++------------------ English.lproj/MainMenu.xib | 8 +- Source/AppDelegate.h | 1 - Source/AppDelegate.m | 7 +- Source/BreakpointController.h | 2 +- Source/BreakpointController.m | 4 +- Source/DebuggerController.m | 9 +- Source/PreferenceNames.h | 3 - Source/PreferenceNames.m | 2 - 9 files changed, 138 insertions(+), 153 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index 61d20b0..6bcfb2f 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -1,147 +1,138 @@ - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 2b87266..9aa41d3 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -11,7 +11,7 @@ - + @@ -315,12 +315,10 @@ - - diff --git a/Source/AppDelegate.h b/Source/AppDelegate.h index dfcb9d5..1350a98 100644 --- a/Source/AppDelegate.h +++ b/Source/AppDelegate.h @@ -24,7 +24,6 @@ @interface AppDelegate : NSObject { IBOutlet DebuggerController* debugger; - IBOutlet BreakpointController* breakpoint; IBOutlet LoggingController* loggingController_; PreferencesController* prefs; } diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 7e39838..9030732 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -35,7 +35,6 @@ @autoreleasepool { NSDictionary* defaults = @{ kPrefPort : @9000, - kPrefBreakpointsWindowVisible : @YES, kPrefInspectorWindowVisible : @YES, kPrefPathReplacements : [NSMutableArray array], kPrefBreakOnFirstLine : @YES, @@ -83,10 +82,8 @@ */ - (IBAction)showBreakpointWindow:(id)sender { - if (![[breakpoint window] isVisible] || ![[breakpoint window] isKeyWindow]) - [[breakpoint window] makeKeyAndOrderFront:sender]; - else - [[breakpoint window] orderOut:sender]; + [[debugger window] makeKeyAndOrderFront:sender]; + [debugger.segmentControl setSelectedSegment:2]; } /** diff --git a/Source/BreakpointController.h b/Source/BreakpointController.h index 70552d9..c5c4069 100644 --- a/Source/BreakpointController.h +++ b/Source/BreakpointController.h @@ -19,7 +19,7 @@ #import "BreakpointManager.h" #import "BSSourceView.h" -@interface BreakpointController : NSWindowController +@interface BreakpointController : NSViewController { BreakpointManager* manager; diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index 34a52a1..f6b9028 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -28,11 +28,9 @@ */ - (id)init { - if (self = [super initWithWindowNibName:@"Breakpoints"]) + if (self = [super initWithNibName:@"Breakpoints" bundle:nil]) { manager = [BreakpointManager sharedManager]; - if ([[NSUserDefaults standardUserDefaults] boolForKey:kPrefBreakpointsWindowVisible]) - [[self window] orderBack:nil]; } return self; } diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index d057f85..896980f 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -18,6 +18,7 @@ #import "AppDelegate.h" #import "BSSourceView.h" +#import "BreakpointController.h" #import "BreakpointManager.h" #import "DebuggerBackEnd.h" #import "DebuggerModel.h" @@ -31,7 +32,9 @@ - (void)expandVariables; @end -@implementation DebuggerController +@implementation DebuggerController { + BreakpointController* _breakpointsController; +} @synthesize connection, sourceViewer, inspector; @@ -71,6 +74,7 @@ { [connection release]; [_model release]; + [_breakpointsController release]; [expandedVariables release]; [super dealloc]; } @@ -98,6 +102,9 @@ context:nil]; self.connection.autoAttach = [attachedCheckbox_ state] == NSOnState; + _breakpointsController = [[BreakpointController alloc] init]; + [[self.tabView tabViewItemAtIndex:1] setView:_breakpointsController.view]; + [self updateSegmentControl]; } diff --git a/Source/PreferenceNames.h b/Source/PreferenceNames.h index 0a1b5ef..3a38ac1 100644 --- a/Source/PreferenceNames.h +++ b/Source/PreferenceNames.h @@ -19,9 +19,6 @@ // NSNumber integer for the port to listen on. extern NSString* const kPrefPort; -// NSNumber bool for whether the breakpoints window is visible. -extern NSString* const kPrefBreakpointsWindowVisible; - // NSNumber bool for whether the inspector window is visible. extern NSString* const kPrefInspectorWindowVisible; diff --git a/Source/PreferenceNames.m b/Source/PreferenceNames.m index 1c398ef..787b648 100644 --- a/Source/PreferenceNames.m +++ b/Source/PreferenceNames.m @@ -18,8 +18,6 @@ NSString* const kPrefPort = @"Port"; -NSString* const kPrefBreakpointsWindowVisible = @"BreakpointsWindowVisible"; - NSString* const kPrefInspectorWindowVisible = @"InspectorWindowVisible"; NSString* const kPrefPathReplacements = @"PathReplacements"; -- 2.43.5