mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 18:20:27 +00:00
Start implementing untested ui_browser_window_cocoa_open function
This commit is contained in:
parent
d9e61e5153
commit
9e5ad14da0
@ -25,6 +25,25 @@
|
||||
|
||||
static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state)
|
||||
{
|
||||
NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel];
|
||||
NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING("dylib"), BOXSTRING("Core"), nil];
|
||||
[panel setAllowedFileTypes:filetypes];
|
||||
#if defined(MAC_OS_X_VERSION_10_6)
|
||||
[panel setMessage:BOXSTRING(state->title)];
|
||||
if ([panel runModalForDirectory:BOXSTRING(state->path) file:nil] == 1)
|
||||
return true;
|
||||
#else
|
||||
[panel setTitle:NSLocalizedString(BOXSTRING(string->title), BOXSTRING("open panel"))];
|
||||
[panel setDirectory:BOXSTRING(state->startdir)];
|
||||
[panel setCanChooseDirectories:NO];
|
||||
[panel setCanChooseFiles:YES];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
[panel setTreatsFilePackagesAsDirectories:NO];
|
||||
NSInteger result = [panel runModal];
|
||||
if (result == 1)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,9 @@ typedef struct ui_msg_window_state
|
||||
|
||||
typedef struct ui_browser_window_state
|
||||
{
|
||||
void *window;
|
||||
char *filters;
|
||||
char *startdir;
|
||||
char *path;
|
||||
char *title;
|
||||
} ui_browser_window_state_t;
|
||||
|
Loading…
Reference in New Issue
Block a user