(iOS) Display a warning message when loading a game from a directory without both read and write permissions.

Add a warning at startup when no libretro cores are installed.
This commit is contained in:
meancoot 2013-06-12 19:47:24 -04:00
parent 2f0446917f
commit 85a329d7ec
2 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,7 @@
@implementation RADirectoryList
{
NSMutableArray* _list;
NSString* _path;
}
+ (id)directoryListAtBrowseRoot
@ -47,6 +48,8 @@
- (id)initWithPath:(NSString*)path
{
_path = path;
self = [super initWithStyle:UITableViewStylePlain];
[self setTitle: [path lastPathComponent]];
@ -93,7 +96,13 @@
if(path.isDirectory)
[[RetroArch_iOS get] pushViewController:[RADirectoryList directoryListForPath:path.path] animated:YES];
else
{
if (access(_path.UTF8String, R_OK | W_OK | X_OK))
[RetroArch_iOS displayErrorMessage:@"The directory containing the selected file has limited permissions. This may "
"prevent zipped games from loading, and will cause some cores to not function."];
[[RetroArch_iOS get] pushViewController:[[RAModuleList alloc] initWithGame:path.path] animated:YES];
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

View File

@ -279,6 +279,10 @@ static void event_reload_config(void* userdata)
[self pushViewController:[RADirectoryList directoryListAtBrowseRoot] animated:YES];
[self refreshSystemConfig];
}
// Warn if there are no cores present
if ([RAModuleInfo getModules].count == 0)
[RetroArch_iOS displayErrorMessage:@"No libretro cores were found. You will not be able to play any games."];
}
- (void)applicationWillEnterForeground:(UIApplication *)application