foxygit / doom Log in
commit 45f543dbe6800827907fd78649d30480a6d0bd31
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Jan 9 20:42:30 2010 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Jan 9 20:42:30 2010 +0000

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

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1794
---
 pkg/osx/LauncherManager.m                           |  12 +++++++++++-
 .../Contents/Resources/launcher.nib/info.nib        |   4 ++--
 .../Resources/launcher.nib/keyedobjects.nib         | Bin 17360 -> 17451 bytes
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/pkg/osx/LauncherManager.m b/pkg/osx/LauncherManager.m
index ff90b987..52ce7f82 100644
--- 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
diff --git a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
index aecf812a..21e3bb1d 100644
--- 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>
diff --git a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib
index 345ce976..680eaff7 100644
Binary files a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib and b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/keyedobjects.nib differ