Notify javascript when download status changes. Allow js to query information about a download.

This commit is contained in:
Paul Chote
2010-11-19 20:16:02 +13:00
parent 0ee1d39bac
commit b4b05c3f4e
6 changed files with 123 additions and 30 deletions

View File

@@ -17,7 +17,8 @@
@implementation Controller
@synthesize allMods;
@synthesize webView;
- (void) awakeFromNib
- (void)awakeFromNib
{
game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:@"/Users/paul/src/OpenRA"]];
[[JSBridge sharedInstance] setController:self];
@@ -101,7 +102,6 @@
return NO;
}
Download *download = [Download downloadWithURL:url filename:path key:key game:game];
[downloads setObject:download forKey:key];
return YES;
@@ -113,6 +113,11 @@
[downloads removeObjectForKey:key];
}
- (Download *)downloadWithKey:(NSString *)key
{
return [downloads objectForKey:key];
}
#pragma mark Sidebar Datasource and Delegate
- (int)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item
{