2019-06-01 11:29:46 +00:00
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
#include "open_dialog.h"
|
|
|
|
|
|
|
|
|
|
|
|
char *do_open_rom_dialog(void)
|
|
|
|
{
|
|
|
|
@autoreleasepool {
|
|
|
|
NSWindow *key = [NSApp keyWindow];
|
|
|
|
NSOpenPanel *dialog = [NSOpenPanel openPanel];
|
|
|
|
dialog.title = @"Open ROM";
|
2020-04-25 19:48:48 +00:00
|
|
|
dialog.allowedFileTypes = @[@"gb", @"gbc", @"sgb", @"isx"];
|
2019-06-01 11:29:46 +00:00
|
|
|
[dialog runModal];
|
|
|
|
[key makeKeyAndOrderFront:nil];
|
|
|
|
NSString *ret = [[[dialog URLs] firstObject] path];
|
|
|
|
if (ret) {
|
|
|
|
return strdup(ret.UTF8String);
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|