From d871ff8cce9afe8437f7b51f4cd853018abd9924 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 9 Jun 2010 04:25:41 +0000 Subject: FS#11270 by Chris Savery - WPS integration for pictureflow git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26710 a1c6a512-1295-4272-9138-f99709370657 --- apps/root_menu.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'apps/root_menu.c') diff --git a/apps/root_menu.c b/apps/root_menu.c index dab70f52c7..d1a05a0c13 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -68,6 +68,7 @@ #include "tagcache.h" #endif #include "language.h" +#include "plugin.h" struct root_items { int (*function)(void* param); @@ -544,6 +545,24 @@ static int load_context_screen(int selection) return GO_TO_PREVIOUS; } +#ifdef HAVE_TAGCACHE +static int load_plugin_screen(char *plug_path) +{ + int ret_val; + int old_previous = last_screen; + last_screen = next_screen; + global_status.last_screen = (char)next_screen; + status_save(); + + ret_val = plugin_load(plug_path, NULL); + if (ret_val == PLUGIN_OK) + ret_val = GO_TO_PREVIOUS; + if (ret_val == GO_TO_PREVIOUS) + last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous; + return ret_val; +} +#endif + static int previous_music = GO_TO_WPS; void previous_music_is_wps(void) @@ -619,6 +638,18 @@ void root_menu(void) case GO_TO_ROOTITEM_CONTEXT: next_screen = load_context_screen(selected); break; +#ifdef HAVE_TAGCACHE + case GO_TO_PICTUREFLOW: + while ( !tagcache_is_usable() ) + { + splash(0, str(LANG_TAGCACHE_BUSY)); + if ( action_userabort(HZ/5) ) + break; + } + next_screen = load_plugin_screen(PLUGIN_DEMOS_DIR "/pictureflow.rock"); + previous_browser = GO_TO_PICTUREFLOW; + break; +#endif default: if (next_screen == GO_TO_FILEBROWSER #ifdef HAVE_TAGCACHE -- cgit v1.2.3