diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-17 19:08:51 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-17 19:08:51 +0000 |
| commit | b6f15852f36e8d017a275bc3727c5dcab1846d29 (patch) | |
| tree | d4913175221b0ea3baca8f0b9bc62e86f481f1aa /macosx/ConfigurationController.m | |
| parent | b205e6323f8b10c9dcbfb9fd21e7cb896b3805ef (diff) | |
| download | pcsxr-b6f15852f36e8d017a275bc3727c5dcab1846d29.tar.gz | |
Reduce code duplication in -[PcsxrController application:openFile:].
Added a new function to the PcsxrFileHandle protocol that says what types of UTIs it supports. Currently only used when selecting discs or memory cards from an open dialog, and not used in checking if an app can open a file.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@73437 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/ConfigurationController.m')
| -rw-r--r-- | macosx/ConfigurationController.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m index 4460e396..71601855 100644 --- a/macosx/ConfigurationController.m +++ b/macosx/ConfigurationController.m @@ -3,6 +3,7 @@ #import "PluginList.h" #import "PcsxrPlugin.h" #import "PcsxrMemCardController.h" +#import "PcsxrMemCardHandler.h" #include "psxcommon.h" #include "plugins.h" @@ -63,7 +64,7 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier"; [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:NO]; - [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.memcard"]]; + [openDlg setAllowedFileTypes:[PcsxrMemCardHandler utisCanHandle]]; path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:mcd length:strlen(mcd)]; @@ -95,7 +96,7 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier"; [openDlg setDirectoryURL:[NSURL fileURLWithPath:[path stringByDeletingLastPathComponent]]]; [openDlg setNameFieldStringValue:@"New Memory Card File.mcr"]; - [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.memcard"]]; + [openDlg setAllowedFileTypes:[PcsxrMemCardHandler utisCanHandle]]; if ([openDlg runModal] == NSFileHandlingPanelOKButton) { NSString *mcdPath = [[openDlg URL] path]; @@ -244,7 +245,7 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier"; memCardEdit = [[PcsxrMemCardController alloc] init]; } [[memCardEdit window] center]; - [memCardEdit showWindow:nil]; + [memCardEdit showWindow:sender]; } - (BOOL)memoryCardWindowIsVisible |
