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/plugins/pictureflow/pictureflow.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'apps/plugins/pictureflow/pictureflow.c') diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index d1da10ee09..91062f8f11 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -533,19 +533,28 @@ static void free_all_slide_prio(int prio); static bool check_database(bool prompt) { bool needwarn = true; + int spin = 5; + struct tagcache_stat *stat = rb->tagcache_get_stat(); + while ( !(stat->initialized && stat->ready) ) { - if (needwarn) + if (--spin > 0) + { + rb->sleep(HZ/5); + } + else if (needwarn) + { + needwarn = false; rb->splash(0, ID2P(LANG_TAGCACHE_BUSY)); - if (!prompt) + } + else if (!prompt) return false; else if (rb->action_userabort(HZ/5)) return false; - needwarn = false; - stat = rb->tagcache_get_stat(); rb->yield(); + stat = rb->tagcache_get_stat(); } return true; } @@ -3841,7 +3850,7 @@ enum plugin_status plugin_start(const void *parameter) void * buf; size_t buf_size; - bool prompt = (parameter && ((char *) parameter)[0] == ACTIVITY_MAINMENU); + bool prompt = (parameter && (((char *) parameter)[0] == ACTIVITY_MAINMENU)); if (!check_database(prompt)) { -- cgit v1.2.3