diff options
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r-- | apps/root_menu.c | 31 |
1 files changed, 31 insertions, 0 deletions
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 @@ | |||
68 | #include "tagcache.h" | 68 | #include "tagcache.h" |
69 | #endif | 69 | #endif |
70 | #include "language.h" | 70 | #include "language.h" |
71 | #include "plugin.h" | ||
71 | 72 | ||
72 | struct root_items { | 73 | struct root_items { |
73 | int (*function)(void* param); | 74 | int (*function)(void* param); |
@@ -544,6 +545,24 @@ static int load_context_screen(int selection) | |||
544 | return GO_TO_PREVIOUS; | 545 | return GO_TO_PREVIOUS; |
545 | } | 546 | } |
546 | 547 | ||
548 | #ifdef HAVE_TAGCACHE | ||
549 | static int load_plugin_screen(char *plug_path) | ||
550 | { | ||
551 | int ret_val; | ||
552 | int old_previous = last_screen; | ||
553 | last_screen = next_screen; | ||
554 | global_status.last_screen = (char)next_screen; | ||
555 | status_save(); | ||
556 | |||
557 | ret_val = plugin_load(plug_path, NULL); | ||
558 | if (ret_val == PLUGIN_OK) | ||
559 | ret_val = GO_TO_PREVIOUS; | ||
560 | if (ret_val == GO_TO_PREVIOUS) | ||
561 | last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous; | ||
562 | return ret_val; | ||
563 | } | ||
564 | #endif | ||
565 | |||
547 | static int previous_music = GO_TO_WPS; | 566 | static int previous_music = GO_TO_WPS; |
548 | 567 | ||
549 | void previous_music_is_wps(void) | 568 | void previous_music_is_wps(void) |
@@ -619,6 +638,18 @@ void root_menu(void) | |||
619 | case GO_TO_ROOTITEM_CONTEXT: | 638 | case GO_TO_ROOTITEM_CONTEXT: |
620 | next_screen = load_context_screen(selected); | 639 | next_screen = load_context_screen(selected); |
621 | break; | 640 | break; |
641 | #ifdef HAVE_TAGCACHE | ||
642 | case GO_TO_PICTUREFLOW: | ||
643 | while ( !tagcache_is_usable() ) | ||
644 | { | ||
645 | splash(0, str(LANG_TAGCACHE_BUSY)); | ||
646 | if ( action_userabort(HZ/5) ) | ||
647 | break; | ||
648 | } | ||
649 | next_screen = load_plugin_screen(PLUGIN_DEMOS_DIR "/pictureflow.rock"); | ||
650 | previous_browser = GO_TO_PICTUREFLOW; | ||
651 | break; | ||
652 | #endif | ||
622 | default: | 653 | default: |
623 | if (next_screen == GO_TO_FILEBROWSER | 654 | if (next_screen == GO_TO_FILEBROWSER |
624 | #ifdef HAVE_TAGCACHE | 655 | #ifdef HAVE_TAGCACHE |