shithub: choc

Download patch

ref: 45f543dbe6800827907fd78649d30480a6d0bd31
parent: c2f2fa12a68626a3d2a25231d0aa1c6146d555c3
author: Simon Howard <[email protected]>
date: Sat Jan 9 15:42:30 EST 2010

Add file to command line when opened; add link from AppController to
LauncherManager.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1794

--- a/pkg/osx/LauncherManager.m
+++ b/pkg/osx/LauncherManager.m
@@ -64,7 +64,17 @@
 - (void) addFileToCommandLine: (NSString *) fileName
          forArgument: (NSString *) args
 {
-    // TODO
+    NSString *newCommandLine;
+printf("Add file: %s %s\n", [args UTF8String], [fileName UTF8String]);
+
+    newCommandLine = [self->commandLineArguments stringValue];
+    newCommandLine = [newCommandLine stringByAppendingString: @" "];
+    newCommandLine = [newCommandLine stringByAppendingString: args];
+    newCommandLine = [newCommandLine stringByAppendingString: @" \""];
+    newCommandLine = [newCommandLine stringByAppendingString: fileName];
+    newCommandLine = [newCommandLine stringByAppendingString: @"\""];
+
+    [self->commandLineArguments setStringValue: newCommandLine];
 }
 
 - (void) launch: (id)sender
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
+++ b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
@@ -13,9 +13,9 @@
 	<string>446.1</string>
 	<key>IBOpenObjects</key>
 	<array>
-		<integer>21</integer>
-		<integer>29</integer>
 		<integer>227</integer>
+		<integer>29</integer>
+		<integer>21</integer>
 	</array>
 	<key>IBSystem Version</key>
 	<string>8S2167</string>
binary files a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib differ