From e471fe4115fb727e8bb0f43f15f8367e7054ce79 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 25 May 2026 15:04:22 -0400 Subject: [PATCH] [FixRed] Tree Hotkey on devices without HAVE_HOTKEY Change-Id: I36f2fd8fc5edb2ac019a176cb9d3a3d014f1970d --- apps/onplay.c | 10 ++++++++-- apps/onplay.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index 19d8597a90..2f19c9505e 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -1617,9 +1617,10 @@ int hotkey_run_menu(intptr_t flag, bool execute, int current_action) struct hk_menu_data data = {hk_menu, execute ? 1 : 0}; char *title = str(LANG_ONPLAY_MENU_TITLE); +#ifdef HAVE_HOTKEY if (flag & HOTKEY_FLAG_TREE) title = str(LANG_HOTKEY_FILE_BROWSER); - +#endif struct simplelist_info info; int selected = 0; int count = 0; @@ -1798,12 +1799,14 @@ static int hotkey_menu_do_setting(void *param, int *setting, int flag) int wps_context_menu_do_setting(void *param) { return hotkey_menu_do_setting(param, &global_settings.context_wps, HOTKEY_FLAG_WPS); -} +} +#ifdef HAVE_HOTKEY int tree_context_menu_do_setting(void *param) { return hotkey_menu_do_setting(param, &global_settings.hotkey_tree, HOTKEY_FLAG_TREE); } +#endif void wps_context_menu_load_from_cfg(void* setting, char *value) { @@ -1837,8 +1840,11 @@ char* wps_context_menu_write_to_cfg(void* setting, char*buf, int buf_len) { int var = *(int*)setting; int items = HK_CTX_ITEMS; + +#ifdef HAVE_HOTKEY if (setting == &global_settings.hotkey_tree) items = 1; +#endif unsigned int written; char *buffer = buf; diff --git a/apps/onplay.h b/apps/onplay.h index b268266488..37d1382289 100644 --- a/apps/onplay.h +++ b/apps/onplay.h @@ -95,7 +95,9 @@ void onplay_show_playlist_cat_menu(const char* track_name, int attr, void onplay_show_playlist_menu(const char* path, int attr, void (*playlist_insert_cb)); int wps_context_menu_do_setting(void *param); +#ifdef HAVE_HOTKEY int tree_context_menu_do_setting(void *param); +#endif void wps_context_menu_set_default(void* setting, void* defaultval); char* wps_context_menu_write_to_cfg(void* setting, char*buf, int buf_len); void wps_context_menu_load_from_cfg(void* setting, char *value);