Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 32 additions & 101 deletions ImageLogger.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions ImageLogger/LLAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
//

#import <Cocoa/Cocoa.h>

@interface LLAppDelegate : NSObject <NSApplicationDelegate>
//@class LLImageLogger;
@interface LLAppDelegate : NSObject <NSApplicationDelegate, NSTableViewDelegate>

@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSTableView *table;
@property (assign) IBOutlet NSTextField *numberOfCommands, *loadedImages;
@property (nonatomic) NSArrayController *arrayController;
@property NSPopover *pop;
- (IBAction) loadMore:(id)x;

@end

//@property (assign) IBOutlet NSPathControl *path;
50 changes: 40 additions & 10 deletions ImageLogger/LLAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
//
// LLAppDelegate.m
// ImageLogger
//
// Created by Damien DeVille on 3/27/14.
// Copyright (c) 2014 Damien DeVille. All rights reserved.
//

// LLAppDelegate.m ImageLogger
// Created by Damien DeVille on 3/27/14. Copyright (c) 2014 Damien DeVille. All rights reserved.

#import "LLAppDelegate.h"
#import "LLImageLogger.h"

@implementation LLAppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
// nop
- (void) loadMore:(id)x { NSOpenPanel * p = NSOpenPanel.openPanel;

[_table unbind:NSContentBinding]; // dunno why this is necessary.. idiotic.
[p beginSheetModalForWindow:_window
completionHandler:^(NSInteger r) { NSError *e; NSURL *u; NSBundle *b;

if (r != NSFileHandlingPanelOKButton || !p.URLs.count) return;

NSLog (@"Loading %@", u = [p.URLs[0]filePathURL]);

if (!(b = [NSBundle bundleWithURL:u])) return;

[b preflightAndReturnError:&e] && !e ? [b load], NSLog(@"Bundle:%@", b) : NSLog(@"Error:%@", e);

[_table bind:NSContentBinding toObject:_arrayController withKeyPath:@"arrangedObjects" options:nil];
}];
}

- (NSArrayController*) arrayController { return _arrayController = _arrayController ?: ({

[_arrayController = NSArrayController.new bind:NSContentArrayBinding toObject:LLImageLogger.logger withKeyPath:@"images" options:nil]; _arrayController; });
}

- (void) applicationDidFinishLaunching:(NSNotification*)n {

[_table bind:NSContentBinding toObject:self.arrayController withKeyPath:@"arrangedObjects" options:nil];
[_loadedImages bind:NSValueBinding toObject:_arrayController withKeyPath:@"arrangedObjects.@count" options:nil];
[_numberOfCommands bind:NSValueBinding toObject:_arrayController withKeyPath:@"[email protected]" options:nil];
// [_table bind:NSToolTipBinding toObject:self.arrayController withKeyPath:[NSSelectedObjectBinding stringByAppendingString:@".flags"] options:nil];
}
-(void) tableViewSelectionDidChange:(NSNotification *)n {

NSTableView* tv = n.object;
NSLog(@"%@",[[self.arrayController.arrangedObjects objectAtIndex:tv.selectedRow] valueForKey:@"flags"]);

}
@end

int main(int argc, const char **argv) { return NSApplicationMain(argc, argv); }
338 changes: 296 additions & 42 deletions ImageLogger/Base.lproj/MainMenu.xib → ImageLogger/MainMenu.xib

Large diffs are not rendered by default.

Binary file added ImageLogger/dylib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions ImageLogger/en.lproj/Credits.rtf

This file was deleted.

2 changes: 0 additions & 2 deletions ImageLogger/en.lproj/InfoPlist.strings

This file was deleted.

Loading