From 2731144094c8ba324a2936a1f8969d52d3a18713 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 29 Oct 2021 23:11:15 -0400 Subject: exit file browser before running plugins now that the plugin browser is resumable exit it before running plugins this causes a problem with the open plugin shortcuts that call other plugins but its now handled in count limited loop so plugins can run plugins in a chain and overall with less overhead too.. the problem remaining -- the plugin exits on USB, returns to ROOT the browser resumes the directory next time you select plugins making for an unwanted auto return Change-Id: If401f698207cbae824e95d69a378f13456a5dee4 --- apps/filetree.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/filetree.c') diff --git a/apps/filetree.c b/apps/filetree.c index efe5e80a0f..75a32a9e42 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -435,7 +435,7 @@ static void ft_load_font(char *file) int ft_enter(struct tree_context* c) { int rc = GO_TO_PREVIOUS; - static char buf[MAX_PATH]; + char buf[MAX_PATH]; struct entry* file = tree_get_entry_at(c, c->selected_item); if (!file) @@ -641,6 +641,8 @@ int ft_enter(struct tree_context* c) splash(HZ, ID2P(LANG_PARTY_MODE)); break; } + +#ifdef PLUGINS_RUN_IN_BROWSER /* Stay in the filetree to run a plugin */ switch (plugin_load(plugin, argument)) { case PLUGIN_GOTO_WPS: @@ -664,6 +666,10 @@ int ft_enter(struct tree_context* c) default: break; } +#else /* Exit the filetree to run a plugin */ + plugin_open(plugin, argument); + rc = GO_TO_PLUGIN; +#endif break; } @@ -687,6 +693,7 @@ int ft_enter(struct tree_context* c) plugin = filetype_get_plugin(file, plugin_path, sizeof(plugin_path)); if (plugin) { +#ifdef PLUGINS_RUN_IN_BROWSER /* Stay in the filetree to run a plugin */ switch (plugin_load(plugin, argument)) { case PLUGIN_USB_CONNECTED: @@ -705,6 +712,10 @@ int ft_enter(struct tree_context* c) default: break; } +#else /* Exit the filetree to run a plugin */ + plugin_open(plugin, argument); + rc = GO_TO_PLUGIN; +#endif } break; } -- cgit v1.2.3