Index: apps/plugins/random_folder_advance_config.c
===================================================================
--- apps/plugins/random_folder_advance_config.c  (Revision 21603)
+++ apps/plugins/random_folder_advance_config.c  (Arbeitskopie)
@@ -20,6 +20,7 @@
  ****************************************************************************/
 #include "plugin.h"
 #include "file.h"
+#include "lib/pluginlib_exit.h"

 PLUGIN_HEADER

@@ -287,7 +288,7 @@
 int edit_list(void)
 {
     struct gui_synclist lists;
-    bool exit = false;
+    bool quit = false;
     int button,i;
     int selection, ret = 0;

@@ -306,7 +307,7 @@
     rb->gui_synclist_limit_scroll(&lists,true);
     rb->gui_synclist_select_item(&lists, 0);

-    while (!exit)
+    while (!quit)
     {
         rb->gui_synclist_draw(&lists);
         button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
@@ -359,7 +360,7 @@
                     case 0:
                         save_list();
                     case 1:
-                        exit = true;
+                        quit = true;
                         ret = -2;
                 }
             }
@@ -537,7 +538,7 @@

 int main_menu(void)
 {
-    bool exit = false;
+    bool quit = false;

     MENUITEM_STRINGLIST(menu, "Main Menu", NULL,
                         "Generate Folder List",
@@ -567,7 +568,7 @@
             rb->cpu_boost(true);
 #endif
             if (edit_list() < 0)
-                exit = true;
+                quit = true;
 #ifdef HAVE_ADJUSTABLE_CPU_FREQ
             rb->cpu_boost(false);
 #endif
@@ -603,21 +604,26 @@
             rb->backlight_on();
             break;
         case 4:
-            start_shuffled_play();
-            exit=true;
+        {
+            int ret = start_shuffled_play();
+            if (!ret)
+                exit(PLUGIN_ERROR);
+            else
+                exit(PLUGIN_GOTO_WPS);
             break;
+        }
         case 5:
             return 1;
     }
-    return exit?1:0;
+    return quit?1:0;
 }

 enum plugin_status plugin_start(const void* parameter)
 {
+    PLUGINLIB_EXIT_INIT;
     (void)parameter;

     abort = false;
-    
     while (!main_menu())
         ;
     return PLUGIN_OK;
Index: apps/plugins/lib/pluginlib_exit.h
===================================================================
--- apps/plugins/lib/pluginlib_exit.h  (Revision 21603)
+++ apps/plugins/lib/pluginlib_exit.h  (Arbeitskopie)
@@ -30,18 +30,21 @@
 #endif

 /* PLUGINLIB_EXIT_INIT needs to be placed as the first line in plugin_start */
-#define PLUGINLIB_EXIT_INIT switch(setjmp(__exit_env))   \
-                            {                            \
-                                case 1:                  \
-                                    return PLUGIN_OK;    \
-                                case 2:                  \
-                                    return PLUGIN_ERROR; \
-                                case 0:                  \
-                                default:                 \
-                                    break;               \
+#define PLUGINLIB_EXIT_INIT switch(setjmp(__exit_env))      \
+                            {                               \
+                                case -1:                    \
+                                    return PLUGIN_ERROR;    \
+                                case PLUGIN_OK+1:           \
+                                    return PLUGIN_OK;       \
+                                case PLUGIN_GOTO_WPS+1:     \
+                                    return PLUGIN_GOTO_WPS; \
+                                case PLUGIN_USB_CONNECTED+1:    \
+                                    return PLUGIN_USB_CONNECTED;\
+                                default:                    \
+                                    break;                  \
                             }

 extern jmp_buf __exit_env;
-#define exit(status) longjmp(__exit_env, status != 0 ? 2 : 1)
+#define exit(status) longjmp(__exit_env, (status < 0 || status >= PLUGIN_MAX_RETURNS) ? -1:status+1)

 #endif /*  __PLUGINLIB_EXIT_H__ */
Index: apps/plugins/properties.c
===================================================================
--- apps/plugins/properties.c  (Revision 21603)
+++ apps/plugins/properties.c  (Arbeitskopie)
@@ -276,6 +276,7 @@
     int button;
     bool quit = false;
     char file[MAX_PATH];
+    int ret = PLUGIN_OK;
     rb->strcpy(file, (const char *) parameter);

     /* determine if it's a file or a directory */
@@ -332,11 +333,13 @@
 
     while(!quit)
     {
-        button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
+        button = rb->get_action(CONTEXT_TREE,TIMEOUT_BLOCK);
         if (rb->gui_synclist_do_button(&properties_lists,&button,LIST_WRAP_ON))
             continue;
         switch(button)
         {
+            case ACTION_TREE_WPS:
+                return PLUGIN_GOTO_WPS;
             case ACTION_STD_CANCEL:
                 quit = true;
                 break;
@@ -346,5 +349,5 @@
         }
     }
 
-    return PLUGIN_OK;
+    return ret;
 }
Index: apps/plugins/pictureflow/pictureflow.c
===================================================================
--- apps/plugins/pictureflow/pictureflow.c  (Revision 21603)
+++ apps/plugins/pictureflow/pictureflow.c  (Arbeitskopie)
@@ -54,6 +54,12 @@
 #define PF_CONTEXT ACTION_STD_CONTEXT
 #define PF_BACK ACTION_STD_CANCEL
 #define PF_MENU ACTION_STD_MENU
+#define PF_WPS ACTION_TREE_WPS
+
+#if PF_PLAYBACK_CAPABLE
+#define PF_STOP ACTION_TREE_STOP
+#endif
+
 #define PF_QUIT (LAST_ACTION_PLACEHOLDER + 1)
 
 #if !defined(HAVE_SCROLLWHEEL)
@@ -122,8 +128,6 @@
     {PF_BACK,         BUTTON_POWER|BUTTON_REL,    BUTTON_POWER},
     {ACTION_NONE,     BUTTON_POWER,               BUTTON_NONE},
 #endif
-#elif CONFIG_KEYPAD == SANSA_E200_PAD
-    {PF_QUIT,         BUTTON_POWER,               BUTTON_NONE},
 #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
     {PF_QUIT,         BUTTON_EQ,                  BUTTON_NONE},
 #elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
@@ -2008,6 +2012,10 @@
 void cleanup(void *parameter)
 {
     (void) parameter;
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+    rb->cpu_boost(false);
+#endif
+    end_pf_thread();
     /* Turn on backlight timeout (revert to settings) */
     backlight_use_settings(); /* backlight control in lib/helper.c */
 
@@ -2136,6 +2144,7 @@
   Show the main menu
  */
 enum {
+    PF_GOTO_WPS,
 #if PF_PLAYBACK_CAPABLE
     PF_MENU_PLAYBACK_CONTROL,
 #endif
@@ -2154,12 +2163,15 @@
 #endif
 
     MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL,
+                        "Go to WPS",
 #if PF_PLAYBACK_CAPABLE
                         "Playback Control",
 #endif
                                             "Settings", "Return", "Quit");
     while (1)  {
         switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
+            case PF_GOTO_WPS: /* WPS */
+                return -2;
 #if PF_PLAYBACK_CAPABLE
             case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */
                 playback_control(NULL);
@@ -2169,10 +2181,8 @@
                 result = settings_menu();
                 if ( result != 0 ) return result;
                 break;
-
             case PF_MENU_RETURN:
                 return 0;
-
             case PF_MENU_QUIT:
                 return -1;
 
@@ -2400,6 +2410,16 @@
     old_shuffle = shuffle;
 }
 #endif
+/*
+int tracklist_context(void)
+{
+    char* filename = get_track_filename(selected_track);
+    int attr = 0x300;
+    int context = CONTEXT_ID3DB;
+    return rb->onplay(filename, attr, context);
+}
+*/
+
 /**
    Draw the current album name
  */
@@ -2656,7 +2676,13 @@
         switch (button) {
         case PF_QUIT:
             return PLUGIN_OK;
-
+        case PF_WPS:
+            return PLUGIN_GOTO_WPS;
+#if PF_PLAYBACK_CAPABLE
+        case PF_STOP:
+            rb->audio_stop();
+            break;
+#endif
         case PF_BACK:
             if ( pf_state == pf_show_tracks )
             {
@@ -2668,12 +2694,12 @@
             if (pf_state == pf_idle || pf_state == pf_scrolling)
                 return PLUGIN_OK;
             break;
-
         case PF_MENU:
 #ifdef USEGSLIB
             grey_show(false);
 #endif
             ret = main_menu();
+            if ( ret == -2 ) return PLUGIN_GOTO_WPS;
             if ( ret == -1 ) return PLUGIN_OK;
             if ( ret != 0 ) return ret;
 #ifdef USEGSLIB
@@ -2708,7 +2734,12 @@
 #endif
             }
             break;
-
+        case PF_CONTEXT:
+/*
+            if ( pf_state == pf_show_tracks)
+                tracklist_context();
+*/
+            break;
         default:
             if (rb->default_event_handler_ex(button, cleanup, NULL)
                 == SYS_USB_CONNECTED)
@@ -2747,9 +2778,6 @@
 #endif
 #endif
     ret = main();
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
-    rb->cpu_boost(false);
-#endif
     if ( ret == PLUGIN_OK ) {
         if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
                             CONFIG_VERSION))
@@ -2759,7 +2787,6 @@
         }
     }
 
-    end_pf_thread();
     cleanup(NULL);
     return ret;
 }
Index: apps/onplay.c
===================================================================
--- apps/onplay.c  (Revision 21603)
+++ apps/onplay.c  (Arbeitskopie)
@@ -79,6 +79,7 @@
     static const struct menu_callback_with_desc name##__ = {callback,str,icon};\
     static const struct menu_item_ex name =                             \
         {MT_MENU|MENU_HAS_DESC|MENU_EXITAFTERTHISMENU|                  \
+        MENU_ALLOW_AUDIO_ACTIONS|                                       \
          MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)),            \
             { (void*)name##_},{.callback_and_desc = & name##__}};
             
@@ -135,12 +136,18 @@
     return action;
 }
 
-static bool list_viewers(void)
+static int list_viewers(void)
 {
     int ret = filetype_list_viewers(selected_file);
-    if (ret == PLUGIN_USB_CONNECTED)
+    if (ret == PLUGIN_USB_CONNECTED
+        ||ret == SYS_USB_CONNECTED)
         onplay_result = ONPLAY_RELOAD_DIR;
-    return false;
+    else if (ret == ACTION_TREE_WPS)
+    {
+        onplay_result = ONPLAY_START_PLAY;
+        return GO_TO_WPS;
+    }
+    return 0;
 }
 
 static bool shuffle_playlist(void)
@@ -1017,7 +1024,7 @@
                   properties, NULL, clipboard_callback, Icon_NOICON);
 MENUITEM_FUNCTION(create_dir_item, 0, ID2P(LANG_CREATE_DIR),
                   create_dir, NULL, clipboard_callback, Icon_NOICON);
-MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH),
+MENUITEM_FUNCTION(list_viewers_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_ONPLAY_OPEN_WITH),
                   list_viewers, NULL, clipboard_callback, Icon_NOICON);
 #if LCD_DEPTH > 1
 MENUITEM_FUNCTION(set_backdrop_item, 0, ID2P(LANG_SET_AS_BACKDROP),
@@ -1155,18 +1162,16 @@
 #endif
            &add_to_faves_item,
          );
+
 static int onplaymenu_callback(int action,const struct menu_item_ex *this_item)
 {
     (void)this_item;
     switch (action)
     {
         case ACTION_TREE_STOP:
+            list_stop_handler();
             if (this_item == &wps_onplay_menu)
-            {
-                list_stop_handler();
                 return ACTION_STD_CANCEL;
-            }
-            break;
         case ACTION_EXIT_MENUITEM:
             return ACTION_EXIT_AFTER_THIS_MENUITEM;
             break;
@@ -1187,6 +1192,7 @@
     switch (do_menu(menu, NULL, NULL, false))
     {
         case GO_TO_WPS:
+        case GO_TO_PREVIOUS_MUSIC:
             return ONPLAY_START_PLAY;
         case GO_TO_ROOT:
         case GO_TO_MAINMENU:
Index: apps/gui/list.c
===================================================================
--- apps/gui/list.c  (Revision 21603)
+++ apps/gui/list.c  (Arbeitskopie)
@@ -838,8 +838,9 @@
     return simplelist_text[item];
 }
 
-bool simplelist_show_list(struct simplelist_info *info)
+int simplelist_show_list(struct simplelist_info *info)
 {
+    int retval = 0;
     struct gui_synclist lists;
     int action, old_line_count = simplelist_line_count;
     int oldbars = viewportmanager_set_statusbar(VP_SB_ALLSCREENS);
@@ -880,7 +881,7 @@
 
     while(1)
     {
-        list_do_action(CONTEXT_STD, info->timeout,
+        list_do_action(CONTEXT_TREE, info->timeout,
                        &lists, &action, wrap);
 
         /* We must yield in this case or no other thread can run */
@@ -897,7 +898,6 @@
                 info->selection = gui_synclist_get_sel_pos(&lists);
                 break;
             }
-                
             if (info->get_name == NULL)
                 gui_synclist_set_nb_items(&lists,
                         simplelist_line_count*info->selection_size);
@@ -919,11 +919,14 @@
             old_line_count = simplelist_line_count;
         }
         else if(default_event_handler(action) == SYS_USB_CONNECTED)
-            return true;
+            return SYS_USB_CONNECTED;
+        else if(action == ACTION_TREE_WPS ||
+                action == ACTION_TREE_STOP)
+            return action;
     }
     talk_shutup();
     viewportmanager_set_statusbar(oldbars);
-    return false;
+    return retval;
 }
 
 void simplelist_info_init(struct simplelist_info *info, char* title,
Index: apps/gui/list.h
===================================================================
--- apps/gui/list.h  (Revision 21603)
+++ apps/gui/list.h  (Arbeitskopie)
@@ -255,6 +255,6 @@
 /* show a list.
    if list->action_callback != NULL it is called with the action ACTION_REDRAW
     before the list is dislplayed for the first time */
-bool simplelist_show_list(struct simplelist_info *info);
+int simplelist_show_list(struct simplelist_info *info);
 
 #endif /* _GUI_LIST_H_ */
Index: apps/menu.c
===================================================================
--- apps/menu.c  (Revision 21603)
+++ apps/menu.c  (Arbeitskopie)
@@ -428,12 +428,14 @@
             done = true;
         }
 #endif
-        else if (action == ACTION_TREE_WPS)
+        else if (menu->flags & MENU_ALLOW_AUDIO_ACTIONS
+                && action == ACTION_TREE_WPS)
         {
             ret = GO_TO_PREVIOUS_MUSIC;
             done = true;
         }
-        else if (action == ACTION_TREE_STOP)
+        else if (menu->flags & MENU_ALLOW_AUDIO_ACTIONS
+                && action == ACTION_TREE_STOP)
         {
             redraw_lists = list_stop_handler();
         }
Index: apps/menus/main_menu.c
===================================================================
--- apps/menus/main_menu.c  (Revision 21603)
+++ apps/menus/main_menu.c  (Arbeitskopie)
@@ -394,10 +394,12 @@
     }
     return action;
 }
-static bool show_info(void)
+
+static int show_info(void* ignored)
 {
     struct info_data data = {.new_data = true };
     struct simplelist_info info;
+    (void)ignored;
     simplelist_info_init(&info, str(LANG_ROCKBOX_INFO), INFO_COUNT, (void*)&data);
     info.hide_selection = !global_settings.talk_menu;
     if (info.hide_selection)
@@ -409,7 +411,7 @@
     return simplelist_show_list(&info);
 }
 MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO),
-                   (menu_function)show_info, NULL, NULL, Icon_NOICON);
+                   show_info, NULL, NULL, Icon_NOICON);
 
 
 /* sleep Menu */
@@ -441,6 +443,18 @@
                    &sleep_timer_set, -5, 300, 0, sleep_timer_formatter);
 }
 
+static int debug_callback(int action, const struct menu_item_ex *this_item)
+{
+    switch(action)
+    {
+        case ACTION_TREE_WPS:
+            panicf("LOL");
+            return GO_TO_WPS;
+        default:
+            break;
+    }
+    return action;
+}
 
 #if CONFIG_RTC
 int time_screen(void* ignored);
@@ -456,10 +470,10 @@
                    (menu_function)show_credits, NULL, NULL, Icon_NOICON);
 MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME),
                    (menu_function)view_runtime, NULL, NULL, Icon_NOICON);
-MENUITEM_FUNCTION(debug_menu_item, 0, ID2P(LANG_DEBUG),
-                   (menu_function)debug_menu, NULL, NULL, Icon_NOICON);
+MENUITEM_FUNCTION(debug_menu_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_DEBUG),
+                   debug_menu, NULL, NULL, Icon_NOICON);
 
-MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_Questionmark,
+MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), debug_callback, Icon_Questionmark,
 #if CONFIG_RTC
           &timedate_item,
 #endif
Index: apps/menu.h
===================================================================
--- apps/menu.h  (Revision 21603)
+++ apps/menu.h  (Arbeitskopie)
@@ -61,6 +61,7 @@
 /* Flags for MT_FUNCTION_CALL */
 #define MENU_FUNC_USEPARAM 0x80
 #define MENU_FUNC_CHECK_RETVAL 0x100
+#define MENU_ALLOW_AUDIO_ACTIONS  0x200
 
 #define MENU_COUNT_MASK 0xFFF
 #define MENU_COUNT_SHIFT 12
Index: apps/filetree.c
===================================================================
--- apps/filetree.c  (Revision 21603)
+++ apps/filetree.c  (Arbeitskopie)
@@ -552,22 +552,31 @@
 
                 /* 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_USB_CONNECTED:
+                        break;
+                    case PLUGIN_GOTO_WPS:
+                        play = true;
+                        break;
+                    default:
+                        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;
                 }
                 break;
-
+            }
             case FILE_ATTR_CUE:
                 display_cuesheet_content(buf);
                 break;
@@ -584,8 +593,11 @@
                 plugin = filetype_get_plugin(file);
                 if (plugin)
                 {
-                    if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED)
+                    int ret = plugin_load(plugin,buf);
+                    if (ret == PLUGIN_USB_CONNECTED)
                         reload_dir = true;
+                    else if (ret == PLUGIN_GOTO_WPS)
+                        play = true;
                 }
                 break;
             }
Index: apps/plugin.c
===================================================================
--- apps/plugin.c  (Revision 21603)
+++ apps/plugin.c  (Arbeitskopie)
@@ -658,6 +658,7 @@
     appsversion,
     /* new stuff at the end, sort into place next time
        the API gets incompatible */
+    onplay,
     playlist_insert_directory,
 };
 
@@ -804,8 +805,6 @@
 #endif /* LCD_DEPTH */
 #endif /* HAVE_LCD_BITMAP */
 
-    lcd_clear_display();
-    lcd_update();
 
 #ifdef HAVE_REMOTE_LCD
 #if LCD_REMOTE_DEPTH > 1
@@ -814,12 +813,16 @@
 #else
     lcd_remote_set_drawmode(DRMODE_SOLID);
 #endif
-    lcd_remote_clear_display();
 
+    if (rc != PLUGIN_GOTO_WPS)
+    {
+        lcd_clear_display();
+        lcd_update();
+        lcd_remote_clear_display();
+        lcd_remote_update();
+    }
 
-    lcd_remote_update();
 
-
 #endif
     viewportmanager_set_statusbar(oldbars);
     if (pfn_tsr_exit == NULL)
@@ -827,19 +830,10 @@
 
     sim_plugin_close(pd);
 
-    switch (rc) {
-        case PLUGIN_OK:
-            break;
+    if (rc == PLUGIN_ERROR)
+        splash(HZ*2, str(LANG_PLUGIN_ERROR));
 
-        case PLUGIN_USB_CONNECTED:
-            return PLUGIN_USB_CONNECTED;
-
-        default:
-            splash(HZ*2, str(LANG_PLUGIN_ERROR));
-            break;
-    }
-
-    return PLUGIN_OK;
+    return rc;
 }
 
 /* Returns a pointer to the portion of the plugin buffer that is not already
Index: apps/plugin.h
===================================================================
--- apps/plugin.h  (Revision 21603)
+++ apps/plugin.h  (Arbeitskopie)
@@ -93,6 +93,7 @@
 #include "ata_idle_notify.h"
 #include "settings_list.h"
 #include "timefuncs.h"
+#include "onplay.h"
 
 #ifdef HAVE_ALBUMART
 #include "albumart.h"
@@ -139,6 +140,8 @@
 enum plugin_status {
     PLUGIN_OK = 0,
     PLUGIN_USB_CONNECTED,
+    PLUGIN_GOTO_WPS,
+    PLUGIN_MAX_RETURNS,
     PLUGIN_ERROR = -1,
 };
 
@@ -351,7 +354,7 @@
                                         const struct text_message * no_message);
     void (*simplelist_info_init)(struct simplelist_info *info, char* title,
            int count, void* data);
-    bool (*simplelist_show_list)(struct simplelist_info *info);
+    int  (*simplelist_show_list)(struct simplelist_info *info);
 
     /* button */
     long (*button_get)(bool block);
@@ -821,6 +824,7 @@
     const char *appsversion;
     /* new stuff at the end, sort into place next time
        the API gets incompatible */
+    int (*onplay)(char* file, int attr, int from);
     int (*playlist_insert_directory)(struct playlist_info* playlist,
                               const char *dirname, int position, bool queue,
                               bool recurse);
Index: apps/root_menu.c
===================================================================
--- apps/root_menu.c  (Revision 21603)
+++ apps/root_menu.c  (Arbeitskopie)
@@ -414,6 +414,8 @@
 {
     switch (action)
     {
+        case ACTION_TREE_WPS:
+            return GO_TO_WPS;
         case ACTION_TREE_STOP:
             return ACTION_REDRAW;
         case ACTION_REQUEST_MENUITEM:
@@ -434,6 +436,7 @@
     }
     return action;
 }
+
 static int get_selection(int last_screen)
 {
     unsigned int i;
Index: apps/debug_menu.c
===================================================================
--- apps/debug_menu.c  (Revision 21603)
+++ apps/debug_menu.c  (Arbeitskopie)
@@ -2853,8 +2853,9 @@
     (void)data; (void)buffer; (void)buffer_len;
     return menuitems[item].desc;
 }
-bool debug_menu(void)
+int debug_menu(void* ignored)
 {
+    (void)ignored;
     struct simplelist_info info;
 
     simplelist_info_init(&info, "Debug Menu", ARRAYLEN(menuitems), NULL);
Index: apps/debug_menu.h
===================================================================
--- apps/debug_menu.h  (Revision 21603)
+++ apps/debug_menu.h  (Arbeitskopie)
@@ -21,7 +21,7 @@
 #ifndef _DEBUG_MENU_H
 #define _DEBUG_MENU_H
 
-bool debug_menu(void);
+int debug_menu(void* ignored);
 
 #ifndef SIMULATOR
 extern bool dbg_ports(void);
Index: apps/tagtree.c
===================================================================
--- apps/tagtree.c  (Revision 21603)
+++ apps/tagtree.c  (Arbeitskopie)
@@ -54,6 +54,11 @@
 #include "storage.h"
 #include "dir_uncached.h"
 
+#ifdef HAVE_LCD_BITMAP
+#include "plugin.h" /* to plugin_load() pictureflow */
+#endif
+
+
 #define FILE_SEARCH_INSTRUCTIONS ROCKBOX_DIR "/tagnavi.config"
 
 static int tagtree_play_folder(struct tree_context* c);
@@ -65,6 +70,9 @@
     NAVIBROWSE,
     ALLSUBENTRIES,
     PLAYTRACK,
+#ifdef HAVE_LCD_BITMAP
+    PICTUREFLOW,
+#endif
 };
 
 static const struct id3_to_search_mapping {
@@ -1166,6 +1174,16 @@
             dptr++;
             current_entry_count++;
         }
+#ifdef HAVE_LCD_BITMAP
+        if (offset <= 2 && tag == tag_album)
+        {
+            dptr->newtable = PICTUREFLOW;
+            dptr->name = "<By Covers>";
+            dptr++;
+            current_entry_count++;
+            special_entry_count++;
+        }
+#endif
         special_entry_count+=2;
     }
     
@@ -1366,7 +1384,9 @@
         case ROOT:
             count = load_root(c);
             break;
-
+#ifdef HAVE_LCD_BITMAP
+        case PICTUREFLOW:
+#endif
         case ALLSUBENTRIES:
         case NAVIBROWSE:
             logf("navibrowse...");
@@ -1416,6 +1436,23 @@
     }
     newextra = dptr->newtable;
 
+#ifdef HAVE_LCD_BITMAP
+    /* Start pictureflow, and return as we're leaving the db browser
+     * and also we still want to be in the album node after exiting
+     */
+    if (newextra == PICTUREFLOW)
+    {
+        int retval = plugin_load(PLUGIN_DEMOS_DIR "/pictureflow.rock", NULL);
+        switch(retval)
+        {
+            case PLUGIN_GOTO_WPS:
+                return 2;
+            default:
+                return 0;
+        }
+    }
+#endif
+
     if (c->dirlevel >= MAX_DIR_LEVELS)
         return 0;