diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-11-29 13:31:23 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-11-29 13:31:23 +0000 |
| commit | b11cc9582440fd162d058aefc942a6441eb80675 (patch) | |
| tree | dfb8e0e1e8ddb21f98de96ff47530bb8f7818b6c /macosx/ConfigurationController.m | |
| parent | b8e853cbdd5bc80653cdac1e599e0d4d87d709ab (diff) | |
| download | pcsxr-b11cc9582440fd162d058aefc942a6441eb80675.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38448 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/ConfigurationController.m')
| -rw-r--r-- | macosx/ConfigurationController.m | 69 |
1 files changed, 66 insertions, 3 deletions
diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m index e62465e2..be5bf69d 100644 --- a/macosx/ConfigurationController.m +++ b/macosx/ConfigurationController.m @@ -33,10 +33,69 @@ } } +- (IBAction)mcdChangeClicked:(id)sender +{ + int tag = [sender tag]; + char *mcd; + NSTextField *label; + NSOpenPanel *openDlg = [NSOpenPanel openPanel]; + NSString *path; + + if (tag == 1) { mcd = Config.Mcd1; label = mcd1Label; } + else { mcd = Config.Mcd2; label = mcd2Label; } + + [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]]; + + if (tag == 1) + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd1"]; + else + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd2"]; + + LoadMcds(Config.Mcd1, Config.Mcd2); + } +} + +- (IBAction)mcdNewClicked:(id)sender +{ + int tag = [sender tag]; + char *mcd; + NSTextField *label; + NSSavePanel *openDlg = [NSSavePanel savePanel]; + NSString *path; + + if (tag == 1) { mcd = Config.Mcd1; label = mcd1Label; } + else { mcd = Config.Mcd2; label = mcd2Label; } + + path = [NSString stringWithCString:mcd]; + + if ([openDlg runModalForDirectory:[path stringByDeletingLastPathComponent] file:@"New Memory Card File.mcr"] == NSOKButton) { + strcpy(mcd, (const char *)[[openDlg filename] fileSystemRepresentation]); + + [label setTitleWithMnemonic:[NSString stringWithCString:mcd]]; + + if (tag == 1) + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd1"]; + else + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithCString:mcd] forKey:@"Mcd2"]; + + CreateMcd(mcd); + LoadMcds(Config.Mcd1, Config.Mcd2); + } +} + - (IBAction)setVideoType:(id)sender { int tag = [[sender selectedItem] tag]; - + if (3 == tag) { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"AutoDetectVideoType"]; } else if (1 == tag || 2 == tag) { @@ -46,7 +105,7 @@ return; } [PcsxController setConfigFromDefaults]; - + if ([sender pullsDown]) { NSArray *items = [sender itemArray]; int i; @@ -98,6 +157,10 @@ [usesHleCell setEnabled:NO]; } + // setup labels + [mcd1Label setTitleWithMnemonic:[NSString stringWithCString:Config.Mcd1]]; + [mcd2Label setTitleWithMnemonic:[NSString stringWithCString:Config.Mcd2]]; + int tag = [defaults integerForKey:@"AutoDetectVideoType"]; if (tag) tag = 3; @@ -136,7 +199,7 @@ if ([object isEqual:sender]) return key; } - + return nil; } |
