From 32edbd430d7253a2107f71cf1b4171be647867cd Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 5 Dec 2025 11:57:40 -0500 Subject: [PATCH] plugins - Add PLUGIN_GOTO_ROOT - lua add PLUGIN_GOTO_ROOT and PLUGIN_ERROR Change-Id: I018f68685877700571aa7687428cfdda436a0294 --- apps/filetree.c | 3 +++ apps/onplay.c | 2 ++ apps/plugin.h | 1 + apps/plugins/lua/rbdefines_helper.pl | 2 +- apps/root_menu.c | 4 ++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/filetree.c b/apps/filetree.c index bf32e7c1ae..95c7e2b77d 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -746,6 +746,9 @@ int ft_enter(struct tree_context* c) else rc = GO_TO_FILEBROWSER; break; + case PLUGIN_GOTO_ROOT: + rc = GO_TO_ROOT; + break; /* case PLUGIN_ERROR: case PLUGIN_OK: diff --git a/apps/onplay.c b/apps/onplay.c index e6a7f05642..5e9c72712b 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -892,6 +892,8 @@ static bool onplay_load_plugin(void *param) onplay_result = ONPLAY_PLUGIN; else if (ret == PLUGIN_GOTO_WPS) onplay_result = ONPLAY_START_PLAY; + else if (ret == PLUGIN_GOTO_ROOT) + onplay_result = ONPLAY_MAINMENU; return false; } diff --git a/apps/plugin.h b/apps/plugin.h index c4e246ebff..8c5d4599f2 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -191,6 +191,7 @@ enum plugin_status { PLUGIN_POWEROFF, PLUGIN_GOTO_WPS, PLUGIN_GOTO_PLUGIN, + PLUGIN_GOTO_ROOT, PLUGIN_ERROR = -1, }; diff --git a/apps/plugins/lua/rbdefines_helper.pl b/apps/plugins/lua/rbdefines_helper.pl index ecda99becc..75b43d0eb4 100755 --- a/apps/plugins/lua/rbdefines_helper.pl +++ b/apps/plugins/lua/rbdefines_helper.pl @@ -50,7 +50,7 @@ if ($def_type eq "rb_defines") { '^SYS_(TIMEOUT|POWEROFF|BATTERY_UPDATE)$', '^SYS_USB_(DIS|)CONNECTED$', '^HOME_DIR$', - '^PLUGIN(_OK|_USB_CONNECTED|_POWEROFF|_GOTO_WPS|_GOTO_PLUGIN)$', + '^PLUGIN(_OK|_USB_CONNECTED|_POWEROFF|_GOTO_WPS|_GOTO_PLUGIN|_GOTO_ROOT|_ERROR)$', '^PLUGIN_DIR$', '^PLUGIN(_APPS_|_GAMES_|_)DATA_DIR$', '^ROCKBOX_DIR$', diff --git a/apps/root_menu.c b/apps/root_menu.c index 419ae72708..fa2e4406c1 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -808,6 +808,10 @@ static int load_plugin_screen(char *key) } continue; } + else if (ret == PLUGIN_GOTO_ROOT) + { + ret_val = GO_TO_ROOT; + } else { ret_val = GO_TO_PREVIOUS;