(OSX) Fix IBAction openCores

This commit is contained in:
Twinaphex 2015-07-18 19:24:14 +02:00
parent 0961446b19
commit 8bf42618d9

View File

@ -268,8 +268,7 @@ static void poll_iteration(void)
} }
} }
- (IBAction)openCore:(id)sender - (IBAction)openCore:(id)sender {
{
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
#if defined(MAC_OS_X_VERSION_10_6) #if defined(MAC_OS_X_VERSION_10_6)
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
@ -278,15 +277,22 @@ static void poll_iteration(void)
if (result == NSOKButton && panel.URL) if (result == NSOKButton && panel.URL)
{ {
menu_handle_t *menu = menu_driver_get_ptr();
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
NSURL *url = (NSURL*)panel.URL; NSURL *url = (NSURL*)panel.URL;
NSString *__core = url.path; NSString *__core = url.path;
const char *core_name = settings->libretro_directory;
if (core_name) if (__core)
{ {
strlcpy(settings->libretro_directory, __core.UTF8String, sizeof(settings->libretro_directory)); strlcpy(settings->libretro, __core.UTF8String, sizeof(settings->libretro));
ui_companion_event_command(EVENT_CMD_LOAD_CORE); ui_companion_event_command(EVENT_CMD_LOAD_CORE);
if (menu->load_no_content && settings->core.set_supports_no_game_enable)
{
*global->fullpath = '\0';
menu_common_load_content(false, CORE_TYPE_PLAIN);
}
} }
else else
[self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f]; [self performSelector:@selector(chooseCore) withObject:nil afterDelay:.5f];