diff options
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r-- | apps/root_menu.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index c59c39fe88..2a8662a170 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "kernel.h" | 32 | #include "kernel.h" |
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | #include "misc.h" | 34 | #include "misc.h" |
35 | #include "open_plugin.h" | ||
35 | #include "rolo.h" | 36 | #include "rolo.h" |
36 | #include "powermgmt.h" | 37 | #include "powermgmt.h" |
37 | #include "power.h" | 38 | #include "power.h" |
@@ -347,6 +348,7 @@ static int miscscrn(void * param) | |||
347 | int result = do_menu(menu, NULL, NULL, false); | 348 | int result = do_menu(menu, NULL, NULL, false); |
348 | switch (result) | 349 | switch (result) |
349 | { | 350 | { |
351 | case GO_TO_PLUGIN: | ||
350 | case GO_TO_PLAYLIST_VIEWER: | 352 | case GO_TO_PLAYLIST_VIEWER: |
351 | case GO_TO_WPS: | 353 | case GO_TO_WPS: |
352 | return result; | 354 | return result; |
@@ -703,7 +705,6 @@ static int load_context_screen(int selection) | |||
703 | return retval; | 705 | return retval; |
704 | } | 706 | } |
705 | 707 | ||
706 | #ifdef HAVE_PICTUREFLOW_INTEGRATION | ||
707 | static int load_plugin_screen(char *plug_path, void* plug_param) | 708 | static int load_plugin_screen(char *plug_path, void* plug_param) |
708 | { | 709 | { |
709 | int ret_val; | 710 | int ret_val; |
@@ -717,6 +718,9 @@ static int load_plugin_screen(char *plug_path, void* plug_param) | |||
717 | case PLUGIN_GOTO_WPS: | 718 | case PLUGIN_GOTO_WPS: |
718 | ret_val = GO_TO_WPS; | 719 | ret_val = GO_TO_WPS; |
719 | break; | 720 | break; |
721 | case PLUGIN_GOTO_PLUGIN: | ||
722 | ret_val = GO_TO_PLUGIN; | ||
723 | break; | ||
720 | case PLUGIN_OK: | 724 | case PLUGIN_OK: |
721 | ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT; | 725 | ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT; |
722 | break; | 726 | break; |
@@ -729,7 +733,6 @@ static int load_plugin_screen(char *plug_path, void* plug_param) | |||
729 | last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous; | 733 | last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous; |
730 | return ret_val; | 734 | return ret_val; |
731 | } | 735 | } |
732 | #endif | ||
733 | 736 | ||
734 | void root_menu(void) | 737 | void root_menu(void) |
735 | { | 738 | { |
@@ -807,21 +810,36 @@ void root_menu(void) | |||
807 | case GO_TO_ROOTITEM_CONTEXT: | 810 | case GO_TO_ROOTITEM_CONTEXT: |
808 | next_screen = load_context_screen(selected); | 811 | next_screen = load_context_screen(selected); |
809 | break; | 812 | break; |
810 | #ifdef HAVE_PICTUREFLOW_INTEGRATION | 813 | case GO_TO_PLUGIN: |
811 | case GO_TO_PICTUREFLOW: | ||
812 | { | 814 | { |
813 | char pf_path[MAX_PATH]; | 815 | char *key; |
814 | char activity[6];/* big enough to display int */ | 816 | switch (last_screen) |
815 | snprintf(activity, sizeof(activity), "%d", get_current_activity()); | 817 | { |
816 | snprintf(pf_path, sizeof(pf_path), | 818 | case GO_TO_ROOT: |
817 | "%s/pictureflow.rock", | 819 | key = ID2P(LANG_START_SCREEN); |
818 | PLUGIN_DEMOS_DIR); | 820 | break; |
819 | 821 | case GO_TO_WPS: | |
820 | next_screen = load_plugin_screen(pf_path, &activity); | 822 | key = ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN); |
821 | previous_browser = (next_screen != GO_TO_WPS) ? GO_TO_FILEBROWSER : GO_TO_PICTUREFLOW; | 823 | break; |
824 | case GO_TO_SHORTCUTMENU: | ||
825 | key = ID2P(LANG_SHORTCUTS); | ||
826 | break; | ||
827 | default: | ||
828 | key = ID2P(LANG_OPEN_PLUGIN); | ||
829 | break; | ||
830 | } | ||
831 | |||
832 | open_plugin_get_entry(key, &open_plugin_entry); | ||
833 | char *path = open_plugin_entry.path; | ||
834 | char *param = open_plugin_entry.param; | ||
835 | if (param[0] == '\0') | ||
836 | param = NULL; | ||
837 | |||
838 | next_screen = load_plugin_screen(path, param); | ||
839 | |||
840 | previous_browser = (next_screen != GO_TO_WPS) ? GO_TO_FILEBROWSER : GO_TO_PLUGIN; | ||
822 | break; | 841 | break; |
823 | } | 842 | } |
824 | #endif | ||
825 | default: | 843 | default: |
826 | #ifdef HAVE_TAGCACHE | 844 | #ifdef HAVE_TAGCACHE |
827 | /* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */ | 845 | /* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */ |