(iOS) Clean up and refactor apple/iOS/browser.m. All of the file management actions are accessed by long pressing a list entry rather than an accessory button.

This commit is contained in:
meancoot 2013-09-24 19:34:59 -04:00
parent 80f8b3b480
commit 8272d1cd68
3 changed files with 217 additions and 179 deletions

View File

@ -90,6 +90,18 @@ char* ios_get_rarch_system_directory()
return self; return self;
} }
- (bool)getCellFor:(NSString*)reuseID withStyle:(UITableViewCellStyle)style result:(UITableViewCell**)output
{
UITableViewCell* result = [self.tableView dequeueReusableCellWithIdentifier:reuseID];
if (result)
*output = result;
else
*output = [[UITableViewCell alloc] initWithStyle:style reuseIdentifier:reuseID];
return !result;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView
{ {
return self.sections.count; return self.sections.count;

View File

@ -22,40 +22,69 @@
#include "conf/config_file.h" #include "conf/config_file.h"
#include "file.h" #include "file.h"
static const void* const associated_module_key = &associated_module_key;
@implementation RADirectoryItem @implementation RADirectoryItem
+ (RADirectoryItem*)directoryItemFromElement:(struct string_list_elem*)element
{
RADirectoryItem* item = [RADirectoryItem new];
item.path = @(element->data);
item.isDirectory = element->attr.b;
return item;
}
@end @end
enum file_action { FA_DELETE = 10000, FA_CREATE, FA_MOVE };
static void file_action(enum file_action action, NSString* source, NSString* target)
{
NSError* error = nil;
bool result = false;
NSFileManager* manager = [NSFileManager defaultManager];
switch (action)
{
case FA_DELETE: result = [manager removeItemAtPath:target error:&error]; break;
case FA_CREATE: result = [manager createDirectoryAtPath:target withIntermediateDirectories:YES
attributes:nil error:&error]; break;
case FA_MOVE: result = [manager moveItemAtPath:source toPath:target error:&error]; break;
}
if (!result && error)
apple_display_alert(error.localizedDescription, @"Action failed");
}
@implementation RADirectoryList @implementation RADirectoryList
{ {
NSString* _path; NSString* _path;
NSMutableArray* _sectionNames;
id<RADirectoryListDelegate> _delegate;
} }
- (id)initWithPath:(NSString*)path delegate:(id<RADirectoryListDelegate>)delegate - (id)initWithPath:(NSString*)path delegate:(id<RADirectoryListDelegate>)delegate
{ {
_path = path;
_delegate = delegate;
self = [super initWithStyle:UITableViewStylePlain]; self = [super initWithStyle:UITableViewStylePlain];
self.title = path.lastPathComponent;
self.hidesHeaders = YES; if (self)
{
NSMutableArray *toolbarButtons = [[NSMutableArray alloc] initWithCapacity:3]; _path = path;
_directoryDelegate = delegate;
UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh)];
refreshButton.style = UIBarButtonItemStyleBordered; self = [super initWithStyle:UITableViewStylePlain];
[toolbarButtons addObject:refreshButton]; self.title = path.lastPathComponent;
self.hidesHeaders = YES;
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[toolbarButtons addObject:flexibleSpace]; self.toolbarItems =
@[
UIBarButtonItem *newFolderButton = [[UIBarButtonItem alloc] initWithTitle:@"New Folder" style:UIBarButtonItemStyleBordered target:self action:@selector(createNewFolder)]; [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
[toolbarButtons addObject:newFolderButton]; action:@selector(refresh)],
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self
[[[RetroArch_iOS get] toolbar] setItems:toolbarButtons]; action:nil],
[self setToolbarItems:toolbarButtons]; [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self
action:@selector(createNewFolder)]
];
[self.tableView addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
action:@selector(fileAction:)]];
}
return self; return self;
} }
@ -70,18 +99,24 @@
[self reset]; [self reset];
} }
- (NSArray*)sectionIndexTitlesForTableView:(UITableView*)tableView
{
static NSArray* names = nil;
if (!names)
names = @[@"/", @"#", @"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J", @"K", @"L",
@"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z"];
return names;
}
- (void)refresh - (void)refresh
{ {
static const char sectionNames[28] = { '/', '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
static const uint32_t sectionCount = sizeof(sectionNames) / sizeof(sectionNames[0]);
self.sections = [NSMutableArray array];
// Need one array per section // Need one array per section
NSMutableArray* sectionLists[sectionCount]; self.sections = [NSMutableArray array];
for (int i = 0; i != sectionCount; i ++)
sectionLists[i] = [NSMutableArray arrayWithObject:[NSString stringWithFormat:@"%c", sectionNames[i]]]; for (NSString* i in [self sectionIndexTitlesForTableView:self.tableView])
[self.sections addObject:[NSMutableArray arrayWithObject:i]];
// List contents // List contents
struct string_list* contents = dir_list_new(_path.UTF8String, 0, true); struct string_list* contents = dir_list_new(_path.UTF8String, 0, true);
@ -94,25 +129,13 @@
{ {
const char* basename = path_basename(contents->elems[i].data); const char* basename = path_basename(contents->elems[i].data);
uint32_t section = isalpha(basename[0]) ? (toupper(basename[0]) - 'A') + 2 : 1; uint32_t section = isalpha(basename[0]) ? (toupper(basename[0]) - 'A') + 2 : 1;
section = contents->elems[i].attr.b ? 0 : section; section = contents->elems[i].attr.b ? 0 : section;
RADirectoryItem* item = RADirectoryItem.new; [self.sections[section] addObject:[RADirectoryItem directoryItemFromElement:&contents->elems[i]]];
item.path = @(contents->elems[i].data);
item.isDirectory = contents->elems[i].attr.b;
[sectionLists[section] addObject:item];
} }
dir_list_free(contents); dir_list_free(contents);
// Add the sections
_sectionNames = [NSMutableArray array];
for (int i = 0; i != sectionCount; i ++)
{
[self.sections addObject:sectionLists[i]];
[_sectionNames addObject:sectionLists[i][0]];
}
} }
else else
apple_display_alert([NSString stringWithFormat:@"Browsed path is not a directory: %@", _path], 0); apple_display_alert([NSString stringWithFormat:@"Browsed path is not a directory: %@", _path], 0);
@ -120,162 +143,164 @@
[self.tableView reloadData]; [self.tableView reloadData];
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{ {
[_delegate directoryList:self itemWasSelected:[self itemForIndexPath:indexPath]]; [self.directoryDelegate directoryList:self itemWasSelected:[self itemForIndexPath:indexPath]];
} }
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{ {
static NSString* const cell_types[2] = { @"file", @"folder" };
static NSString* const icon_types[2] = { @"ic_file", @"ic_dir" };
static const UITableViewCellAccessoryType accessory_types[2] = { UITableViewCellAccessoryDetailDisclosureButton,
UITableViewCellAccessoryDisclosureIndicator };
RADirectoryItem* path = [self itemForIndexPath:indexPath]; RADirectoryItem* path = [self itemForIndexPath:indexPath];
uint32_t type_id = path.isDirectory ? 1 : 0; uint32_t type_id = path.isDirectory ? 1 : 0;
UITableViewCell* cell = [self.tableView dequeueReusableCellWithIdentifier:cell_types[type_id]]; UITableViewCell* cell = nil;
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cell_types[type_id]];
cell.imageView.image = [UIImage imageNamed:icon_types[type_id]];
cell.accessoryType = accessory_types[type_id];
}
static NSString* const cell_types[2] = { @"file", @"folder" };
if ([self getCellFor:cell_types[type_id] withStyle:UITableViewCellStyleDefault result:&cell])
{
static NSString* const icon_types[2] = { @"ic_file", @"ic_dir" };
cell.imageView.image = [UIImage imageNamed:icon_types[type_id]];
}
cell.textLabel.text = [path.path lastPathComponent]; cell.textLabel.text = [path.path lastPathComponent];
return cell; return cell;
} }
- (void)tableView:(UITableView*)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath*)indexPath
// File management
// Called as a selector from a toolbar button
- (void)createNewFolder
{ {
self.selectedItem = [self itemForIndexPath:indexPath]; UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Enter new folder name" message:@"" delegate:self
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:self.selectedItem.path.lastPathComponent delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
otherButtonTitles:@"Move", @"Rename", nil]; alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[menu showInView:[self view]]; alertView.tag = FA_CREATE;
[alertView show];
} }
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex // Called by the long press gesture recognizer
- (void)fileAction:(UILongPressGestureRecognizer*)gesture
{ {
if (gesture.state == UIGestureRecognizerStateBegan)
{
CGPoint point = [gesture locationInView:self.tableView];
NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:point];
if (indexPath)
{
self.selectedItem = [self itemForIndexPath:indexPath];
UIActionSheet* menu = [[UIActionSheet alloc] initWithTitle:self.selectedItem.path.lastPathComponent delegate:self
cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles:@"Move", @"Rename", @"Delete", nil];
menu.destructiveButtonIndex = 2;
[menu showFromToolbar:self.navigationController.toolbar];
}
}
}
// Called by the action sheet created in (void)fileAction:
- (void)actionSheet:(UIActionSheet*)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString* target = self.selectedItem.path;
// Move // Move
if (buttonIndex == actionSheet.firstOtherButtonIndex) if (buttonIndex == actionSheet.firstOtherButtonIndex)
[[RetroArch_iOS get] pushViewController:[[RAFoldersList alloc] initWithFilePath:self.selectedItem.path] animated:YES]; [self.navigationController pushViewController:[[RAFoldersList alloc] initWithFilePath:target] animated:YES];
// Rename // Rename
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 1) else if (buttonIndex == actionSheet.firstOtherButtonIndex + 1)
{ {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Enter new name" message:@"" delegate:self UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Enter new name" message:@"" delegate:self
cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput; alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView textFieldAtIndex:0].text = self.selectedItem.path.lastPathComponent; alertView.tag = FA_MOVE;
[alertView textFieldAtIndex:0].text = target.lastPathComponent;
[alertView show];
}
// Delete
else if (buttonIndex == actionSheet.destructiveButtonIndex)
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Really delete?" message:@"" delegate:self
cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
alertView.tag = FA_DELETE;
[alertView show]; [alertView show];
} }
} }
- (NSArray*)sectionIndexTitlesForTableView:(UITableView*)tableView // Called by various alert views created in this class, the alertView.tag value is the action to take.
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{ {
return _sectionNames; if (alertView.tag == FA_DELETE)
} file_action(FA_DELETE, nil, self.selectedItem.path);
else
- (void)tableView:(UITableView*)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{ {
RADirectoryItem* path = (RADirectoryItem*)[self itemForIndexPath:indexPath]; NSString* text = [alertView textFieldAtIndex:0].text;
if (![[NSFileManager defaultManager] removeItemAtPath:path.path error:nil]) if (buttonIndex == alertView.firstOtherButtonIndex && text.length)
apple_display_alert(@"It was not possible to delete file.", 0); file_action(alertView.tag, self.selectedItem.path, [_path stringByAppendingPathComponent:text]);
[self refresh];
}
}
- (void)createNewFolder {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Enter new folder name" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString* text = [alertView textFieldAtIndex:0].text;
NSError* error = nil;
if (buttonIndex != alertView.firstOtherButtonIndex || text.length == 0)
return;
// Rename
if ([alertView.title isEqualToString:@"Enter new name"])
{
NSString* target = [_path stringByAppendingPathComponent:text];
if (![[NSFileManager defaultManager] moveItemAtPath:self.selectedItem.path toPath:target error:&error])
apple_display_alert(error.localizedDescription, @"Failed to rename item.");
}
else if ([alertView.title isEqualToString:@"Enter new folder name"])
{
NSString* target = [_path stringByAppendingPathComponent:text];
if (![[NSFileManager defaultManager] createDirectoryAtPath:target withIntermediateDirectories:YES attributes:nil error:&error])
apple_display_alert(error.localizedDescription, @"Failed to create folder.");
} }
[self refresh]; [self refresh];
} }
@end @end
@implementation RAModuleList @implementation RAModuleList
{
id<RAModuleListDelegate> _delegate;
}
- (id)initWithGame:(NSString*)path delegate:(id<RAModuleListDelegate>)delegate - (id)initWithGame:(NSString*)path delegate:(id<RAModuleListDelegate>)delegate
{ {
self = [super initWithStyle:UITableViewStyleGrouped]; self = [super initWithStyle:UITableViewStyleGrouped];
[self setTitle:path ? [path lastPathComponent] : @"Cores"];
_delegate = delegate;
// Load the modules with their data
NSArray* moduleList = apple_get_modules();
NSMutableArray* supported = [NSMutableArray arrayWithObject:@"Suggested Cores"];
NSMutableArray* other = [NSMutableArray arrayWithObject:@"Other Cores"];
for (RAModuleInfo* i in moduleList) if (self)
{ {
if (path && [i supportsFileAtPath:path]) [supported addObject:i]; [self setTitle:path ? [path lastPathComponent] : @"Cores"];
else [other addObject:i]; _moduleDelegate = delegate;
// Load the modules with their data
NSArray* moduleList = apple_get_modules();
NSMutableArray* supported = [NSMutableArray arrayWithObject:@"Suggested Cores"];
NSMutableArray* other = [NSMutableArray arrayWithObject:@"Other Cores"];
for (RAModuleInfo* i in moduleList)
{
if (path && [i supportsFileAtPath:path]) [supported addObject:i];
else [other addObject:i];
}
if (supported.count > 1)
[self.sections addObject:supported];
if (other.count > 1)
[self.sections addObject:other];
} }
if (supported.count > 1)
[self.sections addObject:supported];
if (other.count > 1)
[self.sections addObject:other];
return self; return self;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{ {
[_delegate moduleList:self itemWasSelected:[self itemForIndexPath:indexPath]]; [self.moduleDelegate moduleList:self itemWasSelected:[self itemForIndexPath:indexPath]];
} }
- (void)infoButtonTapped:(id)sender - (void)infoButtonTapped:(id)sender
{ {
RAModuleInfo* info = objc_getAssociatedObject(sender, "MODULE"); RAModuleInfo* info = objc_getAssociatedObject(sender, associated_module_key);
if (info && info.data) if (info && info.data)
[RetroArch_iOS.get pushViewController:[[RAModuleInfoList alloc] initWithModuleInfo:info] animated:YES]; [self.navigationController pushViewController:[[RAModuleInfoList alloc] initWithModuleInfo:info] animated:YES];
else else
apple_display_alert(@"No information available.", 0); apple_display_alert(@"No information available.", 0);
} }
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{ {
UITableViewCell* cell = [self.tableView dequeueReusableCellWithIdentifier:@"module"]; static NSString* const cell_id;
if (!cell) UITableViewCell* cell = nil;
if ([self getCellFor:cell_id withStyle:UITableViewCellStyleDefault result:&cell])
{ {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"module"];
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoDark]; UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoDark];
[infoButton addTarget:self action:@selector(infoButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; [infoButton addTarget:self action:@selector(infoButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
cell.accessoryView = infoButton; cell.accessoryView = infoButton;
@ -283,11 +308,10 @@
RAModuleInfo* info = (RAModuleInfo*)[self itemForIndexPath:indexPath]; RAModuleInfo* info = (RAModuleInfo*)[self itemForIndexPath:indexPath];
cell.textLabel.text = info.description; cell.textLabel.text = info.description;
objc_setAssociatedObject(cell.accessoryView, "MODULE", info, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(cell.accessoryView, associated_module_key, info, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
return cell; return cell;
} }
@end @end
@implementation RAFoldersList @implementation RAFoldersList
@ -298,58 +322,57 @@
- (id)initWithFilePath:(NSString*)path - (id)initWithFilePath:(NSString*)path
{ {
self = [super initWithStyle:UITableViewStyleGrouped]; self = [super initWithStyle:UITableViewStyleGrouped];
_path = path;
// List contents
struct string_list* contents = dir_list_new(_path.stringByDeletingLastPathComponent.UTF8String, 0, true);
NSMutableArray* items = [NSMutableArray arrayWithObject:@""];
NSString* sourceDirectory = _path.stringByDeletingLastPathComponent;
if (contents) if (self)
{ {
dir_list_sort(contents, true); _path = path;
for (int i = 0; i < contents->size; i ++) // List contents
{ struct string_list* contents = dir_list_new([_path stringByDeletingLastPathComponent].UTF8String, 0, true);
if (contents->elems[i].attr.b) NSMutableArray* items = [NSMutableArray arrayWithObject:@""];
{ NSString* sourceDirectory = _path.stringByDeletingLastPathComponent;
const char* basename = path_basename(contents->elems[i].data);
[items addObject:[sourceDirectory stringByAppendingPathComponent:@(basename)]];
}
}
dir_list_free(contents); if (contents)
{
dir_list_sort(contents, true);
for (int i = 0; i < contents->size; i ++)
{
if (contents->elems[i].attr.b)
{
const char* basename = path_basename(contents->elems[i].data);
[items addObject:[sourceDirectory stringByAppendingPathComponent:@(basename)]];
}
}
dir_list_free(contents);
}
[self setTitle:[@"Move " stringByAppendingString:_path.lastPathComponent]];
[self.sections addObject:@[@"", [sourceDirectory stringByDeletingLastPathComponent]]];
[self.sections addObject:items];
} }
[self setTitle:[@"Move " stringByAppendingString:_path.lastPathComponent]];
[self.sections addObject:@[@"", sourceDirectory.stringByDeletingLastPathComponent]];
[self.sections addObject:items];
return self; return self;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{ {
static NSString* const CellIdentifier = @"Directory"; static NSString* const cell_id = @"Directory";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UITableViewCell* cell = nil;
[self getCellFor:cell_id withStyle:UITableViewCellStyleDefault result:&cell];
if (!cell) cell.textLabel.text = [[self itemForIndexPath:indexPath] lastPathComponent];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
NSString* path = [self itemForIndexPath:indexPath];
cell.textLabel.text = path.lastPathComponent;
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{ {
NSString* targetPath = [[self itemForIndexPath:indexPath] stringByAppendingPathComponent:_path.lastPathComponent]; NSString* targetPath = [[self itemForIndexPath:indexPath] stringByAppendingPathComponent:_path.lastPathComponent];
file_action(FA_MOVE, _path, targetPath);
NSError* error = nil; [self.navigationController popViewControllerAnimated:YES];
if (![[NSFileManager defaultManager] moveItemAtPath:_path toPath:targetPath error:&error])
apple_display_alert(error.localizedDescription, @"It was not possible to move the file");
[[RetroArch_iOS get] popViewControllerAnimated:YES];
} }
@end @end

View File

@ -28,6 +28,7 @@
@property BOOL hidesHeaders; @property BOOL hidesHeaders;
- (id)initWithStyle:(UITableViewStyle)style; - (id)initWithStyle:(UITableViewStyle)style;
- (bool)getCellFor:(NSString*)reuseID withStyle:(UITableViewCellStyle)style result:(UITableViewCell**)output;
- (id)itemForIndexPath:(NSIndexPath*)indexPath; - (id)itemForIndexPath:(NSIndexPath*)indexPath;
- (void)reset; - (void)reset;
@end @end
@ -44,7 +45,8 @@
@end @end
@interface RADirectoryList : RATableViewController <UIActionSheetDelegate> @interface RADirectoryList : RATableViewController <UIActionSheetDelegate>
@property (nonatomic, weak) RADirectoryItem *selectedItem; @property (nonatomic, weak) id<RADirectoryListDelegate> directoryDelegate;
@property (nonatomic, weak) RADirectoryItem* selectedItem;
- (id)initWithPath:(NSString*)path delegate:(id<RADirectoryListDelegate>)delegate; - (id)initWithPath:(NSString*)path delegate:(id<RADirectoryListDelegate>)delegate;
@end @end
@ -54,12 +56,13 @@
@end @end
@interface RAModuleList : RATableViewController @interface RAModuleList : RATableViewController
@property (nonatomic, weak) id<RAModuleListDelegate> moduleDelegate;
- (id)initWithGame:(NSString*)path delegate:(id<RAModuleListDelegate>)delegate; - (id)initWithGame:(NSString*)path delegate:(id<RAModuleListDelegate>)delegate;
@end @end
// browser.m // browser.m
@interface RAFoldersList : RATableViewController @interface RAFoldersList : RATableViewController
- (id) initWithFilePath:(NSString *)path; - (id) initWithFilePath:(NSString*)path;
@end @end
// RAModuleInfo.m // RAModuleInfo.m