From c4f1687c22e76e0273f51db0d8da2df25d9577ba Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sun, 9 Nov 2014 16:37:15 +0100 Subject: [PATCH 1/2] Remove KOBO_LIGHT_OFF_ON_SUSPEND option and move workaround to ffi/kobolight.ua --- defaults.lua | 1 - frontend/device/kobo/device.lua | 3 --- 2 files changed, 4 deletions(-) diff --git a/defaults.lua b/defaults.lua index 29259495e..c2c290808 100644 --- a/defaults.lua +++ b/defaults.lua @@ -173,7 +173,6 @@ SEARCH_SERIES = true SEARCH_PATH = true -- Light parameter for Kobo -KOBO_LIGHT_OFF_ON_SUSPEND = false KOBO_LIGHT_ON_START = -1 -- -1 or 0-100. -1 leaves light as it is, other sets light on start/wake up KOBO_SCREEN_SAVER = "" -- image or directory with pictures or "-" KOBO_SCREEN_SAVER_LAST_BOOK = true -- get screensaver from last book if possible diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 1495f0948..efd31a06d 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -108,9 +108,6 @@ function Kobo:getFirmwareVersion() end function Kobo:Suspend() - if KOBO_LIGHT_OFF_ON_SUSPEND then - self.powerd:setIntensity(0) - end os.execute("./suspend.sh") end From ca75b7a030987eb1c6dc562127c4045632019295 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sun, 9 Nov 2014 16:38:58 +0100 Subject: [PATCH 2/2] Add usage note to unschedule --- frontend/ui/uimanager.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 1a3552fb4..9291d4f66 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -232,6 +232,12 @@ function UIManager:scheduleIn(seconds, action) self:schedule(when, action) end +-- unschedule an execution task +-- in order to unschedule anonymous functions, store a reference +-- for example: +-- self.anonymousFunction = function() self:regularFunction() end +-- UIManager:scheduleIn(10, self.anonymousFunction) +-- UIManager:unschedule(self.anonymousFunction) function UIManager:unschedule(action) for i = #self._execution_stack, 1, -1 do local task = self._execution_stack[i]