summaryrefslogtreecommitdiff
path: root/apps/filetree.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-12-14 13:37:58 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-12-14 13:37:58 +0000
commit08af5d84044a7f18a619e1cb38cd183819be41b9 (patch)
treee441cf84b0268e5b008d044902641f063f218152 /apps/filetree.c
parentfbd75fcc86304ccf44ad8174c91684b687a877ec (diff)
downloadrockbox-08af5d84044a7f18a619e1cb38cd183819be41b9.tar.gz
rockbox-08af5d84044a7f18a619e1cb38cd183819be41b9.zip
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
Diffstat (limited to 'apps/filetree.c')
-rw-r--r--apps/filetree.c7
1 files changed, 6 insertions, 1 deletions
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)
269{ 269{
270 int i; 270 int i;
271 int name_buffer_used = 0; 271 int name_buffer_used = 0;
272 bool (*callback_show_item)(char *, int, struct tree_context *) = NULL;
272 DIR *dir; 273 DIR *dir;
273 274
274 if (tempdir) 275 if (tempdir)
275 dir = opendir(tempdir); 276 dir = opendir(tempdir);
276 else 277 else
278 {
277 dir = opendir(c->currdir); 279 dir = opendir(c->currdir);
280 callback_show_item = c->browse? c->browse->callback_show_item: NULL;
281 }
278 if(!dir) 282 if(!dir)
279 return -1; /* not a directory */ 283 return -1; /* not a directory */
280 284
@@ -351,7 +355,8 @@ int ft_load(struct tree_context* c, const char* tempdir)
351 (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) || 355 (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) ||
352 (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) || 356 (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) ||
353 (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK && 357 (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK &&
354 (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA)) 358 (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA) ||
359 (callback_show_item && !callback_show_item(entry->d_name, dptr->attr, c)))
355 { 360 {
356 i--; 361 i--;
357 continue; 362 continue;