diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-21 23:19:04 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-21 23:19:04 +0000 |
| commit | de13f7dcbaa84255fa578aafe862f90c46225a01 (patch) | |
| tree | 0da83fa6b6e634d1f3e4a7af7e629d5473cfd76e /macosx/CheatController.m | |
| parent | e57165ae3f1706afec533d7b3cae17555a0f38ad (diff) | |
| download | pcsxr-de13f7dcbaa84255fa578aafe862f90c46225a01.tar.gz | |
Fix OS X 10.8-only behavior in the XGL plug-in.
Remove some commented-out code on Cocoa code.
Change some ints passed in Cocoa code to NSIntegers.
Replace a deprecated function call to NSRunAlertPanelRelativeToWindow.
Other minor fixes and improvements.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86808 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/CheatController.m')
| -rw-r--r-- | macosx/CheatController.m | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/macosx/CheatController.m b/macosx/CheatController.m index 2e5976f2..4b91319d 100644 --- a/macosx/CheatController.m +++ b/macosx/CheatController.m @@ -314,28 +314,37 @@ [self setDocumentEdited:NO]; } +- (void)sheetDidDismiss:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +{ + switch (returnCode) { + case NSAlertDefaultReturn: + [self reloadCheats]; + [self close]; + break; + + default: + [self refreshNSCheatArray]; + [self close]; + break; + + case NSAlertOtherReturn: + break; + } +} + - (BOOL)windowShouldClose:(id)sender { if (![sender isDocumentEdited] || ![[self window] isEqual:sender]) { return YES; } else { - //TODO: properly use a non-deprecated method here. - NSInteger retVal = NSRunAlertPanelRelativeToWindow(NSLocalizedString(@"Unsaved Changes", @"Unsaved changes"), NSLocalizedString(@"The Cheat codes have not been applied. Unapplied cheats will not run nor be saved. Do you wish to save?",nil), NSLocalizedString(@"Save", @"Save"), NSLocalizedString(@"Don't Save",@"Don't Save"), NSLocalizedString(@"Cancel", @"Cancel"), sender); - switch (retVal) { - case NSAlertDefaultReturn: - [self reloadCheats]; - return YES; - break; - - default: - [self refreshNSCheatArray]; - return YES; - break; - - case NSAlertOtherReturn: - return NO; - break; - } + NSBeginAlertSheet(NSLocalizedString(@"Unsaved Changes", @"Unsaved changes"), + NSLocalizedString(@"Save", @"Save"), + NSLocalizedString(@"Don't Save",@"Don't Save"), + NSLocalizedString(@"Cancel", @"Cancel"), [self window], self, + NULL, @selector(sheetDidDismiss:returnCode:contextInfo:), NULL, + NSLocalizedString(@"The cheat codes have not been applied. Unapplied cheats will not run nor be saved. Do you wish to save?",nil)); + + return NO; } } |
