From 885d70d868dfcdaa462eb3187462aeddc44a7e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jo=C5=84ski?= Date: Mon, 11 Oct 2021 14:38:56 +0200 Subject: [PATCH] [BH-989] Unify alarm will ring message Unify alarm will ring message --- .../application-bell-alarm/windows/BellAlarmSetWindow.cpp | 2 +- .../application-bell-main/presenters/StateController.cpp | 2 +- .../BellHybrid/apps/common/include/common/TimeUtils.hpp | 1 + products/BellHybrid/apps/common/src/TimeUtils.cpp | 7 +++++++ .../apps/common/src/popups/AlarmActivatedWindow.cpp | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/products/BellHybrid/apps/application-bell-alarm/windows/BellAlarmSetWindow.cpp b/products/BellHybrid/apps/application-bell-alarm/windows/BellAlarmSetWindow.cpp index 23005ddc0beffa79c5d21a5092187eafa2d33262..e598c226d07127fb647d42d42df19aa8275fac1f 100644 --- a/products/BellHybrid/apps/application-bell-alarm/windows/BellAlarmSetWindow.cpp +++ b/products/BellHybrid/apps/application-bell-alarm/windows/BellAlarmSetWindow.cpp @@ -51,7 +51,7 @@ namespace gui if (presenter->isAlarmActive()) { icon->image->set("big_alarm_W_G"); icon->text->setRichText(utils::time::getBottomDescription( - utils::time::calculateTimeDifference(presenter->getAlarmTime(), utils::time::getCurrentTime()))); + utils::time::calculateMinutesDifference(presenter->getAlarmTime(), utils::time::getCurrentTime()))); } else { icon->image->set("big_no-alarm_W_G"); diff --git a/products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp b/products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp index 21ea43acec274743b0a94dfd4dc2a46ebcf1b5d0..cda0f4dd30e399c2828771c1537a30595e645c49 100644 --- a/products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp +++ b/products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp @@ -177,7 +177,7 @@ namespace app::home_screen alarmModel.activate(true); presenter.spawnTimer(); view.setBottomDescription(utils::time::getBottomDescription( - utils::time::calculateTimeDifference(view.getAlarmTime(), timeModel.getCurrentTime()))); + utils::time::calculateMinutesDifference(view.getAlarmTime(), timeModel.getCurrentTime()))); view.setAlarmActive(true); view.setAlarmVisible(true); }; diff --git a/products/BellHybrid/apps/common/include/common/TimeUtils.hpp b/products/BellHybrid/apps/common/include/common/TimeUtils.hpp index b6560a0cbcce70745db205e99f0913352218099d..66d0884c1031217e79c6e7fab0e57f327765ac47 100644 --- a/products/BellHybrid/apps/common/include/common/TimeUtils.hpp +++ b/products/BellHybrid/apps/common/include/common/TimeUtils.hpp @@ -11,5 +11,6 @@ namespace utils::time { std::time_t getCurrentTime(); std::time_t calculateTimeDifference(std::time_t alarmTime, std::time_t currentTime); + std::time_t calculateMinutesDifference(std::time_t alarmTime, std::time_t currentTime); UTF8 getBottomDescription(std::time_t timestamp); } // namespace utils::time diff --git a/products/BellHybrid/apps/common/src/TimeUtils.cpp b/products/BellHybrid/apps/common/src/TimeUtils.cpp index c87b79927a94c84dd7c01944edb79e94a7c02f2a..b5f2d6612ba17fadc768d511543df8baa4e7f8e2 100644 --- a/products/BellHybrid/apps/common/src/TimeUtils.cpp +++ b/products/BellHybrid/apps/common/src/TimeUtils.cpp @@ -4,6 +4,7 @@ #include #include