diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2009-07-05 22:12:42 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2009-07-05 22:12:42 +0000 |
| commit | df6f955a82bce03650f24f562926ae9e7ffa58d4 (patch) | |
| tree | 0fd59aa1160d6b1ddf5728e81ccb39db2fc94809 /apps/filetree.c | |
| parent | 9431ea8c6539349126c93492f902292436f66339 (diff) | |
| download | rockbox-df6f955a82bce03650f24f562926ae9e7ffa58d4.zip rockbox-df6f955a82bce03650f24f562926ae9e7ffa58d4.tar.gz rockbox-df6f955a82bce03650f24f562926ae9e7ffa58d4.tar.bz2 rockbox-df6f955a82bce03650f24f562926ae9e7ffa58d4.tar.xz | |
Add a possibility for plugins to go directly to the WPS after exiting.
It only works for plugins executed via the filebrowser for now. Those
executed from the context menu or a simplelist (such as "Open With...") need additional hacking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21680 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetree.c')
| -rw-r--r-- | apps/filetree.c | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index d4681ae..87ac37c 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -552,22 +552,35 @@ int ft_enter(struct tree_context* c) /* plugin file */ case FILE_ATTR_ROCK: + { + int ret; if (global_settings.party_mode && audio_status()) { splash(HZ, ID2P(LANG_PARTY_MODE)); break; } - - if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED) + ret = plugin_load(buf,NULL); + switch (ret) { - if(*c->dirfilter > NUM_FILTER_MODES) - /* leave sub-browsers after usb, doing - otherwise might be confusing to the user */ - exit_func = true; - else - reload_dir = true; + case PLUGIN_GOTO_WPS: + play = true; + break; + case PLUGIN_USB_CONNECTED: + if(*c->dirfilter > NUM_FILTER_MODES) + /* leave sub-browsers after usb, doing + otherwise might be confusing to the user */ + exit_func = true; + else + reload_dir = true; + break; + /* + case PLUGIN_ERROR: + case PLUGIN_OK: + */ + default: + break; } break; - + } case FILE_ATTR_CUE: display_cuesheet_content(buf); break; @@ -584,8 +597,21 @@ int ft_enter(struct tree_context* c) plugin = filetype_get_plugin(file); if (plugin) { - if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED) - reload_dir = true; + switch (plugin_load(plugin,buf)) + { + case PLUGIN_USB_CONNECTED: + reload_dir = true; + break; + case PLUGIN_GOTO_WPS: + play = true; + break; + /* + case PLUGIN_OK: + case PLUGIN_ERROR: + */ + default: + break; + } } break; } |