summaryrefslogtreecommitdiff
path: root/apps/gui/option_select.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/gui/option_select.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/gui/option_select.c')
-rw-r--r--apps/gui/option_select.c7
1 files changed, 6 insertions, 1 deletions
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,
467 int oldvalue, nb_items = 0, selected = 0, temp_var; 467 int oldvalue, nb_items = 0, selected = 0, temp_var;
468 int *variable; 468 int *variable;
469 bool allow_wrap = setting->flags & F_NO_WRAP ? false : true; 469 bool allow_wrap = setting->flags & F_NO_WRAP ? false : true;
470 bool cb_on_select_only =
471 ((setting->flags & F_CB_ON_SELECT_ONLY) == F_CB_ON_SELECT_ONLY);
470 int var_type = setting->flags&F_T_MASK; 472 int var_type = setting->flags&F_T_MASK;
471 void (*function)(int) = NULL; 473 void (*function)(int) = NULL;
472 char *title; 474 char *title;
@@ -554,12 +556,15 @@ bool option_screen(const struct settings_list *setting,
554 } 556 }
555 settings_save(); 557 settings_save();
556 done = true; 558 done = true;
559 if (cb_on_select_only && function)
560 function(*variable);
557 } 561 }
558 else if(default_event_handler(action) == SYS_USB_CONNECTED) 562 else if(default_event_handler(action) == SYS_USB_CONNECTED)
559 return true; 563 return true;
560 /* callback */ 564 /* callback */
561 if ( function ) 565 if (function && !cb_on_select_only)
562 function(*variable); 566 function(*variable);
567
563 /* if the volume is changing we need to let the skins know */ 568 /* if the volume is changing we need to let the skins know */
564 if (function == sound_get_fn(SOUND_VOLUME)) 569 if (function == sound_get_fn(SOUND_VOLUME))
565 global_status.last_volume_change = current_tick; 570 global_status.last_volume_change = current_tick;