summaryrefslogtreecommitdiff
path: root/macosx/ConfigurationController.m
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-09 20:49:54 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-09 20:49:54 +0000
commit4d55a8b8254dff61fdc7b1959f6aef7eafbd9439 (patch)
treefb5e56131a7c8b729641c70e7a87883ebaea5186 /macosx/ConfigurationController.m
parent71d6c56271e2650b1a2f5149521a5b1896084710 (diff)
downloadpcsxr-4d55a8b8254dff61fdc7b1959f6aef7eafbd9439.tar.gz
Patch 10767 (Durandal_1707).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72138 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/ConfigurationController.m')
-rw-r--r--macosx/ConfigurationController.m46
1 files changed, 27 insertions, 19 deletions
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m
index a1623cde..9c52375b 100644
--- a/macosx/ConfigurationController.m
+++ b/macosx/ConfigurationController.m
@@ -47,18 +47,22 @@
[openDlg setCanChooseFiles:YES];
[openDlg setCanChooseDirectories:NO];
- path = [NSString stringWithCString:mcd];
-
- if ([openDlg runModalForDirectory:[path stringByDeletingLastPathComponent] file:[path lastPathComponent]] == NSOKButton) {
- NSArray* files = [openDlg filenames];
- strcpy(mcd, (const char *)[[files objectAtIndex:0] fileSystemRepresentation]);
-
- [label setTitleWithMnemonic:[NSString stringWithCString:mcd]];
+ path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:mcd length:strlen(mcd)];
+
+ [openDlg setDirectoryURL:[NSURL fileURLWithPath:[path stringByDeletingLastPathComponent]]];
+ [openDlg setNameFieldStringValue:[path lastPathComponent]];
+
+ if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
+ NSArray* urls = [openDlg URLs];
+ NSString *mcdPath = [[urls objectAtIndex:0] path];
+ strcpy(mcd, (const char *)[mcdPath fileSystemRepresentation]);
+
+ [label setTitleWithMnemonic:mcdPath];
if (tag == 1)
- [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd1"];
+ [[NSUserDefaults standardUserDefaults] setObject:mcdPath forKey:@"Mcd1"];
else
- [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd2"];
+ [[NSUserDefaults standardUserDefaults] setObject:mcdPath forKey:@"Mcd2"];
}
}
@@ -73,17 +77,21 @@
if (tag == 1) { mcd = Config.Mcd1; label = mcd1Label; }
else { mcd = Config.Mcd2; label = mcd2Label; }
- path = [NSString stringWithCString:mcd];
+ path = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:mcd length:strlen(mcd)];
- if ([openDlg runModalForDirectory:[path stringByDeletingLastPathComponent] file:@"New Memory Card File.mcr"] == NSOKButton) {
- strcpy(mcd, (const char *)[[openDlg filename] fileSystemRepresentation]);
+ [openDlg setDirectoryURL:[NSURL fileURLWithPath:[path stringByDeletingLastPathComponent]]];
+ [openDlg setNameFieldStringValue:@"New Memory Card File.mcr"];
+
+ if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
+ NSString *mcdPath = [[openDlg URL] path];
+ strcpy(mcd, (const char *)[mcdPath fileSystemRepresentation]);
- [label setTitleWithMnemonic:[NSString stringWithCString:mcd]];
+ [label setTitleWithMnemonic:mcdPath];
if (tag == 1)
- [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd1"];
+ [[NSUserDefaults standardUserDefaults] setObject:mcdPath forKey:@"Mcd1"];
else
- [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd2"];
+ [[NSUserDefaults standardUserDefaults] setObject:mcdPath forKey:@"Mcd2"];
CreateMcd(mcd);
}
@@ -105,9 +113,9 @@
if ([sender pullsDown]) {
NSArray *items = [sender itemArray];
- int i;
+ NSUInteger i;
- for (i=0; i<[items count]; i++)
+ for (i = 0; i < [items count]; i++)
[[items objectAtIndex:i] setState:NSOffState];
[[sender selectedItem] setState:NSOnState];
@@ -155,8 +163,8 @@
}
// setup labels
- [mcd1Label setTitleWithMnemonic:[NSString stringWithCString:Config.Mcd1]];
- [mcd2Label setTitleWithMnemonic:[NSString stringWithCString:Config.Mcd2]];
+ [mcd1Label setTitleWithMnemonic:[[NSFileManager defaultManager] stringWithFileSystemRepresentation:Config.Mcd1 length:strlen(Config.Mcd1)]];
+ [mcd2Label setTitleWithMnemonic:[[NSFileManager defaultManager] stringWithFileSystemRepresentation:Config.Mcd2 length:strlen(Config.Mcd2)]];
int tag = [defaults integerForKey:@"AutoDetectVideoType"];
if (tag)