Skip to content

Commit

Permalink
Move Breakpoints from a window to a view in the main debugger.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsesek committed Aug 4, 2016
1 parent ed4a877 commit 6f9b4c7
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 153 deletions.
255 changes: 123 additions & 132 deletions English.lproj/Breakpoints.xib

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions English.lproj/MainMenu.xib
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand All @@ -11,7 +11,7 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
<items>
<menuItem title="MacGDBp" id="56">
Expand Down Expand Up @@ -315,12 +315,10 @@
</menu>
<customObject id="225" userLabel="AppDelegate" customClass="AppDelegate">
<connections>
<outlet property="breakpoint" destination="286" id="301"/>
<outlet property="debugger" destination="287" id="302"/>
<outlet property="loggingController_" destination="306" id="307"/>
</connections>
</customObject>
<customObject id="286" customClass="BreakpointController"/>
<customObject id="287" customClass="DebuggerController"/>
<customObject id="306" customClass="LoggingController"/>
<customObject id="288" customClass="SUUpdater"/>
Expand Down
1 change: 0 additions & 1 deletion Source/AppDelegate.h
Expand Up @@ -24,7 +24,6 @@
@interface AppDelegate : NSObject
{
IBOutlet DebuggerController* debugger;
IBOutlet BreakpointController* breakpoint;
IBOutlet LoggingController* loggingController_;
PreferencesController* prefs;
}
Expand Down
7 changes: 2 additions & 5 deletions Source/AppDelegate.m
Expand Up @@ -35,7 +35,6 @@ + (void)load
@autoreleasepool {
NSDictionary* defaults = @{
kPrefPort : @9000,
kPrefBreakpointsWindowVisible : @YES,
kPrefInspectorWindowVisible : @YES,
kPrefPathReplacements : [NSMutableArray array],
kPrefBreakOnFirstLine : @YES,
Expand Down Expand Up @@ -83,10 +82,8 @@ - (IBAction)showDebuggerWindow:(id)sender
*/
- (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];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/BreakpointController.h
Expand Up @@ -19,7 +19,7 @@
#import "BreakpointManager.h"
#import "BSSourceView.h"

@interface BreakpointController : NSWindowController<BSSourceViewDelegate>
@interface BreakpointController : NSViewController<BSSourceViewDelegate>
{
BreakpointManager* manager;

Expand Down
4 changes: 1 addition & 3 deletions Source/BreakpointController.m
Expand Up @@ -28,11 +28,9 @@ @implementation BreakpointController
*/
- (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;
}
Expand Down
9 changes: 8 additions & 1 deletion Source/DebuggerController.m
Expand Up @@ -18,6 +18,7 @@

#import "AppDelegate.h"
#import "BSSourceView.h"
#import "BreakpointController.h"
#import "BreakpointManager.h"
#import "DebuggerBackEnd.h"
#import "DebuggerModel.h"
Expand All @@ -31,7 +32,9 @@ - (void)updateSourceViewer;
- (void)expandVariables;
@end

@implementation DebuggerController
@implementation DebuggerController {
BreakpointController* _breakpointsController;
}

@synthesize connection, sourceViewer, inspector;

Expand Down Expand Up @@ -71,6 +74,7 @@ - (void)dealloc
{
[connection release];
[_model release];
[_breakpointsController release];
[expandedVariables release];
[super dealloc];
}
Expand Down Expand Up @@ -98,6 +102,9 @@ - (void)awakeFromNib
context:nil];
self.connection.autoAttach = [attachedCheckbox_ state] == NSOnState;

_breakpointsController = [[BreakpointController alloc] init];
[[self.tabView tabViewItemAtIndex:1] setView:_breakpointsController.view];

[self updateSegmentControl];

}
Expand Down
3 changes: 0 additions & 3 deletions Source/PreferenceNames.h
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions Source/PreferenceNames.m
Expand Up @@ -18,8 +18,6 @@

NSString* const kPrefPort = @"Port";

NSString* const kPrefBreakpointsWindowVisible = @"BreakpointsWindowVisible";

NSString* const kPrefInspectorWindowVisible = @"InspectorWindowVisible";

NSString* const kPrefPathReplacements = @"PathReplacements";
Expand Down

0 comments on commit 6f9b4c7

Please sign in to comment.