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 ;).
reviewable/pr11016/r1
NiLuJe 7 months ago
parent c47ce45fb8
commit fed24ba28c

@ -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…"))

Loading…
Cancel
Save