diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 5b3555599..1729eac3f 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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, }) diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index d0fc949a6..d48af20c7 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -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…"))