|
|
1.1 root 1: /*
2: Hatari - AlertHooks.c
3:
1.1.1.3 ! root 4: This file is distributed under the GNU General Public License, version 2
! 5: or at your option any later version. Read the file gpl.txt for details.
1.1 root 6:
7: Hooked alerts, to be used instead of SDL alert windows
8:
9: June 2006, Sébastien Molines - Created
10: */
11:
12: #import <Cocoa/Cocoa.h>
13: #import "AlertHooks.h"
14:
15: #ifdef ALERT_HOOKS
16:
17: /*-----------------------------------------------------------------------*/
18: /*
19: Displays a Cocoa alert
20: */
21: int HookedAlertNotice(const char* szMessage)
22: {
1.1.1.2 root 23: return (NSAlertDefaultReturn == NSRunInformationalAlertPanel(@"Hatari", [NSString stringWithCString:szMessage encoding:NSASCIIStringEncoding], nil, nil, nil));
1.1 root 24: }
25:
26: /*-----------------------------------------------------------------------*/
27: /*
28: Displays a Cocoa alert with a choice (OK and Cancel buttons)
29: */
30: int HookedAlertQuery(const char* szMessage)
31: {
1.1.1.2 root 32: return (NSAlertDefaultReturn == NSRunAlertPanel(@"Hatari", [NSString stringWithCString:szMessage encoding:NSASCIIStringEncoding],
33: NSLocalizedStringFromTable(@"Ok",@"Localizable",@"comment"),
34: NSLocalizedStringFromTable(@"Cancel",@"Localizable",@"comment"), nil));
1.1 root 35: }
36:
37: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.