timed-remote

Flipper Zero app for sending delayed IR commands
git clone git://src.adamsgaard.dk/timed-remote # fast
git clone https://src.adamsgaard.dk/timed-remote.git # slow
Log | Files | Refs | README | LICENSE Back to index

scene_confirm.c (1088B)


      1 #include "../timed_remote.h"
      2 #include "timed_remote_scene.h"
      3 
      4 static void
      5 on_popup_done(void *context)
      6 {
      7 	TimedRemoteApp *app;
      8 
      9 	app = context;
     10 	view_dispatcher_send_custom_event(app->vd, EVENT_DONE);
     11 }
     12 
     13 void
     14 scene_done_enter(void *context)
     15 {
     16 	TimedRemoteApp *app;
     17 
     18 	app = context;
     19 	popup_reset(app->popup);
     20 	popup_set_header(app->popup, "Signal Sent!", 64, 20, AlignCenter, AlignCenter);
     21 	popup_set_text(app->popup, app->sig, 64, 35, AlignCenter, AlignCenter);
     22 	popup_set_timeout(app->popup, 2000);
     23 	popup_set_context(app->popup, app);
     24 	popup_set_callback(app->popup, on_popup_done);
     25 	popup_enable_timeout(app->popup);
     26 	view_dispatcher_switch_to_view(app->vd, VIEW_POP);
     27 }
     28 
     29 bool
     30 scene_done_event(void *context, SceneManagerEvent event)
     31 {
     32 	TimedRemoteApp *app;
     33 
     34 	app = context;
     35 	if (event.type != SceneManagerEventTypeCustom)
     36 		return false;
     37 	if (event.event != EVENT_DONE)
     38 		return false;
     39 
     40 	scene_manager_search_and_switch_to_previous_scene(app->sm, SCENE_BROWSE);
     41 	return true;
     42 }
     43 
     44 void
     45 scene_done_exit(void *context)
     46 {
     47 	TimedRemoteApp *app;
     48 
     49 	app = context;
     50 	popup_reset(app->popup);
     51 }