mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move apple_display_alert implementation to UI driver
This commit is contained in:
parent
a3e4eff02a
commit
09fe3e9176
@ -18,29 +18,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include "cocoa_common.h"
|
||||
|
||||
void apple_display_alert(const char *message, const char *title)
|
||||
{
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:BOXSTRING(title)
|
||||
message:BOXSTRING(message)
|
||||
delegate:nil
|
||||
cancelButtonTitle:BOXSTRING("OK")
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
#else
|
||||
NSAlert* alert = [[NSAlert new] autorelease];
|
||||
|
||||
[alert setMessageText:(*title) ? BOXSTRING(title) : BOXSTRING("RetroArch")];
|
||||
[alert setInformativeText:BOXSTRING(message)];
|
||||
[alert setAlertStyle:NSInformationalAlertStyle];
|
||||
[alert beginSheetModalForWindow:[RetroArch_OSX get].window
|
||||
modalDelegate:apple_platform
|
||||
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
||||
contextInfo:nil];
|
||||
[[NSApplication sharedApplication] runModalForWindow:[alert window]];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Number formatter class for setting strings
|
||||
@implementation RANumberFormatter
|
||||
- (id)initWithSetting:(const rarch_setting_t*)setting
|
||||
|
@ -411,6 +411,20 @@ int main(int argc, char *argv[])
|
||||
return NSApplicationMain(argc, (const char **) argv);
|
||||
}
|
||||
|
||||
void apple_display_alert(const char *message, const char *title)
|
||||
{
|
||||
NSAlert* alert = [[NSAlert new] autorelease];
|
||||
|
||||
[alert setMessageText:(*title) ? BOXSTRING(title) : BOXSTRING("RetroArch")];
|
||||
[alert setInformativeText:BOXSTRING(message)];
|
||||
[alert setAlertStyle:NSInformationalAlertStyle];
|
||||
[alert beginSheetModalForWindow:[RetroArch_OSX get].window
|
||||
modalDelegate:apple_platform
|
||||
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
||||
contextInfo:nil];
|
||||
[[NSApplication sharedApplication] runModalForWindow:[alert window]];
|
||||
}
|
||||
|
||||
typedef struct ui_companion_cocoa
|
||||
{
|
||||
void *empty;
|
||||
|
@ -461,6 +461,16 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
void apple_display_alert(const char *message, const char *title)
|
||||
{
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:BOXSTRING(title)
|
||||
message:BOXSTRING(message)
|
||||
delegate:nil
|
||||
cancelButtonTitle:BOXSTRING("OK")
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
}
|
||||
|
||||
typedef struct ui_companion_cocoatouch
|
||||
{
|
||||
void *empty;
|
||||
|
Loading…
x
Reference in New Issue
Block a user