summaryrefslogtreecommitdiff
path: root/apps/filetree.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-07-31 22:45:10 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-08-17 10:15:14 -0400
commit35502834423049b319fde41ff305b48de67d2d51 (patch)
tree00d638d9348cd38f15cf6d341e700bc36153b3f8 /apps/filetree.c
parentd553bb1149800daf16dcb92bc0608fe6248e1dab (diff)
downloadrockbox-35502834423049b319fde41ff305b48de67d2d51.tar.gz
rockbox-35502834423049b319fde41ff305b48de67d2d51.zip
Add open_plugin to core
open_plugin allows arbitrary plugins to be called in hotkey and start screen replaces PictureFlow Integration shortcuts menu plays plugins now too rather than store paths and parameters in the settings that reside in memory instead entries in a file are searched by hash. after all, the plugin has to be loaded from disk anyways ---------------------------------------------------------------------------- shortcut_viewer.rock-- can now call plugins rather than taking you to them in the browser ----------------------------------------------------------------------------- Added a new option to menus: F_CB_ON_SELECT_ONLY instead of option callback every time a item is accessed F_CB_ON_SELECT_ONLY fires callback only when item is selected ----------------------------------------------------------------------------- Added manual entries ----------------------------------------------------------------------------- Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a
Diffstat (limited to 'apps/filetree.c')
-rw-r--r--apps/filetree.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index d645b7225c..cfa14f86b5 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -357,7 +357,8 @@ int ft_load(struct tree_context* c, const char* tempdir)
357 (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) || 357 (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) ||
358 (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) || 358 (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) ||
359 (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK && 359 (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK &&
360 (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA) || 360 (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA &&
361 (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_OPX) ||
361 (callback_show_item && !callback_show_item(entry->d_name, dptr->attr, c))) 362 (callback_show_item && !callback_show_item(entry->d_name, dptr->attr, c)))
362 { 363 {
363 continue; 364 continue;
@@ -625,6 +626,7 @@ int ft_enter(struct tree_context* c)
625 /* plugin file */ 626 /* plugin file */
626 case FILE_ATTR_ROCK: 627 case FILE_ATTR_ROCK:
627 case FILE_ATTR_LUA: 628 case FILE_ATTR_LUA:
629 case FILE_ATTR_OPX:
628 { 630 {
629 char *plugin = buf, *argument = NULL, lua_path[MAX_PATH]; 631 char *plugin = buf, *argument = NULL, lua_path[MAX_PATH];
630 int ret; 632 int ret;
@@ -634,6 +636,11 @@ int ft_enter(struct tree_context* c)
634 plugin = lua_path; 636 plugin = lua_path;
635 argument = buf; 637 argument = buf;
636 } 638 }
639 else if ((file_attr & FILE_ATTR_MASK) == FILE_ATTR_OPX) {
640 snprintf(lua_path, sizeof(lua_path)-1, "%s/open_plugins.rock", VIEWERS_DIR); /* Use a #define here ? */
641 plugin = lua_path;
642 argument = buf;
643 }
637 644
638 if (global_settings.party_mode && audio_status()) { 645 if (global_settings.party_mode && audio_status()) {
639 splash(HZ, ID2P(LANG_PARTY_MODE)); 646 splash(HZ, ID2P(LANG_PARTY_MODE));
@@ -645,6 +652,9 @@ int ft_enter(struct tree_context* c)
645 case PLUGIN_GOTO_WPS: 652 case PLUGIN_GOTO_WPS:
646 play = true; 653 play = true;
647 break; 654 break;
655 case PLUGIN_GOTO_PLUGIN:
656 rc = GO_TO_PLUGIN;
657 break;
648 case PLUGIN_USB_CONNECTED: 658 case PLUGIN_USB_CONNECTED:
649 if(*c->dirfilter > NUM_FILTER_MODES) 659 if(*c->dirfilter > NUM_FILTER_MODES)
650 /* leave sub-browsers after usb, doing 660 /* leave sub-browsers after usb, doing
@@ -690,6 +700,9 @@ int ft_enter(struct tree_context* c)
690 case PLUGIN_USB_CONNECTED: 700 case PLUGIN_USB_CONNECTED:
691 rc = GO_TO_FILEBROWSER; 701 rc = GO_TO_FILEBROWSER;
692 break; 702 break;
703 case PLUGIN_GOTO_PLUGIN:
704 rc = GO_TO_PLUGIN;
705 break;
693 case PLUGIN_GOTO_WPS: 706 case PLUGIN_GOTO_WPS:
694 rc = GO_TO_WPS; 707 rc = GO_TO_WPS;
695 break; 708 break;