From 08af5d84044a7f18a619e1cb38cd183819be41b9 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Tue, 14 Dec 2010 13:37:58 +0000 Subject: FS#11777: enhancement for rockbox_browse() * Add struct browse_context to be passed to rockbox_browse. * Show proper title when selecting e.g. .wps file or .sbs file from the settings menu. * Add select only mode to rockbox_browse(). when a file is selected, it's path is stored to buffer and the browser exits without 'playing' the file. this will allow to use the browser in more places to select file including plugins. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28831 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/filetree.c') diff --git a/apps/filetree.c b/apps/filetree.c index 1dc510f8c7..6fb0ed5469 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -269,12 +269,16 @@ int ft_load(struct tree_context* c, const char* tempdir) { int i; int name_buffer_used = 0; + bool (*callback_show_item)(char *, int, struct tree_context *) = NULL; DIR *dir; if (tempdir) dir = opendir(tempdir); else + { dir = opendir(c->currdir); + callback_show_item = c->browse? c->browse->callback_show_item: NULL; + } if(!dir) return -1; /* not a directory */ @@ -351,7 +355,8 @@ int ft_load(struct tree_context* c, const char* tempdir) (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) || (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) || (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK && - (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA)) + (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA) || + (callback_show_item && !callback_show_item(entry->d_name, dptr->attr, c))) { i--; continue; -- cgit v1.2.3