infrared_scene_error_databases.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "../infrared_i.h"
  2. void infrared_scene_error_databases_on_enter(void* context) {
  3. Infrared* infrared = context;
  4. Popup* popup = infrared->popup;
  5. popup_set_icon(popup, 5, 11, &I_SDQuestion_35x43);
  6. popup_set_text(
  7. popup, "Function requires\nSD card with fresh\ndatabases.", 47, 17, AlignLeft, AlignTop);
  8. popup_set_context(popup, context);
  9. popup_set_callback(popup, infrared_popup_closed_callback);
  10. infrared_play_notification_message(infrared, InfraredNotificationMessageYellowOn);
  11. view_dispatcher_switch_to_view(infrared->view_dispatcher, InfraredViewPopup);
  12. }
  13. bool infrared_scene_error_databases_on_event(void* context, SceneManagerEvent event) {
  14. Infrared* infrared = context;
  15. bool consumed = false;
  16. if(event.type == SceneManagerEventTypeCustom) {
  17. if(event.event == InfraredCustomEventTypePopupClosed) {
  18. scene_manager_search_and_switch_to_previous_scene(
  19. infrared->scene_manager, InfraredSceneUniversal);
  20. consumed = true;
  21. }
  22. }
  23. return consumed;
  24. }
  25. void infrared_scene_error_databases_on_exit(void* context) {
  26. Infrared* infrared = context;
  27. popup_reset(infrared->popup);
  28. infrared_play_notification_message(infrared, InfraredNotificationMessageYellowOff);
  29. }