mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
UIManager: Always send PowerOff & Reboot events
They were only sent when said action was triggered manually. Note that this is perfectly harmless, since, currently, nothing actually responds to those events ;).
This commit is contained in:
@@ -1020,7 +1020,6 @@ function Device:_setEventHandlers(uimgr)
|
||||
text = message_text or _("Are you sure you want to reboot the device?"),
|
||||
ok_text = _("Reboot"),
|
||||
ok_callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Reboot"))
|
||||
UIManager:nextTick(UIManager.reboot_action)
|
||||
end,
|
||||
})
|
||||
@@ -1036,7 +1035,6 @@ function Device:_setEventHandlers(uimgr)
|
||||
text = message_text or _("Are you sure you want to power off the device?"),
|
||||
ok_text = _("Power off"),
|
||||
ok_callback = function()
|
||||
UIManager:broadcastEvent(Event:new("PowerOff"))
|
||||
UIManager:nextTick(UIManager.poweroff_action)
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -71,6 +71,7 @@ function UIManager:init()
|
||||
self.poweroff_action = function()
|
||||
self._entered_poweroff_stage = true
|
||||
logger.info("Powering off the device...")
|
||||
self:broadcastEvent(Event:new("PowerOff"))
|
||||
self:broadcastEvent(Event:new("Close"))
|
||||
local Screensaver = require("ui/screensaver")
|
||||
Screensaver:setup("poweroff", _("Powered off"))
|
||||
@@ -88,6 +89,7 @@ function UIManager:init()
|
||||
self.reboot_action = function()
|
||||
self._entered_poweroff_stage = true
|
||||
logger.info("Rebooting the device...")
|
||||
self:broadcastEvent(Event:new("Reboot"))
|
||||
self:broadcastEvent(Event:new("Close"))
|
||||
local Screensaver = require("ui/screensaver")
|
||||
Screensaver:setup("reboot", _("Rebooting…"))
|
||||
|
||||
Reference in New Issue
Block a user