mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Make the powered off state customizable
This changes the behavior of the powered off transition phase for the
Kobo devices: instead of displaying a confirmation dialog, a screensaver
is used after a 2 seconds press delay.
Users can specify separate directories/files/messages for the powered
off and sleeping states through the `path` and `message` attributes of
the `{poweroff,suspend}_screensaver` settings.
Fixes #2327 and closes #2306.
This commit is contained in:
committed by
Qingping Hou
parent
2599c39d42
commit
64bc5cd63c
@@ -1,5 +1,6 @@
|
||||
local Event = require("ui/event")
|
||||
local DEBUG = require("dbg")
|
||||
local _ = require("gettext")
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
@@ -137,7 +138,7 @@ function Device:onPowerEvent(ev)
|
||||
-- always suspend in portrait mode
|
||||
self.orig_rotation_mode = self.screen:getRotationMode()
|
||||
self.screen:setRotationMode(0)
|
||||
require("ui/screensaver"):show()
|
||||
require("ui/screensaver"):show("suspend", _("Sleeping"))
|
||||
self.screen:refreshFull()
|
||||
self.screen_saver_mode = true
|
||||
UIManager:scheduleIn(self.suspend_wait_timeout, self.suspend)
|
||||
|
||||
Reference in New Issue
Block a user