summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-03 01:32:30 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-03 01:32:30 +0000
commit4273fdfc90a1e1eedb1a425925a589b8e231ed64 (patch)
treef3796c10d60f22e7f141cb36f30b24fcf7de999b
parente46e672bf9d13a5aefeed9520cc68fec1bff583e (diff)
downloadpcsxr-4273fdfc90a1e1eedb1a425925a589b8e231ed64.tar.gz
Link Enable NetPlay button to the proper action.
Open dialogs now have a set file types that they can open (Set by UTIs, with a new imported UTI for disc images). Retaining openDlg, then releasing when done, as per the suggestion of Apple's documentation. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72823 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/ConfigurationController.m6
-rw-r--r--macosx/English.lproj/Configuration.xib95
-rw-r--r--macosx/Info.plist25
-rw-r--r--macosx/PcsxrController.m10
4 files changed, 78 insertions, 58 deletions
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m
index 288f56e3..0faccc89 100644
--- a/macosx/ConfigurationController.m
+++ b/macosx/ConfigurationController.m
@@ -40,6 +40,7 @@
char *mcd;
NSTextField *label;
NSOpenPanel *openDlg = [NSOpenPanel openPanel];
+ [openDlg retain];
NSString *path;
if (tag == 1) { mcd = Config.Mcd1; label = mcd1Label; }
@@ -47,6 +48,7 @@
[openDlg setCanChooseFiles:YES];
[openDlg setCanChooseDirectories:NO];
+ [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.memcard"]];
path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:mcd length:strlen(mcd)];
@@ -65,6 +67,7 @@
else
[[NSUserDefaults standardUserDefaults] setObject:mcdPath forKey:@"Mcd2"];
}
+ [openDlg release];
}
- (IBAction)mcdNewClicked:(id)sender
@@ -73,6 +76,7 @@
char *mcd;
NSTextField *label;
NSSavePanel *openDlg = [NSSavePanel savePanel];
+ [openDlg retain];
NSString *path;
if (tag == 1) { mcd = Config.Mcd1; label = mcd1Label; }
@@ -82,6 +86,7 @@
[openDlg setDirectoryURL:[NSURL fileURLWithPath:[path stringByDeletingLastPathComponent]]];
[openDlg setNameFieldStringValue:@"New Memory Card File.mcr"];
+ [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.memcard"]];
if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
NSString *mcdPath = [[openDlg URL] path];
@@ -96,6 +101,7 @@
CreateMcd(mcd);
}
+ [openDlg release];
}
- (IBAction)setVideoType:(id)sender
diff --git a/macosx/English.lproj/Configuration.xib b/macosx/English.lproj/Configuration.xib
index 5274a275..5e87405a 100644
--- a/macosx/English.lproj/Configuration.xib
+++ b/macosx/English.lproj/Configuration.xib
@@ -562,7 +562,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{18, 16}, {232, 40}}</string>
<reference key="NSSuperview" ref="584348218"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="145760790"/>
+ <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<int key="NSNumRows">2</int>
<int key="NSNumCols">1</int>
@@ -1947,20 +1947,28 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="connectionID">621</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">enableNetPlayCell</string>
+ <object class="IBActionConnection" key="connection">
+ <string key="label">mcdEditClicked:</string>
<reference key="source" ref="974938689"/>
- <reference key="destination" ref="322742106"/>
+ <reference key="destination" ref="753962594"/>
</object>
- <int key="connectionID">641</int>
+ <int key="connectionID">644</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">mcdEditClicked:</string>
+ <string key="label">setCheckbox:</string>
<reference key="source" ref="974938689"/>
- <reference key="destination" ref="753962594"/>
+ <reference key="destination" ref="322742106"/>
</object>
- <int key="connectionID">644</int>
+ <int key="connectionID">650</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enableNetPlayCell</string>
+ <reference key="source" ref="974938689"/>
+ <reference key="destination" ref="322742106"/>
+ </object>
+ <int key="connectionID">651</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
@@ -3134,7 +3142,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">644</int>
+ <int key="maxID">651</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3291,68 +3299,43 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<object class="IBPartialClassDescription">
<string key="className">PluginController</string>
- <string key="superclassName">NSWindowController</string>
+ <string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
- <string key="cancel:">id</string>
- <string key="ok:">id</string>
- <string key="reset:">id</string>
+ <string key="doAbout:">id</string>
+ <string key="doConfigure:">id</string>
+ <string key="selectPlugin:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
- <object class="IBActionInfo" key="cancel:">
- <string key="name">cancel:</string>
+ <object class="IBActionInfo" key="doAbout:">
+ <string key="name">doAbout:</string>
<string key="candidateClassName">id</string>
</object>
- <object class="IBActionInfo" key="ok:">
- <string key="name">ok:</string>
+ <object class="IBActionInfo" key="doConfigure:">
+ <string key="name">doConfigure:</string>
<string key="candidateClassName">id</string>
</object>
- <object class="IBActionInfo" key="reset:">
- <string key="name">reset:</string>
+ <object class="IBActionInfo" key="selectPlugin:">
+ <string key="name">selectPlugin:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
- <string key="hiCompBox">NSControl</string>
- <string key="interpolValue">NetSfPeopsSPUPluginNamedSlider</string>
- <string key="irqWaitBox">NSControl</string>
- <string key="monoSoundBox">NSControl</string>
- <string key="reverbValue">NetSfPeopsSPUPluginNamedSlider</string>
- <string key="volumeValue">NetSfPeopsSPUPluginNamedSlider</string>
- <string key="xaEnableBox">NSControl</string>
- <string key="xaSpeedBox">NSControl</string>
+ <string key="aboutButton">NSButton</string>
+ <string key="configureButton">NSButton</string>
+ <string key="pluginMenu">NSPopUpButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="hiCompBox">
- <string key="name">hiCompBox</string>
- <string key="candidateClassName">NSControl</string>
- </object>
- <object class="IBToOneOutletInfo" key="interpolValue">
- <string key="name">interpolValue</string>
- <string key="candidateClassName">NetSfPeopsSPUPluginNamedSlider</string>
- </object>
- <object class="IBToOneOutletInfo" key="irqWaitBox">
- <string key="name">irqWaitBox</string>
- <string key="candidateClassName">NSControl</string>
- </object>
- <object class="IBToOneOutletInfo" key="monoSoundBox">
- <string key="name">monoSoundBox</string>
- <string key="candidateClassName">NSControl</string>
- </object>
- <object class="IBToOneOutletInfo" key="reverbValue">
- <string key="name">reverbValue</string>
- <string key="candidateClassName">NetSfPeopsSPUPluginNamedSlider</string>
- </object>
- <object class="IBToOneOutletInfo" key="volumeValue">
- <string key="name">volumeValue</string>
- <string key="candidateClassName">NetSfPeopsSPUPluginNamedSlider</string>
+ <object class="IBToOneOutletInfo" key="aboutButton">
+ <string key="name">aboutButton</string>
+ <string key="candidateClassName">NSButton</string>
</object>
- <object class="IBToOneOutletInfo" key="xaEnableBox">
- <string key="name">xaEnableBox</string>
- <string key="candidateClassName">NSControl</string>
+ <object class="IBToOneOutletInfo" key="configureButton">
+ <string key="name">configureButton</string>
+ <string key="candidateClassName">NSButton</string>
</object>
- <object class="IBToOneOutletInfo" key="xaSpeedBox">
- <string key="name">xaSpeedBox</string>
- <string key="candidateClassName">NSControl</string>
+ <object class="IBToOneOutletInfo" key="pluginMenu">
+ <string key="name">pluginMenu</string>
+ <string key="candidateClassName">NSPopUpButton</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
diff --git a/macosx/Info.plist b/macosx/Info.plist
index 9f67d665..e960fad4 100644
--- a/macosx/Info.plist
+++ b/macosx/Info.plist
@@ -215,5 +215,30 @@
</dict>
</dict>
</array>
+ <key>UTImportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.disk-image</string>
+ <string>public.content</string>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>PlayStation Disc</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.codeplex.pcsxr.psxdiscfile</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>bin</string>
+ <string>img</string>
+ <string>mdf</string>
+ <string>iso</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
</dict>
</plist>
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m
index 822130bf..2cf95ec3 100644
--- a/macosx/PcsxrController.m
+++ b/macosx/PcsxrController.m
@@ -29,15 +29,18 @@ NSString *saveStatePath;
// switch to another ISO if using internal image reader, otherwise eject the CD
if (UsingIso()) {
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
+ [openDlg retain];
[openDlg setCanChooseFiles:YES];
[openDlg setCanChooseDirectories:NO];
+ [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.psxdiscfile"]];
if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
- NSArray* files = [openDlg filenames];
+ NSArray* files = [openDlg URLs];
SetCdOpenCaseTime(time(NULL) + 2);
- SetIsoFile((const char *)[[files objectAtIndex:0] fileSystemRepresentation]);
+ SetIsoFile((const char *)[[[files objectAtIndex:0] path] fileSystemRepresentation]);
}
+ [openDlg release];
} else {
char *driveLetter = CDR_getDriveLetter();
@@ -106,15 +109,18 @@ NSString *saveStatePath;
- (IBAction)runIso:(id)sender
{
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
+ [openDlg retain];
[openDlg setCanChooseFiles:YES];
[openDlg setCanChooseDirectories:NO];
+ [openDlg setAllowedFileTypes:[NSArray arrayWithObject:@"com.codeplex.pcsxr.psxdiscfile"]];
if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
NSArray* urls = [openDlg URLs];
SetIsoFile((const char *)[[[urls objectAtIndex:0] path] fileSystemRepresentation]);
[EmuThread run];
}
+ [openDlg release];
}
- (IBAction)runBios:(id)sender