Commits

Anonymous committed 5b95a59

Fix export. Fix persisting of item comments. Fix everything. Sorry that was so broken.

  • Participants
  • Parent commits 73d1a8e

Comments (0)

Files changed (15)

File HeadStak.xcworkspace/contents.xcworkspacedata

+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "container:headstak.xcodeproj">
+   </FileRef>
+</Workspace>

File HeadStak.xcworkspace/xcuserdata/veg.xcuserdatad/WorkspaceSettings.xcsettings

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
+	<true/>
+	<key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
+	<true/>
+</dict>
+</plist>

File MainStak.xib

 				<string key="NSWindowContentMaxSize">{480, 600}</string>
 				<string key="NSWindowContentMinSize">{480, 270}</string>
 				<object class="NSView" key="NSWindowView" id="1006">
-					<nil key="NSNextResponder"/>
+					<reference key="NSNextResponder"/>
 					<int key="NSvFlags">256</int>
 					<array class="NSMutableArray" key="NSSubviews">
 						<object class="NSBox" id="711782620">
 						</object>
 					</array>
 					<string key="NSFrameSize">{480, 270}</string>
+					<reference key="NSSuperview"/>
 					<reference key="NSNextKeyView" ref="626424876"/>
 				</object>
-				<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
-				<string key="NSMinSize">{480, 289}</string>
-				<string key="NSMaxSize">{480, 619}</string>
+				<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
+				<string key="NSMinSize">{480, 292}</string>
+				<string key="NSMaxSize">{480, 622}</string>
 				<string key="NSFrameAutosaveName">headstak-HUD</string>
 				<bool key="NSWindowIsRestorable">YES</bool>
 			</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
 						<string key="label">controller</string>
+						<reference key="source" ref="1005"/>
+						<reference key="destination" ref="1001"/>
+					</object>
+					<int key="connectionID">116</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">controller</string>
 						<reference key="source" ref="324665805"/>
 						<reference key="destination" ref="1001"/>
 					</object>
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">114</int>
-		</object>
-		<object class="IBClassDescriber" key="IBDocument.Classes">
-			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
-				<object class="IBPartialClassDescription">
-					<string key="className">StakView</string>
-					<string key="superclassName">NSView</string>
-					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">controller</string>
-						<string key="NS.object.0">StakWindowController</string>
-					</object>
-					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<string key="NS.key.0">controller</string>
-						<object class="IBToOneOutletInfo" key="NS.object.0">
-							<string key="name">controller</string>
-							<string key="candidateClassName">StakWindowController</string>
-						</object>
-					</object>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">./Classes/StakView.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">StakWindow</string>
-					<string key="superclassName">NSPanel</string>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">./Classes/StakWindow.h</string>
-					</object>
-				</object>
-				<object class="IBPartialClassDescription">
-					<string key="className">StakWindowController</string>
-					<string key="superclassName">NSWindowController</string>
-					<dictionary class="NSMutableDictionary" key="outlets">
-						<string key="_caption">NSTextField</string>
-						<string key="_stakView">StakView</string>
-					</dictionary>
-					<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
-						<object class="IBToOneOutletInfo" key="_caption">
-							<string key="name">_caption</string>
-							<string key="candidateClassName">NSTextField</string>
-						</object>
-						<object class="IBToOneOutletInfo" key="_stakView">
-							<string key="name">_stakView</string>
-							<string key="candidateClassName">StakView</string>
-						</object>
-					</dictionary>
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
-						<string key="majorKey">IBProjectSource</string>
-						<string key="minorKey">./Classes/StakWindowController.h</string>
-					</object>
-				</object>
-			</array>
+			<int key="maxID">116</int>
 		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes"/>
 		<int key="IBDocument.localizationMode">0</int>
 		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
 		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
                 pushTime,
                 popTime,
                 ftype,
-                [dict objectForKey:@"description"]
+                [[dict objectForKey:@"description"] csvField]
                 ] dataUsingEncoding:NSUTF8StringEncoding]];
     }
 }
 {
     StakItemView *_view;
     StakDB *_db;
-
-    NSString *_description;
-    NSDate *_pushTime;
-    NSDate *_popTime;
-    NSUInteger _itemType;
-    NSUInteger _itemId;
 }
 
 @property (nonatomic,strong) StakItemView *view;
 @property (nonatomic,strong) StakDB *db;
-@property (nonatomic,strong) NSString *description;
+@property (nonatomic,strong) NSString *itemDescription;
 @property (nonatomic,strong) NSDate *pushTime;
 @property (nonatomic,strong) NSDate *popTime;
 @property (nonatomic) NSUInteger itemType;
         
         _itemType = type;
         NSString *itemTypeString = [db typeNameForId:_itemType];
-        _description = [NSString stringWithFormat:@"%@ - %@\n", itemTypeString, dateDesc];
+        _itemDescription = [NSString stringWithFormat:@"%@ - %@\n", itemTypeString, dateDesc];
         
         [db executeUpdate:@"INSERT INTO stakitems\
          (pushdate, description, itemtype)\
-         values (?,?,?)",now, _description, 
+         values (?,?,?)",now, _itemDescription,
          [NSNumber numberWithInteger:_itemType]];
         
         _itemId = [[self db] lastInsertRowId];
         _pushTime = [StakDB timestampFieldToDate:[dict objectForKey:@"pushdate"]];
         _popTime = [StakDB timestampFieldToDate:[dict objectForKey:@"popdate"]];
         _itemType = [[dict objectForKey:@"itemtype"] integerValue];
-        _description = [dict objectForKey:@"description"];
+        _itemDescription = [dict objectForKey:@"description"];
         _itemId = [[dict objectForKey:@"id"] integerValue];
     }
     return self;
 - (void)save {
     [[self db] executeUpdate:@"UPDATE stakitems SET \
      pushdate = ?, popdate = ?, description = ?, itemtype = ? \
-     WHERE id = ?", [self pushTime], [self popTime], [self description], 
+     WHERE id = ?", [self pushTime], [self popTime], [self itemDescription],
      [NSNumber numberWithInt:[self itemType]], [NSNumber numberWithInt:[self itemId]]];
 }
 

File StakItemView.h

 @class StakView;
 @class StakItem;
 
-@interface StakItemView : NSBox
+@interface StakItemView : NSBox <NSTextViewDelegate>
 {
     NSInteger _origin_y;
 }
 
 - (id)initWithStakItem:(StakItem *)item inStakView:(StakView *)StakView;
-
+- (void)textDidEndEditing:(NSNotification *)aNotification;
 @property (readwrite, strong) NSTextView *content;
 @property (readwrite, strong) StakView *stakView;
 @property (readwrite, strong) NSImage *background;
+@property (readwrite, strong) StakItem *item;
 
 @end

File StakItemView.m

     rect.size.height = 40;
     self = [super initWithFrame:rect];
     if (self) {
-
+        _item = item;
         _origin_y = rect.origin.y;
         _stakView = myStakView;
         
         // Create the Text View for the description
         _content = [[NSTextView alloc] initWithFrame:rect];
         [_content setBackgroundColor:[NSColor colorWithSRGBRed:0.0 green:0.0 blue:0.0 alpha:0.0]];
-        [_content insertText:[NSString stringWithString:[item description]]];
+        [_content insertText:[NSString stringWithString:[item itemDescription]]];
         [_content setEditable:YES];
-        
+        [_content setDelegate:self];
         // Observe changes to the container size so that we can adjust the view size
         [_content addObserver:self forKeyPath:@"textContainer.containerSize" options:NSKeyValueObservingOptionNew context:nil];
 
     [[self background] drawAtPoint:r.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
 }
 
+- (void)textDidEndEditing:(NSNotification *)aNotification {
+    [[self item] setItemDescription:[[self content] string]];
+    [[self item] save];
+}
 @end

File StakWindow.h

 
 #import <AppKit/AppKit.h>
 
+@class StakWindowController;
+
 @interface StakWindow : NSPanel
 
+@property (strong, readwrite) IBOutlet StakWindowController *controller;
 @end

File StakWindow.m

 
 
 #import "StakWindow.h"
+#import "StakWindowController.h"
 
 @implementation StakWindow
 
+- (void)orderOut:(id)sender {
+    [[self controller] windowHiding];
+    [super orderOut:sender];
+}
+
 @end

File StakWindowController.h

 - (BOOL)windowShouldClose:(id)sender;
 - (void)layoutItemViews;
 - (void)openStakWindow;
+- (void)windowHiding;
 
 @end

File StakWindowController.m

     [[self caption] setHidden:NO];
     [self layoutItemViews];
 }
+
+- (void)windowHiding {
+    // This should trigger the textview to announce it has been changed
+    [[self window] makeFirstResponder:[self window]];
+}
+
 @end

File Untitled.xcworkspace/contents.xcworkspacedata

-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "container:headstak.xcodeproj">
-   </FileRef>
-</Workspace>

File Untitled.xcworkspace/xcuserdata/veg.xcuserdatad/WorkspaceSettings.xcsettings

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
-	<true/>
-	<key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
-	<true/>
-</dict>
-</plist>

File headstak-Info.plist

 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.5.2</string>
+	<string>0.5.3</string>
 	<key>CFBundleSignature</key>
 	<string>dR3d</string>
 	<key>CFBundleVersion</key>