summaryrefslogtreecommitdiff
path: root/apps/plugins/pictureflow/pictureflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pictureflow/pictureflow.c')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index ba3ae3018f..d1da10ee09 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -530,6 +530,26 @@ static void draw_progressbar(int step, int count, char *msg);
530static void draw_splashscreen(unsigned char * buf_tmp, size_t buf_tmp_size); 530static void draw_splashscreen(unsigned char * buf_tmp, size_t buf_tmp_size);
531static void free_all_slide_prio(int prio); 531static void free_all_slide_prio(int prio);
532 532
533static bool check_database(bool prompt)
534{
535 bool needwarn = true;
536 struct tagcache_stat *stat = rb->tagcache_get_stat();
537 while ( !(stat->initialized && stat->ready) )
538 {
539 if (needwarn)
540 rb->splash(0, ID2P(LANG_TAGCACHE_BUSY));
541 if (!prompt)
542 return false;
543 else if (rb->action_userabort(HZ/5))
544 return false;
545
546 needwarn = false;
547 stat = rb->tagcache_get_stat();
548 rb->yield();
549 }
550 return true;
551}
552
533static bool confirm_quit(void) 553static bool confirm_quit(void)
534{ 554{
535 const struct text_message prompt = 555 const struct text_message prompt =
@@ -3821,6 +3841,17 @@ enum plugin_status plugin_start(const void *parameter)
3821 3841
3822 void * buf; 3842 void * buf;
3823 size_t buf_size; 3843 size_t buf_size;
3844 bool prompt = (parameter && ((char *) parameter)[0] == ACTIVITY_MAINMENU);
3845
3846 if (!check_database(prompt))
3847 {
3848 if (prompt)
3849 return PLUGIN_OK;
3850 else
3851 error_wait("Please enable database");
3852
3853 return PLUGIN_ERROR;
3854 }
3824 3855
3825 atexit(cleanup); 3856 atexit(cleanup);
3826 3857