Move the status into the toolbar, and remove it from the bottom of the window.
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Dec 2016 03:44:45 +0000 (22:44 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Dec 2016 03:44:45 +0000 (22:44 -0500)
English.lproj/Debugger.xib
Source/DebuggerController.h
Source/DebuggerController.m
Source/DebuggerModel.m

index 4368e5649874c7ce86947693a98287ce38b96f5a..04dc0ff304c728394451f3e661288aa170153cd6 100644 (file)
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="15G1108" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="DebuggerController">
@@ -12,7 +13,6 @@
                 <outlet property="inspector" destination="569" id="581"/>
                 <outlet property="sourceViewer" destination="496" id="503"/>
                 <outlet property="stackArrayController" destination="36" id="563"/>
-                <outlet property="statusmsg" destination="27" id="446"/>
                 <outlet property="tabView" destination="XU1-a6-Ws7" id="Zhr-ym-q15"/>
                 <outlet property="variablesOutlineView" destination="12" id="567"/>
                 <outlet property="variablesTreeController" destination="59" id="566"/>
                 <rect key="frame" x="0.0" y="0.0" width="769" height="501"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <textField hidden="YES" verticalHuggingPriority="750" id="22">
-                        <rect key="frame" x="447" y="3" width="632" height="14"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="&lt;error&gt;" id="453">
-                            <font key="font" metaFont="smallSystem"/>
-                            <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                        <connections>
-                            <binding destination="-2" name="hidden" keyPath="model.lastError" id="8zF-cL-aNL">
-                                <dictionary key="options">
-                                    <string key="NSValueTransformerName">NSIsNotNil</string>
-                                </dictionary>
-                            </binding>
-                            <binding destination="-2" name="value" keyPath="model.lastError" id="GVw-NL-fO9"/>
-                        </connections>
-                    </textField>
-                    <textField verticalHuggingPriority="750" id="27">
-                        <rect key="frame" x="3" y="0.0" width="196" height="17"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="&lt;status&gt;" id="455">
-                            <font key="font" metaFont="smallSystem"/>
-                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                        <connections>
-                            <binding destination="-2" name="value" keyPath="model.status" id="K7n-DX-SjR"/>
-                        </connections>
-                    </textField>
-                    <splitView autosaveName="DebuggerSplitFrame" dividerStyle="thin" vertical="YES" id="502">
-                        <rect key="frame" x="-1" y="19" width="772" height="483"/>
+                    <splitView misplaced="YES" autosaveName="DebuggerSplitFrame" dividerStyle="thin" vertical="YES" id="502">
+                        <rect key="frame" x="0.0" y="0.0" width="772" height="502"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <customView id="eQ1-kt-gEm">
-                                <rect key="frame" x="0.0" y="0.0" width="211" height="483"/>
+                                <rect key="frame" x="0.0" y="0.0" width="211" height="502"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                 <subviews>
                                     <segmentedControl verticalHuggingPriority="750" id="mRx-aY-U5x">
-                                        <rect key="frame" x="-50" y="459" width="304" height="25"/>
+                                        <rect key="frame" x="-50" y="478" width="304" height="25"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                                         <segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedRounded" trackingMode="selectOne" id="Qgr-HU-m0Y">
                                             <font key="font" metaFont="system"/>
                                         </segmentedCell>
                                     </segmentedControl>
                                     <tabView type="noTabsNoBorder" initialItem="jVS-VL-LBw" id="XU1-a6-Ws7">
-                                        <rect key="frame" x="0.0" y="0.0" width="211" height="461"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="211" height="480"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <font key="font" metaFont="system"/>
                                         <tabViewItems>
                                             <tabViewItem label="Variables" identifier="1" id="jVS-VL-LBw">
                                                 <view key="view" id="cqt-pj-ASk">
-                                                    <rect key="frame" x="0.0" y="0.0" width="211" height="461"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="211" height="480"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
                                                         <scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="11">
-                                                            <rect key="frame" x="0.0" y="0.0" width="300" height="462"/>
+                                                            <rect key="frame" x="0.0" y="0.0" width="300" height="481"/>
                                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                             <clipView key="contentView" id="oXX-ZU-YDL">
-                                                                <rect key="frame" x="1" y="0.0" width="298" height="461"/>
+                                                                <rect key="frame" x="1" y="0.0" width="298" height="480"/>
                                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                 <subviews>
                                                                     <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="14" headerView="467" indentationPerLevel="16" autoresizesOutlineColumn="YES" outlineTableColumn="14" id="12">
-                                                                        <rect key="frame" x="0.0" y="0.0" width="298" height="438"/>
+                                                                        <rect key="frame" x="0.0" y="0.0" width="298" height="457"/>
                                                                         <autoresizingMask key="autoresizingMask"/>
                                                                         <size key="intercellSpacing" width="3" height="2"/>
                                                                         <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                         </connections>
                                                                     </outlineView>
                                                                 </subviews>
-                                                                <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                             </clipView>
                                                             <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="466">
                                                                 <rect key="frame" x="1" y="11" width="53" height="16"/>
                                 </subviews>
                             </customView>
                             <splitView dividerStyle="thin" id="46">
-                                <rect key="frame" x="212" y="0.0" width="560" height="483"/>
+                                <rect key="frame" x="212" y="0.0" width="560" height="502"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
                                     <scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="15">
-                                        <rect key="frame" x="0.0" y="0.0" width="560" height="225"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="560" height="234"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <clipView key="contentView" id="0J4-i7-RBa">
-                                            <rect key="frame" x="1" y="0.0" width="558" height="224"/>
+                                            <rect key="frame" x="1" y="0.0" width="558" height="233"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
                                                 <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" headerView="495" id="16">
-                                                    <rect key="frame" x="0.0" y="0.0" width="558" height="19"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="558" height="210"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <size key="intercellSpacing" width="3" height="2"/>
                                                     <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                     </connections>
                                                 </tableView>
                                             </subviews>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </clipView>
                                         <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="469">
                                             <rect key="frame" x="1" y="207" width="382" height="15"/>
                                         </tableHeaderView>
                                     </scrollView>
                                     <customView id="496" customClass="BSSourceView">
-                                        <rect key="frame" x="0.0" y="226" width="560" height="257"/>
+                                        <rect key="frame" x="0.0" y="235" width="560" height="267"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                     </customView>
                                 </subviews>
                     <toolbarItem implicitItemIdentifier="NSToolbarSpaceItem" id="476"/>
                     <toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="477"/>
                     <toolbarItem implicitItemIdentifier="NSToolbarCustomizeToolbarItem" id="478"/>
-                    <toolbarItem implicitItemIdentifier="0DD9463E-4676-43E6-B885-7A9CB1137956" label="Attached" paletteLabel="" image="5C5E81E6-5645-44D5-9588-4457F99FF803" id="593">
+                    <toolbarItem implicitItemIdentifier="939AEFAE-2116-4DBD-9A48-23CC4336DC28" label="Connection Status" paletteLabel="Connection Status" id="lRk-9f-bXK">
+                        <nil key="toolTip"/>
+                        <size key="minSize" width="38" height="17"/>
+                        <size key="maxSize" width="150" height="24"/>
+                        <textField key="view" horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="qX0-Gp-ynT">
+                            <rect key="frame" x="0.0" y="14" width="150" height="17"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="center" title="Status" bezelStyle="round" id="rIc-hM-8tF">
+                                <font key="font" metaFont="smallSystem"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                            <connections>
+                                <binding destination="-2" name="value" keyPath="model.status" id="Mj5-KA-JTu"/>
+                                <binding destination="-2" name="toolTip" keyPath="model.lastError" id="7eB-It-1T3"/>
+                            </connections>
+                        </textField>
+                    </toolbarItem>
+                    <toolbarItem implicitItemIdentifier="0DD9463E-4676-43E6-B885-7A9CB1137956" label="Attached" paletteLabel="" image="713DDBD6-7482-4EDB-A65C-44F1BA98E360" id="593">
                         <nil key="toolTip"/>
                         <size key="minSize" width="63" height="18"/>
                         <size key="maxSize" width="107" height="18"/>
                         <button key="view" id="591">
                             <rect key="frame" x="0.0" y="14" width="83" height="18"/>
                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                            <buttonCell key="cell" type="bevel" title="Attached" bezelStyle="regularSquare" image="5C5E81E6-5645-44D5-9588-4457F99FF803" imagePosition="left" alignment="left" state="on" inset="2" id="592">
+                            <buttonCell key="cell" type="bevel" title="Attached" bezelStyle="regularSquare" image="713DDBD6-7482-4EDB-A65C-44F1BA98E360" imagePosition="left" alignment="left" state="on" inset="2" id="592">
                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                 <font key="font" metaFont="system"/>
                                 <connections>
                     <toolbarItem reference="480"/>
                     <toolbarItem reference="597"/>
                     <toolbarItem reference="476"/>
-                    <toolbarItem reference="476"/>
                     <toolbarItem reference="584"/>
                     <toolbarItem reference="477"/>
+                    <toolbarItem reference="lRk-9f-bXK"/>
+                    <toolbarItem reference="477"/>
                     <toolbarItem reference="593"/>
                 </defaultToolbarItems>
             </toolbar>
                             <rect key="frame" x="0.0" y="0.0" width="402" height="402"/>
                             <autoresizingMask key="autoresizingMask"/>
                             <subviews>
-                                <textView editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" findStyle="panel" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="578">
+                                <textView editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" usesFontPanel="YES" findStyle="panel" usesRuler="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="578">
                                     <rect key="frame" x="0.0" y="0.0" width="402" height="402"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                                         </fragment>
                                     </attributedString>
                                     <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                    <size key="minSize" width="402" height="402"/>
-                                    <size key="maxSize" width="804" height="10000000"/>
                                     <connections>
                                         <binding destination="59" name="value" keyPath="selection.value" id="580"/>
                                     </connections>
         <userDefaultsController representsSharedInstance="YES" id="582"/>
     </objects>
     <resources>
-        <image name="5C5E81E6-5645-44D5-9588-4457F99FF803" width="18" height="18">
+        <image name="713DDBD6-7482-4EDB-A65C-44F1BA98E360" width="18" height="18">
             <mutableData key="keyedArchiveRepresentation">
 YnBsaXN0MDDUAQIDBAUGW1xYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QFwcI
 ERYbHCc0NTY3ODk6O0JDRElMT1VYVSRudWxs1AkKCwwNDg8QViRjbGFzc1xOU0ltYWdlRmxhZ3NWTlNS
index ce3e45bf07abfc58cdaad01665b6b97a9bbdeafc..695bff33d833ae5c946bc76ff5ccbc2e0b138961 100644 (file)
   
   IBOutlet NSWindow* inspector;
   
-  IBOutlet NSTextField* statusmsg;
-  IBOutlet NSTextField* errormsg;
-  
   IBOutlet BSSourceView* sourceViewer;
 }
 
 @property(readonly) DebuggerBackEnd* connection;
+@property(readonly) DebuggerModel* model;
 @property(readonly) BSSourceView* sourceViewer;
 @property(readonly) NSWindow* inspector;
 
+@property(retain) IBOutlet NSTextField* statusField;
 @property(retain) IBOutlet NSSegmentedControl* segmentControl;
 @property(retain) IBOutlet NSTabView* tabView;
 
@@ -57,8 +56,6 @@
 
 - (void)resetDisplays;
 
-- (void)setError:(NSString*)anError;
-
 - (IBAction)attachedToggled:(id)sender;
 
 - (IBAction)run:(id)sender;
index ec00ad556b9d541045b3530f267eeb79436882d5..ac97e51fe912b844485300166e0b015824534ffd 100644 (file)
     connection.model = _model;
     _model.breakpointManager.connection = connection;
 
+    [_model addObserver:self
+             forKeyPath:@"status"
+                options:NSKeyValueObservingOptionNew
+                context:nil];
+
     expandedVariables = [[NSMutableSet alloc] init];
     [[self window] makeKeyAndOrderFront:nil];
     [[self window] setDelegate:self];
       [connection loadStackFrame:frame];
   } else if (object == stackArrayController && [keyPath isEqualToString:@"selection.source"]) {
     [self updateSourceViewer];
-  } else if (object == _model && [keyPath isEqualToString:@"connected"]) {
-    if ([change[NSKeyValueChangeNewKey] boolValue])
-      [self debuggerConnected];
-    else
-      [self debuggerDisconnected];
+  } else if (object == _model) {
+    if ([keyPath isEqualToString:@"connected"]) {
+      if ([change[NSKeyValueChangeNewKey] boolValue]) {
+        [self debuggerConnected];
+      } else {
+        [self debuggerDisconnected];
+      }
+    } else if ([keyPath isEqualToString:@"status"]) {
+      self.statusField.textColor = self.model.lastError ? [NSColor redColor] : [NSColor textColor];
+    }
   } else if (object == _segmentControl.cell) {
     [[NSUserDefaults standardUserDefaults] setValue:@(_segmentControl.selectedSegment)
                                              forKey:kPrefSelectedDebuggerSegment];
   sourceViewer.file = nil;
 }
 
-/**
- * Sets the status to be "Error" and then displays the error message
- */
-- (void)setError:(NSString*)anError
-{
-  [errormsg setStringValue:anError];
-  [errormsg setHidden:NO];
-}
 
 /**
  * Delegate function for GDBpConnection for when the debugger connects.
  */
 - (void)debuggerConnected
 {
-  [errormsg setHidden:YES];
   if (!self.connection.autoAttach)
     return;
   if ([[NSUserDefaults standardUserDefaults] boolForKey:kPrefBreakOnFirstLine])
index 3d2e292d5d3577fb1a9bb0bf0f04a51fdae5f48f..c5d66560214781b04b17c917200430c5bf158435 100644 (file)
@@ -31,6 +31,8 @@
   if (self = [super init]) {
     _breakpointManager = [[BreakpointManager alloc] init];
     _stack = [NSMutableArray new];
+
+    [self onDisconnect];
   }
   return self;
 }
@@ -54,6 +56,7 @@
 
 - (void)onDisconnect {
   self.connected = NO;
+  self.status = @"Disconnected";
 }
 
 - (void)updateStack:(NSArray<StackFrame*>*)newStack {