From ddf700043d861b1a33e03eca7b6f53ace2e3fdc0 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 7 Oct 2017 16:19:40 +0200 Subject: [PATCH] [ReadTimer] Time from now (#3311) --- plugins/readtimer.koplugin/main.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/readtimer.koplugin/main.lua b/plugins/readtimer.koplugin/main.lua index f96d6bd1a..c9a801db1 100644 --- a/plugins/readtimer.koplugin/main.lua +++ b/plugins/readtimer.koplugin/main.lua @@ -79,15 +79,16 @@ function ReadTimer:addToMainMenu(menu_items) self.time = os.time() + seconds UIManager:scheduleIn(seconds, self.alarm_callback) UIManager:show(InfoMessage:new{ - text = T(_("Timer set at: %1:%2"), string.format("%02d", time.hour), - string.format("%02d", time.min)), - timeout = 3, + text = T(_("Timer set to: %1:%2\nIt's %3 hour(s) and %4 minute(s) from now"), + string.format("%02d", time.hour), string.format("%02d", time.min), + math.floor(seconds/3600), math.floor((seconds%3600)/60)), + timeout = 5, }) --current time or time > 18h elseif seconds == 0 or seconds >= 18*3600 then UIManager:show(InfoMessage:new{ text = _("Timer could not be set. You have selected current time or time in past"), - timeout = 3, + timeout = 5, }) end end @@ -112,7 +113,7 @@ function ReadTimer:addToMainMenu(menu_items) UIManager:scheduleIn(seconds, self.alarm_callback) UIManager:show(InfoMessage:new{ text = T(_("Timer is set to %1 hour(s) and %2 minute(s)"), time.hour, time.min), - timeout = 3, + timeout = 5, }) end end