mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move callback function up
This commit is contained in:
parent
43b949a9a0
commit
bd153870c2
@ -312,33 +312,6 @@ static void open_core_handler(NSOpenPanel *panel, NSInteger result)
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)openCore:(id)sender {
|
||||
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
|
||||
settings_t *settings = config_get_ptr();
|
||||
NSString *startdir = BOXSTRING(settings->libretro_directory);
|
||||
#if defined(MAC_OS_X_VERSION_10_6)
|
||||
[panel setMessage:BOXSTRING("Load Core")];
|
||||
[panel setDirectoryURL:[NSURL fileURLWithPath:startdir]];
|
||||
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
|
||||
{
|
||||
[[NSApplication sharedApplication] stopModal];
|
||||
open_core_handler(panel, result);
|
||||
}];
|
||||
[[NSApplication sharedApplication] runModalForWindow:panel];
|
||||
#else
|
||||
[panel setTitle:NSLocalizedString(BOXSTRING("Load Core"), BOXSTRING("open panel"))];
|
||||
[panel setDirectory:startdir];
|
||||
[panel setCanChooseDirectories:NO];
|
||||
[panel setCanChooseFiles:YES];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
[panel setTreatsFilePackagesAsDirectories:NO];
|
||||
NSInteger result = [panel runModalForTypes:[NSArray arrayWithObject:BOXSTRING("dylib")]];
|
||||
if (result == 1)
|
||||
open_core_handler(panel, result);
|
||||
#endif
|
||||
[g_context makeCurrentContext];
|
||||
}
|
||||
|
||||
static void open_document_handler(NSOpenPanel *panel, NSInteger result)
|
||||
{
|
||||
switch (result)
|
||||
@ -367,6 +340,33 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result)
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)openCore:(id)sender {
|
||||
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
|
||||
settings_t *settings = config_get_ptr();
|
||||
NSString *startdir = BOXSTRING(settings->libretro_directory);
|
||||
#if defined(MAC_OS_X_VERSION_10_6)
|
||||
[panel setMessage:BOXSTRING("Load Core")];
|
||||
[panel setDirectoryURL:[NSURL fileURLWithPath:startdir]];
|
||||
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
|
||||
{
|
||||
[[NSApplication sharedApplication] stopModal];
|
||||
open_core_handler(panel, result);
|
||||
}];
|
||||
[[NSApplication sharedApplication] runModalForWindow:panel];
|
||||
#else
|
||||
[panel setTitle:NSLocalizedString(BOXSTRING("Load Core"), BOXSTRING("open panel"))];
|
||||
[panel setDirectory:startdir];
|
||||
[panel setCanChooseDirectories:NO];
|
||||
[panel setCanChooseFiles:YES];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
[panel setTreatsFilePackagesAsDirectories:NO];
|
||||
NSInteger result = [panel runModalForTypes:[NSArray arrayWithObject:BOXSTRING("dylib")]];
|
||||
if (result == 1)
|
||||
open_core_handler(panel, result);
|
||||
#endif
|
||||
[g_context makeCurrentContext];
|
||||
}
|
||||
|
||||
- (void)openDocument:(id)sender
|
||||
{
|
||||
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
|
||||
|
Loading…
x
Reference in New Issue
Block a user