From 35502834423049b319fde41ff305b48de67d2d51 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 31 Jul 2020 22:45:10 -0400 Subject: 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 --- apps/gui/option_select.c | 7 ++++++- apps/gui/wps.c | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index ec8b474191..ff257a4925 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -467,6 +467,8 @@ bool option_screen(const struct settings_list *setting, int oldvalue, nb_items = 0, selected = 0, temp_var; int *variable; bool allow_wrap = setting->flags & F_NO_WRAP ? false : true; + bool cb_on_select_only = + ((setting->flags & F_CB_ON_SELECT_ONLY) == F_CB_ON_SELECT_ONLY); int var_type = setting->flags&F_T_MASK; void (*function)(int) = NULL; char *title; @@ -554,12 +556,15 @@ bool option_screen(const struct settings_list *setting, } settings_save(); done = true; + if (cb_on_select_only && function) + function(*variable); } else if(default_event_handler(action) == SYS_USB_CONNECTED) return true; /* callback */ - if ( function ) + if (function && !cb_on_select_only) function(*variable); + /* if the volume is changing we need to let the skins know */ if (function == sound_get_fn(SOUND_VOLUME)) global_status.last_volume_change = current_tick; diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 8d0453385b..8a51d9b810 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -687,10 +687,8 @@ long gui_wps_show(void) return GO_TO_ROOT; else if (retval == ONPLAY_PLAYLIST) return GO_TO_PLAYLIST_VIEWER; -#ifdef HAVE_PICTUREFLOW_INTEGRATION - else if (retval == ONPLAY_PICTUREFLOW) - return GO_TO_PICTUREFLOW; -#endif + else if (retval == ONPLAY_PLUGIN) + return GO_TO_PLUGIN; restore = true; } break; -- cgit v1.2.3