diff options
author | Simon Howard | 2010-01-09 18:54:04 +0000 |
---|---|---|
committer | Simon Howard | 2010-01-09 18:54:04 +0000 |
commit | c2f2fa12a68626a3d2a25231d0aa1c6146d555c3 (patch) | |
tree | bac328480cebd7fd4747405c6a986ed8362f8393 /pkg/osx/AppController.m | |
parent | d109ab268f7c7d140bf76d30b4526ef836e070fe (diff) | |
download | chocolate-doom-c2f2fa12a68626a3d2a25231d0aa1c6146d555c3.tar.gz chocolate-doom-c2f2fa12a68626a3d2a25231d0aa1c6146d555c3.tar.bz2 chocolate-doom-c2f2fa12a68626a3d2a25231d0aa1c6146d555c3.zip |
Initial code to identify file type by extension and add file to command
line.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1793
Diffstat (limited to 'pkg/osx/AppController.m')
-rw-r--r-- | pkg/osx/AppController.m | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/pkg/osx/AppController.m b/pkg/osx/AppController.m index bf72af63..03a5965b 100644 --- a/pkg/osx/AppController.m +++ b/pkg/osx/AppController.m @@ -74,10 +74,29 @@ { } -- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName +- (BOOL) application:(NSApplication *) application + openFile:(NSString *) fileName { - printf("File selected to open: '%s'\n", [fileName UTF8String]); - return NO; + NSString *extension; + + extension = [fileName pathExtension]; + + if (![extension caseInsensitiveCompare: @"wad"]) + { + [self->launcherManager addFileToCommandLine: fileName + forArgument: @"-merge"]; + } + else if (![extension caseInsensitiveCompare: @"deh"]) + { + [self->launcherManager addFileToCommandLine: fileName + forArgument: @"-deh"]; + } + else + { + return NO; + } + + return YES; } - (void)showPrefPanel:(id)sender |