Gut the osx launcher of everything except for the necessary platform shims (Ensure mono is installed, set DYLD_LIBRARY_PATH, Hide dock/menubar if running in fullscreen).
TODO: Parse the yaml to disable menubar only if running fullscreen, register openra:// urls.
This commit is contained in:
@@ -7,36 +7,16 @@
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
@class Mod;
|
||||
@class SidebarEntry;
|
||||
@class GameInstall;
|
||||
@class JSBridge;
|
||||
@class Download;
|
||||
|
||||
@interface Controller : NSObject
|
||||
{
|
||||
SidebarEntry *sidebarItems;
|
||||
GameInstall *game;
|
||||
NSDictionary *allMods;
|
||||
NSMutableArray *httpRequests;
|
||||
NSMutableDictionary *downloads;
|
||||
BOOL hasMono;
|
||||
NSString *monoPath;
|
||||
NSString *gamePath;
|
||||
|
||||
IBOutlet NSWindow *window;
|
||||
IBOutlet NSOutlineView *outlineView;
|
||||
IBOutlet WebView *webView;
|
||||
}
|
||||
@property(readonly) NSDictionary *allMods;
|
||||
@property(readonly) WebView *webView;
|
||||
|
||||
- (void)launchMod:(NSString *)mod;
|
||||
- (void)populateModInfo;
|
||||
- (SidebarEntry *)sidebarModsTree;
|
||||
- (SidebarEntry *)sidebarOtherTree;
|
||||
|
||||
- (void)fetchURL:(NSString *)url withCallback:(NSString *)cb;
|
||||
- (BOOL)registerDownload:(NSString *)key withURL:(NSString *)url filePath:(NSString *)path;
|
||||
- (Download *)downloadWithKey:(NSString *)key;
|
||||
- (BOOL)initMono;
|
||||
@end
|
||||
|
||||
@@ -7,17 +7,8 @@
|
||||
*/
|
||||
|
||||
#import "Controller.h"
|
||||
#import "Mod.h"
|
||||
#import "SidebarEntry.h"
|
||||
#import "GameInstall.h"
|
||||
#import "ImageAndTextCell.h"
|
||||
#import "JSBridge.h"
|
||||
#import "Download.h"
|
||||
#import "HttpRequest.h"
|
||||
|
||||
@implementation Controller
|
||||
@synthesize allMods;
|
||||
@synthesize webView;
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
@@ -28,43 +19,11 @@
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
NSString *gamePath = [[NSUserDefaults standardUserDefaults] stringForKey:@"gamepath"];
|
||||
gamePath = [[NSUserDefaults standardUserDefaults] stringForKey:@"gamepath"];
|
||||
|
||||
hasMono = [self initMono];
|
||||
|
||||
NSLog(@"%d, %@",hasMono, monoPath);
|
||||
if (hasMono)
|
||||
{
|
||||
game = [[GameInstall alloc] initWithGamePath:gamePath monoPath:monoPath];
|
||||
[[JSBridge sharedInstance] setController:self];
|
||||
downloads = [[NSMutableDictionary alloc] init];
|
||||
httpRequests = [[NSMutableArray alloc] init];
|
||||
|
||||
NSTableColumn *col = [outlineView tableColumnWithIdentifier:@"mods"];
|
||||
ImageAndTextCell *imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease];
|
||||
[col setDataCell:imageAndTextCell];
|
||||
|
||||
sidebarItems = [[SidebarEntry headerWithTitle:@""] retain];
|
||||
[self populateModInfo];
|
||||
id modsRoot = [self sidebarModsTree];
|
||||
[sidebarItems addChild:modsRoot];
|
||||
//id otherRoot = [self sidebarOtherTree];
|
||||
//[sidebarItems addChild:otherRoot];
|
||||
|
||||
|
||||
[outlineView reloadData];
|
||||
[outlineView expandItem:modsRoot expandChildren:YES];
|
||||
|
||||
if ([[modsRoot children] count] > 0)
|
||||
{
|
||||
id firstMod = [[modsRoot children] objectAtIndex:0];
|
||||
int row = [outlineView rowForItem:firstMod];
|
||||
[outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
|
||||
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: [firstMod url]]];
|
||||
}
|
||||
|
||||
//[outlineView expandItem:otherRoot expandChildren:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
@@ -77,19 +36,18 @@
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"OpenRA requires the Mono Framework version 2.6.7 or later."];
|
||||
|
||||
[alert beginSheetModalForWindow:window modalDelegate:self didEndSelector:@selector(monoAlertEnded:code:context:) contextInfo:NULL];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)monoAlertEnded:(NSAlert *)alert
|
||||
code:(int)button
|
||||
context:(void *)v
|
||||
{
|
||||
if (button == NSAlertDefaultReturn)
|
||||
if ([alert runModal] == NSAlertDefaultReturn)
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.go-mono.com/mono-downloads/download.html"]];
|
||||
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self launchMod:@"cnc"];
|
||||
[NSApp terminate: nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)initMono
|
||||
{
|
||||
@@ -143,203 +101,49 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[sidebarItems release]; sidebarItems = nil;
|
||||
[downloads release]; downloads = nil;
|
||||
[httpRequests release]; httpRequests = nil;
|
||||
[monoPath release]; monoPath = nil;
|
||||
[gamePath release]; gamePath = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)populateModInfo
|
||||
{
|
||||
// Get info for all installed mods
|
||||
[allMods autorelease];
|
||||
allMods = [[game infoForMods:[game installedMods]] retain];
|
||||
}
|
||||
|
||||
- (SidebarEntry *)sidebarModsTree
|
||||
{
|
||||
SidebarEntry *rootItem = [SidebarEntry headerWithTitle:@"MODS"];
|
||||
for (id key in allMods)
|
||||
{
|
||||
id aMod = [allMods objectForKey:key];
|
||||
if ([aMod standalone])
|
||||
{
|
||||
id path = [[game gamePath] stringByAppendingPathComponent:@"mods"];
|
||||
id child = [SidebarEntry entryWithMod:aMod allMods:allMods basePath:path];
|
||||
[rootItem addChild:child];
|
||||
}
|
||||
}
|
||||
|
||||
return rootItem;
|
||||
}
|
||||
|
||||
- (SidebarEntry *)sidebarOtherTree
|
||||
{
|
||||
SidebarEntry *rootItem = [SidebarEntry headerWithTitle:@"OTHER"];
|
||||
[rootItem addChild:[SidebarEntry entryWithTitle:@"Support" url:nil icon:nil]];
|
||||
[rootItem addChild:[SidebarEntry entryWithTitle:@"Credits" url:nil icon:nil]];
|
||||
|
||||
return rootItem;
|
||||
}
|
||||
|
||||
-(void)launchMod:(NSString *)mod
|
||||
{
|
||||
[game launchMod:mod];
|
||||
// Use LaunchServices because neither NSTask or NSWorkspace support Info.plist _and_ arguments pre-10.6
|
||||
|
||||
// First argument is the directory to run in
|
||||
// Second...Nth arguments are passed to OpenRA.Game.exe
|
||||
// Launcher wrapper sets mono --debug, gl renderer and support dir.
|
||||
NSArray *args = [NSArray arrayWithObjects:@"--launch", gamePath, monoPath,
|
||||
[NSString stringWithFormat:@"SupportDir=%@",[@"~/Library/Application Support/OpenRA" stringByExpandingTildeInPath]],
|
||||
[NSString stringWithFormat:@"Game.Mods=%@",mod],
|
||||
nil];
|
||||
|
||||
FSRef appRef;
|
||||
CFURLGetFSRef((CFURLRef)[NSURL URLWithString:[[[NSBundle mainBundle] executablePath] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]], &appRef);
|
||||
|
||||
// Set the launch parameters
|
||||
LSApplicationParameters params;
|
||||
params.version = 0;
|
||||
params.flags = kLSLaunchDefaults | kLSLaunchNewInstance;
|
||||
params.application = &appRef;
|
||||
params.asyncLaunchRefCon = NULL;
|
||||
params.environment = NULL; // CFDictionaryRef of environment variables; could be useful
|
||||
params.argv = (CFArrayRef)args;
|
||||
params.initialEvent = NULL;
|
||||
|
||||
ProcessSerialNumber psn;
|
||||
OSStatus err = LSOpenApplication(¶ms, &psn);
|
||||
|
||||
// Bring the game window to the front
|
||||
if (err == noErr)
|
||||
SetFrontProcess(&psn);
|
||||
}
|
||||
|
||||
- (BOOL)registerDownload:(NSString *)key withURL:(NSString *)url filePath:(NSString *)path;
|
||||
{
|
||||
if ([downloads objectForKey:key] != nil)
|
||||
return NO;
|
||||
|
||||
[downloads setObject:[Download downloadWithURL:url filename:path key:key game:game]
|
||||
forKey:key];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (Download *)downloadWithKey:(NSString *)key
|
||||
{
|
||||
return [downloads objectForKey:key];
|
||||
}
|
||||
|
||||
- (void)fetchURL:(NSString *)url withCallback:(NSString *)cb
|
||||
{
|
||||
// Clean up any completed requests
|
||||
for (int i = [httpRequests count] - 1; i >= 0; i--)
|
||||
if ([[httpRequests objectAtIndex:i] terminated])
|
||||
[httpRequests removeObjectAtIndex:i];
|
||||
|
||||
// Create request
|
||||
[httpRequests addObject:[HttpRequest requestWithURL:url callback:cb game:game]];
|
||||
}
|
||||
|
||||
#pragma mark Sidebar Datasource and Delegate
|
||||
- (NSInteger)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
// Can be called before awakeFromNib; return nothing
|
||||
if (sidebarItems == nil)
|
||||
return 0;
|
||||
|
||||
// Root item
|
||||
if (item == nil)
|
||||
return [[sidebarItems children] count];
|
||||
|
||||
return [[item children] count];
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
|
||||
{
|
||||
return (item == nil) ? YES : [[item children] count] != 0;
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView
|
||||
child:(NSInteger)index
|
||||
ofItem:(id)item
|
||||
{
|
||||
if (item == nil)
|
||||
return [[sidebarItems children] objectAtIndex:index];
|
||||
|
||||
return [[item children] objectAtIndex:index];
|
||||
}
|
||||
|
||||
-(BOOL)outlineView:(NSOutlineView*)outlineView isGroupItem:(id)item
|
||||
{
|
||||
if (item == nil)
|
||||
return NO;
|
||||
|
||||
return [item isHeader];
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView
|
||||
objectValueForTableColumn:(NSTableColumn *)tableColumn
|
||||
byItem:(id)item
|
||||
{
|
||||
return [item title];
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
|
||||
{
|
||||
// don't allow headers to be selected
|
||||
if ([item isHeader] || [item url] == nil)
|
||||
return NO;
|
||||
|
||||
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[item url]]];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
if ([[tableColumn identifier] isEqualToString:@"mods"])
|
||||
{
|
||||
if ([cell isKindOfClass:[ImageAndTextCell class]])
|
||||
{
|
||||
[(ImageAndTextCell*)cell setImage:[item icon]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark WebView delegates
|
||||
- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame
|
||||
{
|
||||
// Cancel any in progress http requests
|
||||
for (HttpRequest *r in httpRequests)
|
||||
[r cancel];
|
||||
|
||||
[windowObject setValue:[JSBridge sharedInstance] forKey:@"external"];
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)dictionary
|
||||
{
|
||||
NSLog(@"%@",dictionary);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Application delegates
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
int count = 0;
|
||||
for (NSString *key in downloads)
|
||||
if ([[(Download *)[downloads objectForKey:key] status] isEqualToString:@"DOWNLOADING"])
|
||||
count++;
|
||||
|
||||
if (count == 0)
|
||||
return NSTerminateNow;
|
||||
|
||||
NSString *format = count == 1 ? @"1 download is" : [NSString stringWithFormat:@"%d downloads are",count];
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:@"Are you sure you want to quit?"
|
||||
defaultButton:@"Wait"
|
||||
alternateButton:@"Quit"
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"%@ in progress and will be cancelled if you quit.", format];
|
||||
|
||||
[alert beginSheetModalForWindow:window modalDelegate:self didEndSelector:@selector(quitAlertEnded:code:context:) contextInfo:NULL];
|
||||
return NSTerminateLater;
|
||||
}
|
||||
|
||||
- (void)quitAlertEnded:(NSAlert *)alert
|
||||
code:(int)button
|
||||
context:(void *)v
|
||||
{
|
||||
NSApplicationTerminateReply reply = (button == NSAlertDefaultReturn) ? NSTerminateCancel : NSTerminateNow;
|
||||
[[NSApplication sharedApplication] replyToApplicationShouldTerminate:reply];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification
|
||||
{
|
||||
// Cancel all in-progress downloads
|
||||
for (NSString *key in downloads)
|
||||
{
|
||||
Download *d = [downloads objectForKey:key];
|
||||
if ([[d status] isEqualToString:@"DOWNLOADING"])
|
||||
[d cancel];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class GameInstall;
|
||||
@interface Download : NSObject
|
||||
{
|
||||
NSString *key;
|
||||
NSString *url;
|
||||
NSString *filename;
|
||||
GameInstall *game;
|
||||
NSTask *task;
|
||||
NSString *status;
|
||||
NSString *error;
|
||||
int bytesCompleted;
|
||||
int bytesTotal;
|
||||
}
|
||||
|
||||
@property(readonly) NSString *key;
|
||||
@property(readonly) NSString *status;
|
||||
@property(readonly) int bytesCompleted;
|
||||
@property(readonly) int bytesTotal;
|
||||
@property(readonly) NSString *error;
|
||||
|
||||
+ (id)downloadWithURL:(NSString *)aURL filename:(NSString *)aFilename key:(NSString *)aKey game:(GameInstall *)aGame;
|
||||
- (id)initWithURL:(NSString *)aURL filename:(NSString *)aFilename key:(NSString *)aKey game:(GameInstall *)game;
|
||||
- (BOOL)start;
|
||||
- (BOOL)cancel;
|
||||
- (BOOL)extractToPath:(NSString *)aPath;
|
||||
@end
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "Download.h"
|
||||
#import "GameInstall.h"
|
||||
#import "JSBridge.h"
|
||||
|
||||
@implementation Download
|
||||
@synthesize key;
|
||||
@synthesize status;
|
||||
@synthesize bytesCompleted;
|
||||
@synthesize bytesTotal;
|
||||
@synthesize error;
|
||||
|
||||
+ (id)downloadWithURL:(NSString *)aURL filename:(NSString *)aFilename key:(NSString *)aKey game:(GameInstall *)aGame
|
||||
{
|
||||
id newObject = [[self alloc] initWithURL:aURL filename:aFilename key:aKey game:aGame];
|
||||
[newObject autorelease];
|
||||
return newObject;
|
||||
}
|
||||
|
||||
- (id)initWithURL:(NSString *)aURL filename:(NSString *)aFilename key:(NSString *)aKey game:(GameInstall *)aGame;
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
url = [aURL retain];
|
||||
filename = [aFilename retain];
|
||||
key = [aKey retain];
|
||||
game = [aGame retain];
|
||||
error = @"";
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:filename])
|
||||
{
|
||||
status = @"DOWNLOADED";
|
||||
bytesCompleted = bytesTotal = [[[NSFileManager defaultManager] attributesOfItemAtPath:filename error:NULL] fileSize];
|
||||
}
|
||||
else
|
||||
{
|
||||
status = @"AVAILABLE";
|
||||
bytesCompleted = bytesTotal = -1;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)start
|
||||
{
|
||||
status = @"DOWNLOADING";
|
||||
task = [game runAsyncUtilityWithArg:[NSString stringWithFormat:@"--download-url=%@,%@",url,filename]
|
||||
delegate:self
|
||||
responseSelector:@selector(downloadResponded:)
|
||||
terminatedSelector:@selector(utilityTerminated:)];
|
||||
[task retain];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)cancel
|
||||
{
|
||||
status = @"ERROR";
|
||||
error = @"Download Cancelled";
|
||||
|
||||
[[NSFileManager defaultManager] removeItemAtPath:filename error:NULL];
|
||||
bytesCompleted = bytesTotal = -1;
|
||||
|
||||
[[JSBridge sharedInstance] runCallback:@"downloadProgressed" withArgument:[self key]];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:NSFileHandleReadCompletionNotification
|
||||
object:[[task standardOutput] fileHandleForReading]];
|
||||
[task terminate];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)downloadResponded:(NSNotification *)n
|
||||
{
|
||||
NSData *data = [[n userInfo] valueForKey:NSFileHandleNotificationDataItem];
|
||||
NSString *response = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
|
||||
|
||||
// Response can contain multiple lines, or no lines. Split into lines, and parse each in turn
|
||||
NSArray *lines = [response componentsSeparatedByString:@"\n"];
|
||||
for (NSString *line in lines)
|
||||
{
|
||||
NSRange separator = [line rangeOfString:@":"];
|
||||
if (separator.location == NSNotFound)
|
||||
continue; // We only care about messages of the form key: value
|
||||
|
||||
NSString *type = [line substringToIndex:separator.location];
|
||||
NSString *message = [[line substringFromIndex:separator.location+1]
|
||||
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
|
||||
if ([type isEqualToString:@"Error"])
|
||||
{
|
||||
status = @"ERROR";
|
||||
[error autorelease];
|
||||
if ([[message substringToIndex:36] isEqualToString:@"The remote server returned an error:"])
|
||||
error = [[message substringFromIndex:37] retain];
|
||||
else
|
||||
error = [message retain];
|
||||
}
|
||||
|
||||
else if ([type isEqualToString:@"Status"])
|
||||
{
|
||||
if ([message isEqualToString:@"Completed"])
|
||||
{
|
||||
status = @"DOWNLOADED";
|
||||
}
|
||||
|
||||
// Parse download status info
|
||||
int done,total;
|
||||
if (sscanf([message UTF8String], "%*d%% %d/%d bytes", &done, &total) == 2)
|
||||
{
|
||||
bytesCompleted = done;
|
||||
bytesTotal = total;
|
||||
}
|
||||
}
|
||||
}
|
||||
[[JSBridge sharedInstance] runCallback:@"downloadProgressed" withArgument:[self key]];
|
||||
|
||||
// Keep reading
|
||||
if ([n object] != nil)
|
||||
[[n object] readInBackgroundAndNotify];
|
||||
}
|
||||
|
||||
- (BOOL)extractToPath:(NSString *)aPath
|
||||
{
|
||||
status = @"EXTRACTING";
|
||||
task = [game runAsyncUtilityWithArg:[NSString stringWithFormat:@"--extract-zip=%@,%@",filename,aPath]
|
||||
delegate:self
|
||||
responseSelector:@selector(extractResponded:)
|
||||
terminatedSelector:@selector(utilityTerminated:)];
|
||||
[task retain];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)extractResponded:(NSNotification *)n
|
||||
{
|
||||
NSData *data = [[n userInfo] valueForKey:NSFileHandleNotificationDataItem];
|
||||
NSString *response = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
|
||||
|
||||
// Response can contain multiple lines, or no lines. Split into lines, and parse each in turn
|
||||
NSArray *lines = [response componentsSeparatedByString:@"\n"];
|
||||
for (NSString *line in lines)
|
||||
{
|
||||
NSLog(@"%@",line);
|
||||
NSRange separator = [line rangeOfString:@":"];
|
||||
if (separator.location == NSNotFound)
|
||||
continue; // We only care about messages of the form key: value
|
||||
|
||||
NSString *type = [line substringToIndex:separator.location];
|
||||
NSString *message = [[line substringFromIndex:separator.location+1]
|
||||
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
|
||||
if ([type isEqualToString:@"Error"])
|
||||
{
|
||||
status = @"ERROR";
|
||||
[error autorelease];
|
||||
error = [message retain];
|
||||
}
|
||||
|
||||
else if ([type isEqualToString:@"Status"])
|
||||
{
|
||||
if ([message isEqualToString:@"Completed"])
|
||||
{
|
||||
status = @"EXTRACTED";
|
||||
}
|
||||
}
|
||||
}
|
||||
[[JSBridge sharedInstance] runCallback:@"extractProgressed" withArgument:[self key]];
|
||||
|
||||
// Keep reading
|
||||
if ([n object] != nil)
|
||||
[[n object] readInBackgroundAndNotify];
|
||||
}
|
||||
|
||||
- (void)utilityTerminated:(NSNotification *)n
|
||||
{
|
||||
NSLog(@"download terminated");
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc removeObserver:self name:NSFileHandleReadCompletionNotification object:[[task standardOutput] fileHandleForReading]];
|
||||
[nc removeObserver:self name:NSTaskDidTerminateNotification object:task];
|
||||
[task release]; task = nil;
|
||||
|
||||
if (status == @"ERROR")
|
||||
{
|
||||
[[NSFileManager defaultManager] removeItemAtPath:filename error:NULL];
|
||||
bytesCompleted = bytesTotal = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,32 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">10H574</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10J567</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">823</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<string key="IBDocument.HIToolboxVersion">462.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.WebKitIBPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>804</string>
|
||||
<string>804</string>
|
||||
</object>
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">823</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="589"/>
|
||||
<integer value="57"/>
|
||||
<integer value="29"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.WebKitIBPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
@@ -268,264 +257,6 @@
|
||||
</object>
|
||||
<string key="NSName">_NSMainMenu</string>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="972006081">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{335, 281}, {659, 469}}</string>
|
||||
<int key="NSWTFlags">1954021376</int>
|
||||
<string key="NSWindowTitle">OpenRA Launcher</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
<object class="NSView" key="NSWindowView" id="439893737">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSSplitView" id="991115689">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomView" id="488988116">
|
||||
<reference key="NSNextResponder" ref="991115689"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSScrollView" id="183995183">
|
||||
<reference key="NSNextResponder" ref="488988116"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSClipView" id="162526188">
|
||||
<reference key="NSNextResponder" ref="183995183"/>
|
||||
<int key="NSvFlags">2304</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSOutlineView" id="87877668">
|
||||
<reference key="NSNextResponder" ref="162526188"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{188, 468}</string>
|
||||
<reference key="NSSuperview" ref="162526188"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="_NSCornerView" key="NSCornerView">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{224, 0}, {16, 17}}</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="NSTableColumns">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSTableColumn" id="196480461">
|
||||
<string key="NSIdentifier">mods</string>
|
||||
<double key="NSWidth">185</double>
|
||||
<double key="NSMinWidth">16</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
<object class="NSTableHeaderCell" key="NSHeaderCell">
|
||||
<int key="NSCellFlags">75628096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">11</double>
|
||||
<int key="NSfFlags">3100</int>
|
||||
</object>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">headerTextColor</string>
|
||||
<object class="NSColor" key="NSColor" id="542357528">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextFieldCell" key="NSDataCell" id="585043019">
|
||||
<int key="NSCellFlags">337772096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents">Text Cell</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="87877668"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="995106217">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<reference key="NSColor" ref="542357528"/>
|
||||
</object>
|
||||
</object>
|
||||
<int key="NSResizingMask">3</int>
|
||||
<bool key="NSIsResizeable">YES</bool>
|
||||
<bool key="NSIsEditable">YES</bool>
|
||||
<reference key="NSTableView" ref="87877668"/>
|
||||
</object>
|
||||
</object>
|
||||
<double key="NSIntercellSpacingWidth">3</double>
|
||||
<double key="NSIntercellSpacingHeight">0.0</double>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">_sourceListBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSGridColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">gridColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<double key="NSRowHeight">20</double>
|
||||
<int key="NSTvFlags">-767557632</int>
|
||||
<reference key="NSDelegate"/>
|
||||
<reference key="NSDataSource"/>
|
||||
<int key="NSColumnAutoresizingStyle">4</int>
|
||||
<int key="NSDraggingSourceMaskForLocal">15</int>
|
||||
<int key="NSDraggingSourceMaskForNonLocal">0</int>
|
||||
<bool key="NSAllowsTypeSelect">YES</bool>
|
||||
<int key="NSTableViewSelectionHighlightStyle">1</int>
|
||||
<int key="NSTableViewDraggingDestinationStyle">1</int>
|
||||
<float key="NSOutlineViewIndentationPerLevelKey">14</float>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{1, 1}, {188, 468}}</string>
|
||||
<reference key="NSSuperview" ref="183995183"/>
|
||||
<reference key="NSNextKeyView" ref="87877668"/>
|
||||
<reference key="NSDocView" ref="87877668"/>
|
||||
<reference key="NSBGColor" ref="995106217"/>
|
||||
<int key="NScvFlags">4</int>
|
||||
</object>
|
||||
<object class="NSScroller" id="815097677">
|
||||
<reference key="NSNextResponder" ref="183995183"/>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{224, 17}, {15, 102}}</string>
|
||||
<reference key="NSSuperview" ref="183995183"/>
|
||||
<reference key="NSTarget" ref="183995183"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99786323308944702</double>
|
||||
</object>
|
||||
<object class="NSScroller" id="839108210">
|
||||
<reference key="NSNextResponder" ref="183995183"/>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{1, 453}, {141, 15}}</string>
|
||||
<reference key="NSSuperview" ref="183995183"/>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="183995183"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99295777082443237</double>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{190, 470}</string>
|
||||
<reference key="NSSuperview" ref="488988116"/>
|
||||
<reference key="NSNextKeyView" ref="162526188"/>
|
||||
<int key="NSsFlags">562</int>
|
||||
<reference key="NSVScroller" ref="815097677"/>
|
||||
<reference key="NSHScroller" ref="839108210"/>
|
||||
<reference key="NSContentView" ref="162526188"/>
|
||||
<bytes key="NSScrollAmts">QSAAAEEgAABBoAAAQaAAAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{189, 469}</string>
|
||||
<reference key="NSSuperview" ref="991115689"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="257490795">
|
||||
<reference key="NSNextResponder" ref="991115689"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="WebView" id="90421773">
|
||||
<reference key="NSNextResponder" ref="257490795"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableSet" key="NSDragTypes">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="set.sortedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Apple HTML pasteboard type</string>
|
||||
<string>Apple PDF pasteboard type</string>
|
||||
<string>Apple PICT pasteboard type</string>
|
||||
<string>Apple URL pasteboard type</string>
|
||||
<string>Apple Web Archive pasteboard type</string>
|
||||
<string>NSColor pasteboard type</string>
|
||||
<string>NSFilenamesPboardType</string>
|
||||
<string>NSStringPboardType</string>
|
||||
<string>NeXT RTFD pasteboard type</string>
|
||||
<string>NeXT Rich Text Format v1.0 pasteboard type</string>
|
||||
<string>NeXT TIFF v4.0 pasteboard type</string>
|
||||
<string>WebURLsWithTitlesPboardType</string>
|
||||
<string>public.png</string>
|
||||
<string>public.url</string>
|
||||
<string>public.url-name</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{469, 469}</string>
|
||||
<reference key="NSSuperview" ref="257490795"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="FrameName"/>
|
||||
<string key="GroupName"/>
|
||||
<object class="WebPreferences" key="Preferences">
|
||||
<string key="Identifier"/>
|
||||
<object class="NSMutableDictionary" key="Values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>WebKitDefaultFixedFontSize</string>
|
||||
<string>WebKitDefaultFontSize</string>
|
||||
<string>WebKitMinimumFontSize</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="12"/>
|
||||
<integer value="12"/>
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="UseBackForwardList">YES</bool>
|
||||
<bool key="AllowsUndo">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{190, 0}, {469, 469}}</string>
|
||||
<reference key="NSSuperview" ref="991115689"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{659, 469}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<bool key="NSIsVertical">YES</bool>
|
||||
<int key="NSDividerStyle">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{659, 469}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="79272443">
|
||||
<string key="NSClassName">Controller</string>
|
||||
</object>
|
||||
@@ -605,46 +336,6 @@
|
||||
</object>
|
||||
<int key="connectionID">493</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="87877668"/>
|
||||
<reference key="destination" ref="79272443"/>
|
||||
</object>
|
||||
<int key="connectionID">582</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="87877668"/>
|
||||
<reference key="destination" ref="79272443"/>
|
||||
</object>
|
||||
<int key="connectionID">583</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">outlineView</string>
|
||||
<reference key="source" ref="79272443"/>
|
||||
<reference key="destination" ref="87877668"/>
|
||||
</object>
|
||||
<int key="connectionID">585</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">webView</string>
|
||||
<reference key="source" ref="79272443"/>
|
||||
<reference key="destination" ref="90421773"/>
|
||||
</object>
|
||||
<int key="connectionID">590</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">frameLoadDelegate</string>
|
||||
<reference key="source" ref="90421773"/>
|
||||
<reference key="destination" ref="79272443"/>
|
||||
</object>
|
||||
<int key="connectionID">591</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
@@ -653,14 +344,6 @@
|
||||
</object>
|
||||
<int key="connectionID">592</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="79272443"/>
|
||||
<reference key="destination" ref="972006081"/>
|
||||
</object>
|
||||
<int key="connectionID">593</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -835,24 +518,6 @@
|
||||
<reference key="object" ref="1011231497"/>
|
||||
<reference key="parent" ref="835318025"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">371</int>
|
||||
<reference key="object" ref="972006081"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="439893737"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">372</int>
|
||||
<reference key="object" ref="439893737"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="991115689"/>
|
||||
</object>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">490</int>
|
||||
<reference key="object" ref="448692316"/>
|
||||
@@ -876,88 +541,11 @@
|
||||
<reference key="object" ref="105068016"/>
|
||||
<reference key="parent" ref="992780483"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">555</int>
|
||||
<reference key="object" ref="991115689"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="257490795"/>
|
||||
<reference ref="488988116"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">557</int>
|
||||
<reference key="object" ref="257490795"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="90421773"/>
|
||||
</object>
|
||||
<reference key="parent" ref="991115689"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">556</int>
|
||||
<reference key="object" ref="488988116"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="183995183"/>
|
||||
</object>
|
||||
<reference key="parent" ref="991115689"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">568</int>
|
||||
<reference key="object" ref="183995183"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="815097677"/>
|
||||
<reference ref="839108210"/>
|
||||
<reference ref="87877668"/>
|
||||
</object>
|
||||
<reference key="parent" ref="488988116"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">569</int>
|
||||
<reference key="object" ref="815097677"/>
|
||||
<reference key="parent" ref="183995183"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">570</int>
|
||||
<reference key="object" ref="839108210"/>
|
||||
<reference key="parent" ref="183995183"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">571</int>
|
||||
<reference key="object" ref="87877668"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="196480461"/>
|
||||
</object>
|
||||
<reference key="parent" ref="183995183"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">573</int>
|
||||
<reference key="object" ref="196480461"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="585043019"/>
|
||||
</object>
|
||||
<reference key="parent" ref="87877668"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">576</int>
|
||||
<reference key="object" ref="585043019"/>
|
||||
<reference key="parent" ref="196480461"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">579</int>
|
||||
<reference key="object" ref="79272443"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">589</int>
|
||||
<reference key="object" ref="90421773"/>
|
||||
<reference key="parent" ref="257490795"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -1004,40 +592,21 @@
|
||||
<string>29.ImportedFromIB2</string>
|
||||
<string>29.WindowOrigin</string>
|
||||
<string>29.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>371.IBEditorWindowLastContentRect</string>
|
||||
<string>371.IBPluginDependency</string>
|
||||
<string>371.IBWindowTemplateEditedContentRect</string>
|
||||
<string>371.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>371.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>371.windowTemplate.maxSize</string>
|
||||
<string>372.IBPluginDependency</string>
|
||||
<string>490.IBPluginDependency</string>
|
||||
<string>491.IBEditorWindowLastContentRect</string>
|
||||
<string>491.IBPluginDependency</string>
|
||||
<string>492.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>5.ImportedFromIB2</string>
|
||||
<string>555.IBPluginDependency</string>
|
||||
<string>556.IBPluginDependency</string>
|
||||
<string>557.IBPluginDependency</string>
|
||||
<string>56.IBPluginDependency</string>
|
||||
<string>56.ImportedFromIB2</string>
|
||||
<string>568.IBPluginDependency</string>
|
||||
<string>568.IBViewBoundsToFrameTransform</string>
|
||||
<string>569.IBPluginDependency</string>
|
||||
<string>57.IBEditorWindowLastContentRect</string>
|
||||
<string>57.IBPluginDependency</string>
|
||||
<string>57.ImportedFromIB2</string>
|
||||
<string>57.editorWindowContentRectSynchronizationRect</string>
|
||||
<string>570.IBPluginDependency</string>
|
||||
<string>571.IBPluginDependency</string>
|
||||
<string>573.IBPluginDependency</string>
|
||||
<string>576.IBPluginDependency</string>
|
||||
<string>579.IBPluginDependency</string>
|
||||
<string>58.IBPluginDependency</string>
|
||||
<string>58.ImportedFromIB2</string>
|
||||
<string>589.IBPluginDependency</string>
|
||||
<string>589.IBViewBoundsToFrameTransform</string>
|
||||
<string>92.IBPluginDependency</string>
|
||||
<string>92.ImportedFromIB2</string>
|
||||
</object>
|
||||
@@ -1083,13 +652,6 @@
|
||||
<integer value="1"/>
|
||||
<string>{74, 862}</string>
|
||||
<string>{{6, 978}, {478, 20}}</string>
|
||||
<string>{{378, 537}, {659, 469}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{378, 537}, {659, 469}}</string>
|
||||
<integer value="1"/>
|
||||
<string>{{33, 99}, {480, 360}}</string>
|
||||
<string>{3.40282e+38, 3.40282e+38}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{540, 813}, {161, 23}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1097,28 +659,14 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAADBoAAAwy4AAA</bytes>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{392, 653}, {190, 183}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{23, 794}, {245, 183}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.WebKitIBPlugin</string>
|
||||
<object class="NSAffineTransform"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
@@ -1148,44 +696,16 @@
|
||||
<string key="className">Controller</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>outlineView</string>
|
||||
<string>webView</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSOutlineView</string>
|
||||
<string>WebView</string>
|
||||
<string>NSWindow</string>
|
||||
</object>
|
||||
<string key="NS.key.0">window</string>
|
||||
<string key="NS.object.0">NSWindow</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>outlineView</string>
|
||||
<string>webView</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">outlineView</string>
|
||||
<string key="candidateClassName">NSOutlineView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">webView</string>
|
||||
<string key="candidateClassName">WebView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="NS.key.0">window</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">window</string>
|
||||
<string key="candidateClassName">NSWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Controller.h</string>
|
||||
@@ -1194,14 +714,6 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSActionCell</string>
|
||||
<string key="superclassName">NSCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSApplication</string>
|
||||
<string key="superclassName">NSResponder</string>
|
||||
@@ -1245,30 +757,6 @@
|
||||
<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSCell</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSControl</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="310914472">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSFormatter</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSMenu</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
@@ -1306,7 +794,10 @@
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="310914472"/>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
@@ -1356,7 +847,7 @@
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="209986087">
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
|
||||
</object>
|
||||
@@ -1377,7 +868,7 @@
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="809545482">
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
|
||||
</object>
|
||||
@@ -1599,11 +1090,6 @@
|
||||
<string key="minorKey">WebKit.framework/Headers/WebUIDelegate.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSOutlineView</string>
|
||||
<string key="superclassName">NSTableView</string>
|
||||
<reference key="sourceIdentifier" ref="209986087"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -1619,51 +1105,6 @@
|
||||
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSScrollView</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSScrollView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSScroller</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSScroller.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSSplitView</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSSplitView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTableColumn</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSTableColumn.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTableView</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<reference key="sourceIdentifier" ref="809545482"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTextFieldCell</string>
|
||||
<string key="superclassName">NSActionCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -1709,116 +1150,13 @@
|
||||
<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">WebView</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>goBack:</string>
|
||||
<string>goForward:</string>
|
||||
<string>makeTextLarger:</string>
|
||||
<string>makeTextSmaller:</string>
|
||||
<string>makeTextStandardSize:</string>
|
||||
<string>reload:</string>
|
||||
<string>reloadFromOrigin:</string>
|
||||
<string>stopLoading:</string>
|
||||
<string>takeStringURLFrom:</string>
|
||||
<string>toggleContinuousSpellChecking:</string>
|
||||
<string>toggleSmartInsertDelete:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>goBack:</string>
|
||||
<string>goForward:</string>
|
||||
<string>makeTextLarger:</string>
|
||||
<string>makeTextSmaller:</string>
|
||||
<string>makeTextStandardSize:</string>
|
||||
<string>reload:</string>
|
||||
<string>reloadFromOrigin:</string>
|
||||
<string>stopLoading:</string>
|
||||
<string>takeStringURLFrom:</string>
|
||||
<string>toggleContinuousSpellChecking:</string>
|
||||
<string>toggleSmartInsertDelete:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">goBack:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">goForward:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextLarger:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextSmaller:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextStandardSize:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">reload:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">reloadFromOrigin:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">stopLoading:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">takeStringURLFrom:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">toggleContinuousSpellChecking:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">toggleSmartInsertDelete:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">WebKit.framework/Headers/WebView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1060" key="NS.object.0"/>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class Mod;
|
||||
@class Controller;
|
||||
@interface GameInstall : NSObject {
|
||||
NSString *gamePath;
|
||||
NSString *monoPath;
|
||||
NSMutableDictionary *downloadTasks;
|
||||
}
|
||||
@property(readonly) NSString *gamePath;
|
||||
|
||||
-(id)initWithGamePath:(NSString *)gamepath monoPath:(NSString *)monopath;
|
||||
-(void)launchMod:(NSString *)mod;
|
||||
- (NSString *)runUtilityQuery:(NSString *)arg;
|
||||
- (NSArray *)installedMods;
|
||||
- (NSDictionary *)infoForMods:(NSArray *)mods;
|
||||
- (NSTask *)runAsyncUtilityWithArg:(NSString *)arg
|
||||
delegate:(id)object
|
||||
responseSelector:(SEL)response
|
||||
terminatedSelector:(SEL)terminated;
|
||||
@end
|
||||
@@ -1,180 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "GameInstall.h"
|
||||
#import "Controller.h"
|
||||
#import "Mod.h"
|
||||
|
||||
@implementation GameInstall
|
||||
@synthesize gamePath;
|
||||
|
||||
-(id)initWithGamePath:(NSString *)gamepath monoPath:(NSString *)monopath
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
gamePath = [gamepath retain];
|
||||
monoPath = [monopath retain];
|
||||
downloadTasks = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[gamePath release]; gamePath = nil;
|
||||
[monoPath release]; monoPath = nil;
|
||||
[downloadTasks release]; downloadTasks = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *)installedMods
|
||||
{
|
||||
id raw = [self runUtilityQuery:@"-l"];
|
||||
id mods = [raw stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
return [mods componentsSeparatedByString:@"\n"];
|
||||
}
|
||||
|
||||
- (NSDictionary *)infoForMods:(NSArray *)mods
|
||||
{
|
||||
id query = [NSString stringWithFormat:@"-i=%@",[mods componentsJoinedByString:@","]];
|
||||
NSArray *lines = [[self runUtilityQuery:query] componentsSeparatedByString:@"\n"];
|
||||
|
||||
NSMutableDictionary *ret = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary *fields = nil;
|
||||
NSString *current = nil;
|
||||
for (id l in lines)
|
||||
{
|
||||
NSString *line = [l stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if (line == nil || [line length] == 0)
|
||||
continue;
|
||||
|
||||
id kv = [line componentsSeparatedByString:@":"];
|
||||
if ([kv count] < 2)
|
||||
continue;
|
||||
|
||||
id key = [[kv objectAtIndex:0] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
id value = [[kv objectAtIndex:1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
|
||||
if ([key isEqualToString:@"Error"])
|
||||
{
|
||||
NSLog(@"Error: %@",value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ([key isEqualToString:@"Mod"])
|
||||
{
|
||||
// Commit prev mod
|
||||
if (current != nil)
|
||||
{
|
||||
id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields path:path] forKey:current];
|
||||
}
|
||||
NSLog(@"Parsing mod `%@`",value);
|
||||
current = value;
|
||||
fields = [NSMutableDictionary dictionary];
|
||||
}
|
||||
|
||||
if (fields != nil)
|
||||
[fields setObject:[value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]
|
||||
forKey:key];
|
||||
}
|
||||
if (current != nil)
|
||||
{
|
||||
id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields path:path] forKey:current];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
-(void)launchMod:(NSString *)mod
|
||||
{
|
||||
// Use LaunchServices because neither NSTask or NSWorkspace support Info.plist _and_ arguments pre-10.6
|
||||
|
||||
// First argument is the directory to run in
|
||||
// Second...Nth arguments are passed to OpenRA.Game.exe
|
||||
// Launcher wrapper sets mono --debug, gl renderer and support dir.
|
||||
NSArray *args = [NSArray arrayWithObjects:@"--launch", gamePath, monoPath,
|
||||
[NSString stringWithFormat:@"SupportDir=%@",[@"~/Library/Application Support/OpenRA" stringByExpandingTildeInPath]],
|
||||
[NSString stringWithFormat:@"Game.Mods=%@",mod],
|
||||
nil];
|
||||
|
||||
FSRef appRef;
|
||||
CFURLGetFSRef((CFURLRef)[NSURL URLWithString:[[[NSBundle mainBundle] executablePath] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]], &appRef);
|
||||
|
||||
// Set the launch parameters
|
||||
LSApplicationParameters params;
|
||||
params.version = 0;
|
||||
params.flags = kLSLaunchDefaults | kLSLaunchNewInstance;
|
||||
params.application = &appRef;
|
||||
params.asyncLaunchRefCon = NULL;
|
||||
params.environment = NULL; // CFDictionaryRef of environment variables; could be useful
|
||||
params.argv = (CFArrayRef)args;
|
||||
params.initialEvent = NULL;
|
||||
|
||||
ProcessSerialNumber psn;
|
||||
OSStatus err = LSOpenApplication(¶ms, &psn);
|
||||
|
||||
// Bring the game window to the front
|
||||
if (err == noErr)
|
||||
SetFrontProcess(&psn);
|
||||
}
|
||||
|
||||
- (NSString *)runUtilityQuery:(NSString *)arg
|
||||
{
|
||||
NSPipe *outPipe = [NSPipe pipe];
|
||||
NSMutableArray *taskArgs = [NSMutableArray arrayWithObject:@"OpenRA.Utility.exe"];
|
||||
[taskArgs addObject:arg];
|
||||
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath:gamePath];
|
||||
[task setLaunchPath:monoPath];
|
||||
[task setArguments:taskArgs];
|
||||
[task setStandardOutput:outPipe];
|
||||
[task setStandardError:[task standardOutput]];
|
||||
[task launch];
|
||||
NSData *data = [[outPipe fileHandleForReading] readDataToEndOfFile];
|
||||
[task waitUntilExit];
|
||||
[task release];
|
||||
|
||||
return [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
|
||||
}
|
||||
|
||||
- (NSTask *)runAsyncUtilityWithArg:(NSString *)arg
|
||||
delegate:(id)object
|
||||
responseSelector:(SEL)response
|
||||
terminatedSelector:(SEL)terminated
|
||||
{
|
||||
NSTask *task = [[[NSTask alloc] init] autorelease];
|
||||
NSPipe *pipe = [NSPipe pipe];
|
||||
|
||||
NSMutableArray *taskArgs = [NSMutableArray arrayWithObject:@"OpenRA.Utility.exe"];
|
||||
[taskArgs addObject:arg];
|
||||
|
||||
[task setCurrentDirectoryPath:gamePath];
|
||||
[task setLaunchPath:monoPath];
|
||||
[task setArguments:taskArgs];
|
||||
[task setStandardOutput:pipe];
|
||||
|
||||
NSFileHandle *readHandle = [pipe fileHandleForReading];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:object
|
||||
selector:response
|
||||
name:NSFileHandleReadCompletionNotification
|
||||
object:readHandle];
|
||||
[nc addObserver:object
|
||||
selector:terminated
|
||||
name:NSTaskDidTerminateNotification
|
||||
object:task];
|
||||
[task launch];
|
||||
[readHandle readInBackgroundAndNotify];
|
||||
return task;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class WebScriptObject;
|
||||
@class GameInstall;
|
||||
@interface HttpRequest : NSObject
|
||||
{
|
||||
NSString *url;
|
||||
NSString *callback;
|
||||
GameInstall *game;
|
||||
NSTask *task;
|
||||
NSMutableData *response;
|
||||
BOOL cancelled;
|
||||
}
|
||||
@property(readonly) NSString *url;
|
||||
|
||||
+ (id)requestWithURL:(NSString *)aURL callback:(NSString *)aCallback game:(GameInstall *)aGame;
|
||||
- (id)initWithURL:(NSString *)aURL callback:(NSString *)aCallback game:(GameInstall *)aGame;
|
||||
- (void)cancel;
|
||||
- (BOOL)terminated;
|
||||
|
||||
@end
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "HttpRequest.h"
|
||||
#import "JSBridge.h"
|
||||
#import "GameInstall.h"
|
||||
|
||||
@implementation HttpRequest
|
||||
@synthesize url;
|
||||
|
||||
+ (id)requestWithURL:(NSString *)aURL callback:(NSString *)aCallback game:(GameInstall *)aGame
|
||||
{
|
||||
id newObject = [[self alloc] initWithURL:aURL callback:aCallback game:aGame];
|
||||
[newObject autorelease];
|
||||
return newObject;
|
||||
}
|
||||
|
||||
- (id)initWithURL:(NSString *)aURL callback:(NSString *)aCallback game:(GameInstall *)aGame;
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
url = [aURL retain];
|
||||
callback = [aCallback retain];
|
||||
game = [aGame retain];
|
||||
response = [[NSMutableData alloc] init];
|
||||
|
||||
task = [game runAsyncUtilityWithArg:[NSString stringWithFormat:@"--download-url=%@",url]
|
||||
delegate:self
|
||||
responseSelector:@selector(utilityResponded:)
|
||||
terminatedSelector:@selector(utilityTerminated:)];
|
||||
[task retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)cancel
|
||||
{
|
||||
cancelled = YES;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:NSFileHandleReadCompletionNotification
|
||||
object:[[task standardOutput] fileHandleForReading]];
|
||||
[task terminate];
|
||||
}
|
||||
|
||||
- (void)utilityResponded:(NSNotification *)n
|
||||
{
|
||||
NSData *data = [[n userInfo] valueForKey:NSFileHandleNotificationDataItem];
|
||||
[response appendData:data];
|
||||
|
||||
// Keep reading
|
||||
if ([n object] != nil)
|
||||
[[n object] readInBackgroundAndNotify];
|
||||
}
|
||||
|
||||
- (void)utilityTerminated:(NSNotification *)n
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc removeObserver:self name:NSFileHandleReadCompletionNotification object:[[task standardOutput] fileHandleForReading]];
|
||||
[nc removeObserver:self name:NSTaskDidTerminateNotification object:task];
|
||||
[task release]; task = nil;
|
||||
|
||||
if (!cancelled)
|
||||
{
|
||||
NSString *data = [[[NSString alloc] initWithData:response encoding:NSASCIIStringEncoding] autorelease];
|
||||
[[JSBridge sharedInstance] runCallback:callback withArgument:data];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)terminated
|
||||
{
|
||||
return task == nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,62 +0,0 @@
|
||||
//
|
||||
// File: ImageAndTextCell.h
|
||||
//
|
||||
// Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously.
|
||||
//
|
||||
// Version: 1.0
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (C) 2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface ImageAndTextCell : NSTextFieldCell
|
||||
{
|
||||
@private
|
||||
NSImage *image;
|
||||
}
|
||||
|
||||
- (void)setImage:(NSImage *)anImage;
|
||||
- (NSImage*)image;
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView;
|
||||
- (NSSize)cellSize;
|
||||
|
||||
@end
|
||||
@@ -1,252 +0,0 @@
|
||||
//
|
||||
// File: ImageAndTextCell.m
|
||||
//
|
||||
// Abstract: Subclass of NSTextFieldCell which can display text and an image simultaneously.
|
||||
//
|
||||
// Version: 1.0
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright (C) 2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import "ImageAndTextCell.h"
|
||||
//#import "BaseNode.h"
|
||||
|
||||
@implementation ImageAndTextCell
|
||||
|
||||
#define kIconImageSize 16.0
|
||||
|
||||
#define kImageOriginXOffset 3
|
||||
#define kImageOriginYOffset 1
|
||||
|
||||
#define kTextOriginXOffset 2
|
||||
#define kTextOriginYOffset 2
|
||||
#define kTextHeightAdjust 4
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// init:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
// we want a smaller font
|
||||
[self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// dealloc:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (void)dealloc
|
||||
{
|
||||
[image release];
|
||||
image = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// copyWithZone:zone
|
||||
// -------------------------------------------------------------------------------
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
ImageAndTextCell *cell = (ImageAndTextCell*)[super copyWithZone:zone];
|
||||
cell->image = [image retain];
|
||||
return cell;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// setImage:anImage
|
||||
// -------------------------------------------------------------------------------
|
||||
- (void)setImage:(NSImage*)anImage
|
||||
{
|
||||
if (anImage != image)
|
||||
{
|
||||
[image autorelease];
|
||||
image = [anImage retain];
|
||||
[image setSize:NSMakeSize(kIconImageSize, kIconImageSize)];
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// image:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (NSImage*)image
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// isGroupCell:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (BOOL)isGroupCell
|
||||
{
|
||||
return ([self image] == nil && [[self title] length] > 0);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// titleRectForBounds:cellRect
|
||||
//
|
||||
// Returns the proper bound for the cell's title while being edited
|
||||
// -------------------------------------------------------------------------------
|
||||
- (NSRect)titleRectForBounds:(NSRect)cellRect
|
||||
{
|
||||
// the cell has an image: draw the normal item cell
|
||||
NSSize imageSize;
|
||||
NSRect imageFrame;
|
||||
|
||||
imageSize = [image size];
|
||||
NSDivideRect(cellRect, &imageFrame, &cellRect, 3 + imageSize.width, NSMinXEdge);
|
||||
|
||||
imageFrame.origin.x += kImageOriginXOffset;
|
||||
imageFrame.origin.y -= kImageOriginYOffset;
|
||||
imageFrame.size = imageSize;
|
||||
|
||||
imageFrame.origin.y += ceil((cellRect.size.height - imageFrame.size.height) / 2);
|
||||
|
||||
NSRect newFrame = cellRect;
|
||||
newFrame.origin.x += kTextOriginXOffset;
|
||||
newFrame.origin.y += kTextOriginYOffset;
|
||||
newFrame.size.height -= kTextHeightAdjust;
|
||||
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// editWithFrame:inView:editor:delegate:event
|
||||
// -------------------------------------------------------------------------------
|
||||
- (void)editWithFrame:(NSRect)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject event:(NSEvent*)theEvent
|
||||
{
|
||||
NSRect textFrame = [self titleRectForBounds:aRect];
|
||||
[super editWithFrame:textFrame inView:controlView editor:textObj delegate:anObject event:theEvent];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// selectWithFrame:inView:editor:delegate:event:start:length
|
||||
// -------------------------------------------------------------------------------
|
||||
- (void)selectWithFrame:(NSRect)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
|
||||
{
|
||||
NSRect textFrame = [self titleRectForBounds:aRect];
|
||||
[super selectWithFrame:textFrame inView:controlView editor:textObj delegate:anObject start:selStart length:selLength];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// drawWithFrame:cellFrame:controlView:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
|
||||
{
|
||||
if (image != nil)
|
||||
{
|
||||
// the cell has an image: draw the normal item cell
|
||||
NSSize imageSize;
|
||||
NSRect imageFrame;
|
||||
|
||||
imageSize = [image size];
|
||||
NSDivideRect(cellFrame, &imageFrame, &cellFrame, 3 + imageSize.width, NSMinXEdge);
|
||||
|
||||
imageFrame.origin.x += kImageOriginXOffset;
|
||||
imageFrame.origin.y -= kImageOriginYOffset;
|
||||
imageFrame.size = imageSize;
|
||||
|
||||
if ([controlView isFlipped])
|
||||
imageFrame.origin.y += ceil((cellFrame.size.height + imageFrame.size.height) / 2);
|
||||
else
|
||||
imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
|
||||
[image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver];
|
||||
|
||||
NSRect newFrame = cellFrame;
|
||||
newFrame.origin.x += kTextOriginXOffset;
|
||||
newFrame.origin.y += kTextOriginYOffset;
|
||||
newFrame.size.height -= kTextHeightAdjust;
|
||||
[super drawWithFrame:newFrame inView:controlView];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self isGroupCell])
|
||||
{
|
||||
// Center the text in the cellFrame, and call super to do thew ork of actually drawing.
|
||||
CGFloat yOffset = floor((NSHeight(cellFrame) - [[self attributedStringValue] size].height) / 2.0);
|
||||
cellFrame.origin.y += yOffset;
|
||||
cellFrame.size.height -= (kTextOriginYOffset*yOffset);
|
||||
[super drawWithFrame:cellFrame inView:controlView];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// cellSize:
|
||||
// -------------------------------------------------------------------------------
|
||||
- (NSSize)cellSize
|
||||
{
|
||||
NSSize cellSize = [super cellSize];
|
||||
cellSize.width += (image ? [image size].width : 0) + 3;
|
||||
return cellSize;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// hitTestForEvent:
|
||||
//
|
||||
// In 10.5, we need you to implement this method for blocking drag and drop of a given cell.
|
||||
// So NSCell hit testing will determine if a row can be dragged or not.
|
||||
//
|
||||
// NSTableView calls this cell method when starting a drag, if the hit cell returns
|
||||
// NSCellHitTrackableArea, the particular row will be tracked instead of dragged.
|
||||
//
|
||||
// -------------------------------------------------------------------------------
|
||||
/*
|
||||
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
|
||||
{
|
||||
NSInteger result = NSCellHitContentArea;
|
||||
|
||||
NSOutlineView* hostingOutlineView = (NSOutlineView*)[self controlView];
|
||||
if (hostingOutlineView)
|
||||
{
|
||||
NSInteger selectedRow = [hostingOutlineView selectedRow];
|
||||
BaseNode* node = [[hostingOutlineView itemAtRow:selectedRow] representedObject];
|
||||
|
||||
if (![node isDraggable]) // is the node isDraggable (i.e. non-file system based objects)
|
||||
result = NSCellHitTrackableArea;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class Controller;
|
||||
@class Download;
|
||||
@interface JSBridge : NSObject {
|
||||
Controller *controller;
|
||||
NSDictionary *methods;
|
||||
}
|
||||
@property(readonly) NSDictionary *methods;
|
||||
|
||||
+ (JSBridge *)sharedInstance;
|
||||
- (void)setController:(Controller *)aController;
|
||||
- (void)runCallback:(NSString *)cb withArgument:(NSString *)arg;
|
||||
@end
|
||||
@@ -1,236 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "JSBridge.h"
|
||||
#import "Controller.h"
|
||||
#import "Download.h"
|
||||
#import "Mod.h"
|
||||
|
||||
static JSBridge *SharedInstance;
|
||||
|
||||
@implementation JSBridge
|
||||
@synthesize methods;
|
||||
|
||||
+ (JSBridge *)sharedInstance
|
||||
{
|
||||
if (SharedInstance == nil)
|
||||
SharedInstance = [[JSBridge alloc] init];
|
||||
|
||||
return SharedInstance;
|
||||
}
|
||||
|
||||
+ (NSString *)webScriptNameForSelector:(SEL)sel
|
||||
{
|
||||
return [[[JSBridge sharedInstance] methods] objectForKey:NSStringFromSelector(sel)];
|
||||
}
|
||||
|
||||
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)sel
|
||||
{
|
||||
return [[[JSBridge sharedInstance] methods] objectForKey:NSStringFromSelector(sel)] == nil;
|
||||
}
|
||||
|
||||
-(id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
methods = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"launchMod", NSStringFromSelector(@selector(launchMod:)),
|
||||
@"log", NSStringFromSelector(@selector(log:)),
|
||||
@"existsInMod", NSStringFromSelector(@selector(fileExists:inMod:)),
|
||||
@"metadata", NSStringFromSelector(@selector(metadata:forMod:)),
|
||||
@"httpRequest", NSStringFromSelector(@selector(httpRequest:withCallback:)),
|
||||
|
||||
// File downloading
|
||||
@"registerDownload", NSStringFromSelector(@selector(registerDownload:withURL:filename:)),
|
||||
@"startDownload", NSStringFromSelector(@selector(startDownload:)),
|
||||
@"cancelDownload", NSStringFromSelector(@selector(cancelDownload:)),
|
||||
@"downloadStatus", NSStringFromSelector(@selector(downloadStatus:)),
|
||||
@"downloadError", NSStringFromSelector(@selector(downloadError:)),
|
||||
@"bytesCompleted", NSStringFromSelector(@selector(bytesCompleted:)),
|
||||
@"bytesTotal", NSStringFromSelector(@selector(bytesTotal:)),
|
||||
@"extractDownload", NSStringFromSelector(@selector(extractDownload:toPath:inMod:)),
|
||||
nil] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setController:(Controller *)aController
|
||||
{
|
||||
controller = [aController retain];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[controller release]; controller = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)runCallback:(NSString *)cb withArgument:(NSString *)arg
|
||||
{
|
||||
NSString *cmd = [NSString stringWithFormat:@"%@('%@')", cb,
|
||||
[arg stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]];
|
||||
[[[controller webView] windowScriptObject] evaluateWebScript:cmd];
|
||||
}
|
||||
|
||||
#pragma mark JS API methods
|
||||
|
||||
- (BOOL)launchMod:(NSString *)aMod
|
||||
{
|
||||
// Build the list of mods to launch
|
||||
NSMutableArray *mods = [NSMutableArray array];
|
||||
NSString *current = aMod;
|
||||
|
||||
// Assemble the mods in the reverse order to work around an engine bug
|
||||
while (current != nil)
|
||||
{
|
||||
Mod *mod = [[controller allMods] objectForKey:current];
|
||||
if (mod == nil)
|
||||
{
|
||||
NSLog(@"Unknown mod: %@", current);
|
||||
return NO;
|
||||
}
|
||||
[mods addObject:current];
|
||||
|
||||
if ([mod standalone])
|
||||
current = nil;
|
||||
else
|
||||
current = [mod requires];
|
||||
}
|
||||
// Todo: Reverse the array ordering once the engine bug is fixed
|
||||
|
||||
[controller launchMod:[mods componentsJoinedByString:@","]];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)registerDownload:(NSString *)key withURL:(NSString *)url filename:(NSString *)filename
|
||||
{
|
||||
// Create the download directory if it doesn't exist
|
||||
NSString *downloadDir = [@"~/Library/Application Support/OpenRA/Downloads/" stringByExpandingTildeInPath];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:downloadDir])
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:downloadDir withIntermediateDirectories:YES attributes:nil error:NULL];
|
||||
|
||||
// Disallow traversing directories; take only the last component
|
||||
NSString *path = [downloadDir stringByAppendingPathComponent:[filename lastPathComponent]];
|
||||
return [controller registerDownload:key withURL:url filePath:path];
|
||||
}
|
||||
|
||||
- (NSString *)downloadStatus:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
if (d == nil)
|
||||
return @"NOT_REGISTERED";
|
||||
|
||||
return [d status];
|
||||
}
|
||||
|
||||
- (NSString *)downloadError:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
if (d == nil)
|
||||
return @"";
|
||||
|
||||
return [d error];
|
||||
}
|
||||
|
||||
- (BOOL)startDownload:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
return (d == nil) ? NO : [d start];
|
||||
}
|
||||
|
||||
- (BOOL)cancelDownload:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
return (d == nil) ? NO : [d cancel];
|
||||
}
|
||||
|
||||
- (int)bytesCompleted:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
return (d == nil) ? -1 : [d bytesCompleted];
|
||||
}
|
||||
|
||||
- (int)bytesTotal:(NSString *)key
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
return (d == nil) ? -1 : [d bytesTotal];
|
||||
}
|
||||
|
||||
- (BOOL)extractDownload:(NSString *)key toPath:(NSString *)aFile inMod:(NSString *)aMod
|
||||
{
|
||||
Download *d = [controller downloadWithKey:key];
|
||||
if (d == nil)
|
||||
{
|
||||
NSLog(@"Unknown download");
|
||||
return NO;
|
||||
}
|
||||
if (![[d status] isEqualToString:@"DOWNLOADED"])
|
||||
{
|
||||
NSLog(@"Invalid download status");
|
||||
return NO;
|
||||
}
|
||||
|
||||
id mod = [[controller allMods] objectForKey:aMod];
|
||||
if (mod == nil)
|
||||
{
|
||||
NSLog(@"Invalid or unknown mod: %@", aMod);
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Disallow traversing up the directory tree
|
||||
id path = [aMod stringByAppendingPathComponent:[aFile stringByReplacingOccurrencesOfString:@"../"
|
||||
withString:@""]];
|
||||
|
||||
[d extractToPath:path];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)log:(NSString *)message
|
||||
{
|
||||
NSLog(@"js: %@",message);
|
||||
}
|
||||
|
||||
- (BOOL)fileExists:(NSString *)aFile inMod:(NSString *)aMod
|
||||
{
|
||||
id mod = [[controller allMods] objectForKey:aMod];
|
||||
if (mod == nil)
|
||||
{
|
||||
NSLog(@"Invalid or unknown mod: %@", aMod);
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Disallow traversing up the directory tree
|
||||
id path = [[mod path] stringByAppendingPathComponent:[aFile stringByReplacingOccurrencesOfString:@"../"
|
||||
withString:@""]];
|
||||
|
||||
return [[NSFileManager defaultManager] fileExistsAtPath:path];
|
||||
}
|
||||
|
||||
- (NSString *)metadata:(NSString *)aField forMod:(NSString *)aMod
|
||||
{
|
||||
id mod = [[controller allMods] objectForKey:aMod];
|
||||
if (mod == nil)
|
||||
{
|
||||
NSLog(@"Invalid or unknown mod: %@", aMod);
|
||||
return @"";
|
||||
}
|
||||
|
||||
if ([aField isEqualToString:@"VERSION"])
|
||||
return [mod version];
|
||||
|
||||
NSLog(@"Invalid or unknown field: %@", aField);
|
||||
return @"";
|
||||
}
|
||||
|
||||
- (void)httpRequest:(NSString *)url withCallback:(NSString *)cb
|
||||
{
|
||||
[controller fetchURL:url withCallback:cb];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface Mod : NSObject {
|
||||
NSString *path;
|
||||
NSString *mod;
|
||||
NSString *title;
|
||||
NSString *version;
|
||||
NSString *author;
|
||||
NSString *requires;
|
||||
NSString *description;
|
||||
BOOL standalone;
|
||||
}
|
||||
|
||||
@property (readonly) NSString *mod;
|
||||
@property (readonly) NSString *title;
|
||||
@property (readonly) NSString *version;
|
||||
@property (readonly) NSString *author;
|
||||
@property (readonly) NSString *description;
|
||||
@property (readonly) NSString *requires;
|
||||
@property (readonly) NSString *path;
|
||||
@property (readonly) BOOL standalone;
|
||||
|
||||
+ (id)modWithId:(NSString *)mid fields:(id)fields path:(NSString *)path;
|
||||
- (id)initWithId:(NSString *)anId fields:(NSDictionary *)fields path:(NSString *)path;
|
||||
@end
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "Mod.h"
|
||||
|
||||
|
||||
@implementation Mod
|
||||
@synthesize mod;
|
||||
@synthesize title;
|
||||
@synthesize version;
|
||||
@synthesize author;
|
||||
@synthesize description;
|
||||
@synthesize requires;
|
||||
@synthesize standalone;
|
||||
@synthesize path;
|
||||
|
||||
+ (id)modWithId:(NSString *)mod fields:(id)fields path:(NSString *)aPath
|
||||
{
|
||||
id newObject = [[self alloc] initWithId:mod fields:fields path:aPath];
|
||||
[newObject autorelease];
|
||||
return newObject;
|
||||
}
|
||||
|
||||
- (id)initWithId:(NSString *)anId fields:(NSDictionary *)fields path:(NSString *)aPath
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
mod = [anId retain];
|
||||
path = [aPath retain];
|
||||
title = [[fields objectForKey:@"Title"] retain];
|
||||
version = [[fields objectForKey:@"Version"] retain];
|
||||
author = [[fields objectForKey:@"Author"] retain];
|
||||
description = [[fields objectForKey:@"Description"] retain];
|
||||
requires = [[fields objectForKey:@"Requires"] retain];
|
||||
standalone = ([[fields objectForKey:@"Standalone"] isEqualToString:@"True"]);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[mod release]; mod = nil;
|
||||
[path release]; path = nil;
|
||||
[title release]; title = nil;
|
||||
[version release]; version = nil;
|
||||
[author release]; author = nil;
|
||||
[description release]; description = nil;
|
||||
[requires release]; requires = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,9 +9,9 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>OpenRA.icns</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.open-ra.launcher</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
|
||||
@@ -11,16 +11,9 @@
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
DA38212212925344003B0BB5 /* JSBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = DA38212112925344003B0BB5 /* JSBridge.m */; };
|
||||
DA7D85671295E92900E58547 /* Download.m in Sources */ = {isa = PBXBuildFile; fileRef = DA7D85661295E92900E58547 /* Download.m */; };
|
||||
DA81FA821290F5C800C48F2F /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FA811290F5C800C48F2F /* Controller.m */; };
|
||||
DA81FAAA1290FA0000C48F2F /* Mod.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FAA91290FA0000C48F2F /* Mod.m */; };
|
||||
DA81FB9312910A8B00C48F2F /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */; };
|
||||
DA81FBDC12910E4900C48F2F /* OpenRA.icns in Resources */ = {isa = PBXBuildFile; fileRef = DA81FBDB12910E4900C48F2F /* OpenRA.icns */; };
|
||||
DA81FC3F12911E2B00C48F2F /* GameInstall.m in Sources */ = {isa = PBXBuildFile; fileRef = DA81FC3E12911E2B00C48F2F /* GameInstall.m */; };
|
||||
DA9295A712921DF900EDB02E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA9295A612921DF900EDB02E /* WebKit.framework */; };
|
||||
DA9296901292328200EDB02E /* SidebarEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = DA92968F1292328200EDB02E /* SidebarEntry.m */; };
|
||||
DAA3F31C12CBF60D00E214BF /* HttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA3F31B12CBF60D00E214BF /* HttpRequest.m */; };
|
||||
DAB887F5129E5D6C00C99407 /* SDL in Resources */ = {isa = PBXBuildFile; fileRef = DAB887EE129E5D6100C99407 /* SDL */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -34,24 +27,10 @@
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
8D1107310486CEB800E47090 /* OpenRA-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "OpenRA-Info.plist"; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* OpenRA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRA.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DA38212012925344003B0BB5 /* JSBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBridge.h; sourceTree = "<group>"; };
|
||||
DA38212112925344003B0BB5 /* JSBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSBridge.m; sourceTree = "<group>"; };
|
||||
DA7D85651295E92900E58547 /* Download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Download.h; sourceTree = "<group>"; };
|
||||
DA7D85661295E92900E58547 /* Download.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Download.m; sourceTree = "<group>"; };
|
||||
DA81FA801290F5C800C48F2F /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = "<group>"; };
|
||||
DA81FA811290F5C800C48F2F /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = "<group>"; };
|
||||
DA81FAA81290FA0000C48F2F /* Mod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mod.h; sourceTree = "<group>"; };
|
||||
DA81FAA91290FA0000C48F2F /* Mod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Mod.m; sourceTree = "<group>"; };
|
||||
DA81FB9112910A8B00C48F2F /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; };
|
||||
DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; };
|
||||
DA81FBDB12910E4900C48F2F /* OpenRA.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OpenRA.icns; sourceTree = "<group>"; };
|
||||
DA81FC3D12911E2B00C48F2F /* GameInstall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameInstall.h; sourceTree = "<group>"; };
|
||||
DA81FC3E12911E2B00C48F2F /* GameInstall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameInstall.m; sourceTree = "<group>"; };
|
||||
DA9295A612921DF900EDB02E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
DA92968E1292328200EDB02E /* SidebarEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SidebarEntry.h; sourceTree = "<group>"; };
|
||||
DA92968F1292328200EDB02E /* SidebarEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SidebarEntry.m; sourceTree = "<group>"; };
|
||||
DAA3F31A12CBF60D00E214BF /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = "<group>"; };
|
||||
DAA3F31B12CBF60D00E214BF /* HttpRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequest.m; sourceTree = "<group>"; };
|
||||
DAB887EE129E5D6100C99407 /* SDL */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = SDL; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@@ -71,22 +50,8 @@
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DA81FB9112910A8B00C48F2F /* ImageAndTextCell.h */,
|
||||
DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */,
|
||||
DA81FA801290F5C800C48F2F /* Controller.h */,
|
||||
DA81FA811290F5C800C48F2F /* Controller.m */,
|
||||
DA81FAA81290FA0000C48F2F /* Mod.h */,
|
||||
DA81FAA91290FA0000C48F2F /* Mod.m */,
|
||||
DA81FC3D12911E2B00C48F2F /* GameInstall.h */,
|
||||
DA81FC3E12911E2B00C48F2F /* GameInstall.m */,
|
||||
DA7D85651295E92900E58547 /* Download.h */,
|
||||
DA7D85661295E92900E58547 /* Download.m */,
|
||||
DA92968E1292328200EDB02E /* SidebarEntry.h */,
|
||||
DA92968F1292328200EDB02E /* SidebarEntry.m */,
|
||||
DA38212112925344003B0BB5 /* JSBridge.m */,
|
||||
DA38212012925344003B0BB5 /* JSBridge.h */,
|
||||
DAA3F31A12CBF60D00E214BF /* HttpRequest.h */,
|
||||
DAA3F31B12CBF60D00E214BF /* HttpRequest.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
@@ -228,13 +193,6 @@
|
||||
files = (
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */,
|
||||
DA81FA821290F5C800C48F2F /* Controller.m in Sources */,
|
||||
DA81FAAA1290FA0000C48F2F /* Mod.m in Sources */,
|
||||
DA81FB9312910A8B00C48F2F /* ImageAndTextCell.m in Sources */,
|
||||
DA81FC3F12911E2B00C48F2F /* GameInstall.m in Sources */,
|
||||
DA9296901292328200EDB02E /* SidebarEntry.m in Sources */,
|
||||
DA38212212925344003B0BB5 /* JSBridge.m in Sources */,
|
||||
DA7D85671295E92900E58547 /* Download.m in Sources */,
|
||||
DAA3F31C12CBF60D00E214BF /* HttpRequest.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class Mod;
|
||||
@interface SidebarEntry : NSObject
|
||||
{
|
||||
BOOL isHeader;
|
||||
NSString *title;
|
||||
NSImage *icon;
|
||||
NSURL *url;
|
||||
NSMutableArray *children;
|
||||
}
|
||||
|
||||
@property (readonly) BOOL isHeader;
|
||||
@property (readonly) NSString *title;
|
||||
@property (readonly) NSMutableArray* children;
|
||||
@property (readonly) NSImage* icon;
|
||||
|
||||
+ (id)headerWithTitle:(NSString *)aTitle;
|
||||
+ (id)entryWithTitle:(NSString *)aTitle url:(NSURL *)aURL icon:(id)anIcon;
|
||||
+ (id)entryWithMod:(Mod *)baseMod allMods:(NSDictionary *)allMods basePath:(NSString *)aPath;
|
||||
- (id)initWithTitle:(NSString *)aTitle url:(NSURL *)aURL icon:(id)anIcon isHeader:(BOOL)aHeader;
|
||||
- (void)addChild:(id)child;
|
||||
- (NSURL *)url;
|
||||
@end
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
|
||||
#import "SidebarEntry.h"
|
||||
#import "Mod.h"
|
||||
|
||||
@implementation SidebarEntry
|
||||
@synthesize isHeader;
|
||||
@synthesize title;
|
||||
@synthesize children;
|
||||
@synthesize icon;
|
||||
|
||||
+ (id)headerWithTitle:(NSString *)aTitle;
|
||||
{
|
||||
id newObject = [[self alloc] initWithTitle:aTitle url:nil icon:nil isHeader:YES];
|
||||
[newObject autorelease];
|
||||
return newObject;
|
||||
}
|
||||
|
||||
+ (id)entryWithTitle:(NSString *)aTitle url:(NSURL *)aURL icon:(id)anIcon
|
||||
{
|
||||
id newObject = [[self alloc] initWithTitle:aTitle url:aURL icon:anIcon isHeader:NO];
|
||||
[newObject autorelease];
|
||||
return newObject;
|
||||
}
|
||||
|
||||
+ (id)entryWithMod:(Mod *)baseMod allMods:(NSDictionary *)allMods basePath:(NSString *)basePath
|
||||
{
|
||||
// TODO: Get the mod icon from the Mod
|
||||
// Temporary hack until mods define an icon
|
||||
NSString *imageName = [[NSBundle mainBundle] pathForResource:@"OpenRA" ofType:@"icns"];
|
||||
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:imageName] autorelease];
|
||||
NSURL *url = [NSURL URLWithString:[[[baseMod path] stringByAppendingPathComponent:@"mod.html"] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
|
||||
SidebarEntry *ret = [SidebarEntry entryWithTitle:[baseMod title] url:url icon:icon];
|
||||
|
||||
for (id key in allMods)
|
||||
{
|
||||
id aMod = [allMods objectForKey:key];
|
||||
if (![[aMod requires] isEqualToString:[baseMod mod]])
|
||||
continue;
|
||||
|
||||
id child = [SidebarEntry entryWithMod:aMod allMods:allMods basePath:basePath];
|
||||
[ret addChild:child];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (id)initWithTitle:(NSString *)aTitle url:(NSURL *)aURL icon:(id)anIcon isHeader:(BOOL)isaHeader
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
isHeader = isaHeader;
|
||||
title = [aTitle retain];
|
||||
url = [aURL retain];
|
||||
icon = [anIcon retain];
|
||||
children = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)addChild:(Mod *)child
|
||||
{
|
||||
[children addObject:child];
|
||||
}
|
||||
|
||||
- (NSURL *)url
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[title release]; title = nil;
|
||||
[url release]; url = nil;
|
||||
[icon release]; icon = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -45,6 +45,11 @@ int main(int argc, char *argv[])
|
||||
setenv("DYLD_LIBRARY_PATH", buf, 1);
|
||||
}
|
||||
|
||||
// Hide the menubar if we are running fullscreen
|
||||
// TODO: HACK: Parse the settings.yaml / commandline args for fullscreen options
|
||||
if (YES)
|
||||
[NSMenu setMenuBarVisible:NO];
|
||||
|
||||
/* Exec mono */
|
||||
execve(args[0], args, environ);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user