shithub: choc

Download patch

ref: d109ab268f7c7d140bf76d30b4526ef836e070fe
parent: 6fb7afc47cb78584d19ccb10284dd20243b06540
author: Simon Howard <[email protected]>
date: Sat Jan 9 13:38:48 EST 2010

Hook in AppController as delegate for application, add file associations
to property list file.

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

--- a/pkg/osx/AppController.m
+++ b/pkg/osx/AppController.m
@@ -76,6 +76,7 @@
 
 - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
 {
+    printf("File selected to open: '%s'\n", [fileName UTF8String]);
     return NO;
 }
 
--- a/pkg/osx/Info.plist.in
+++ b/pkg/osx/Info.plist.in
@@ -26,5 +26,35 @@
 	<string>NSApplication</string>
 	<key>NSMainNibFile</key>
 	<string>launcher</string>
+
+        <!-- file associations: -->
+
+        <key>CFBundleDocumentTypes</key>
+        <array>
+                <dict>
+                        <key>CFBundleTypeName</key>
+                        <string>Doom WAD file</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>app.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>wad</string>
+                        </array>
+                </dict>
+                <dict>
+                        <key>CFBundleTypeName</key>
+                        <string>Dehacked patch</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>app.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>deh</string>
+                        </array>
+                </dict>
+        </array>
 </dict>
 </plist>
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
+++ b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/classes.nib
@@ -1,5 +1,11 @@
 {
     IBClasses = (
+        {
+            CLASS = AppController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {launcherManager = id; }; 
+            SUPERCLASS = NSObject; 
+        }, 
         {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
         {
             ACTIONS = {closeConfigWindow = id; openConfigWindow = id; }; 
--- a/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
+++ b/pkg/osx/app-skeleton/Contents/Resources/launcher.nib/info.nib
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>IBDocumentLocation</key>
-	<string>172 70 612 260 0 0 1440 878 </string>
+	<string>170 140 612 260 0 0 1440 878 </string>
 	<key>IBEditorPositions</key>
 	<dict>
 		<key>29</key>
@@ -13,9 +13,9 @@
 	<string>446.1</string>
 	<key>IBOpenObjects</key>
 	<array>
+		<integer>21</integer>
 		<integer>29</integer>
 		<integer>227</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