mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
(iOS) Tapping a firmware item in RAModuleInfo will display an alert view with the full path
This commit is contained in:
parent
7e91949be2
commit
841e8d1bb5
@ -165,14 +165,25 @@ static NSString* get_data_string(config_file_t* config, const char* name, NSStri
|
||||
return ([_sections[section] count] - 1) / 2;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section == _firmwareSectionIndex)
|
||||
[RetroArch_iOS displayErrorMessage:_sections[indexPath.section][indexPath.row * 2 + 2] withTitle:_sections[indexPath.section][indexPath.row * 2 + 1]];
|
||||
}
|
||||
|
||||
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell* cell = [self.tableView dequeueReusableCellWithIdentifier:@"datacell"];
|
||||
cell = (cell != nil) ? cell : [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"datacell"];
|
||||
|
||||
if (!cell)
|
||||
{
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"datacell"];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
|
||||
}
|
||||
|
||||
cell.textLabel.text = _sections[indexPath.section][indexPath.row * 2 + 1];
|
||||
cell.detailTextLabel.text = _sections[indexPath.section][indexPath.row * 2 + 2];
|
||||
cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
|
||||
|
||||
if (indexPath.section == _firmwareSectionIndex)
|
||||
cell.backgroundColor = ra_ios_is_file(_sections[indexPath.section][indexPath.row * 2 + 2]) ? [UIColor blueColor] : [UIColor redColor];
|
||||
|
@ -18,6 +18,7 @@
|
||||
@interface RetroArch_iOS : UINavigationController<UIApplicationDelegate, UINavigationControllerDelegate>
|
||||
|
||||
+ (void)displayErrorMessage:(NSString*)message;
|
||||
+ (void)displayErrorMessage:(NSString*)message withTitle:(NSString*)title;
|
||||
|
||||
+ (RetroArch_iOS*)get;
|
||||
|
||||
|
@ -87,9 +87,10 @@
|
||||
- (void)infoButtonTapped:(id)sender
|
||||
{
|
||||
RAModuleInfo* info = objc_getAssociatedObject(sender, "MODULE");
|
||||
|
||||
if (info)
|
||||
if (info && info.data)
|
||||
[RetroArch_iOS.get pushViewController:[[RAModuleInfoList alloc] initWithModuleInfo:info] animated:YES];
|
||||
else
|
||||
[RetroArch_iOS displayErrorMessage:@"No information available."];
|
||||
}
|
||||
|
||||
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
@ -223,7 +223,12 @@ static void event_reload_config(void* userdata)
|
||||
|
||||
+ (void)displayErrorMessage:(NSString*)message
|
||||
{
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"RetroArch"
|
||||
[RetroArch_iOS displayErrorMessage:message withTitle:@"RetroArch"];
|
||||
}
|
||||
|
||||
+ (void)displayErrorMessage:(NSString*)message withTitle:(NSString*)title
|
||||
{
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:title
|
||||
message:message
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
|
Loading…
x
Reference in New Issue
Block a user