Restart KOReader: add a ConfirmBox instead of a plain InfoMessage (#9853)

This commit is contained in:
zwim
2022-12-03 21:29:13 +01:00
committed by GitHub
parent fa9f0acf5e
commit d1cd2a1c8d
15 changed files with 67 additions and 95 deletions

View File

@@ -1552,21 +1552,30 @@ function UIManager:suspend()
end
end
function UIManager:reboot()
function UIManager:askForReboot(message_text)
-- Should always exist, as defined in `generic/device` or overwritten with `setEventHandlers`
if self.event_handlers.Reboot then
-- Give the other event handlers a chance to be executed.
-- 'Reboot' event will be sent by the handler
UIManager:nextTick(self.event_handlers.Reboot)
UIManager:nextTick(self.event_handlers.Reboot, message_text)
end
end
function UIManager:powerOff()
function UIManager:askForPowerOff(message_text)
-- Should always exist, as defined in `generic/device` or overwritten with `setEventHandlers`
if self.event_handlers.PowerOff then
-- Give the other event handlers a chance to be executed.
-- 'PowerOff' event will be sent by the handler
UIManager:nextTick(self.event_handlers.PowerOff)
UIManager:nextTick(self.event_handlers.PowerOff, message_text)
end
end
function UIManager:askForRestart(message_text)
-- Should always exist, as defined in `generic/device` or overwritten with `setEventHandlers`
if self.event_handlers.PowerOff then
-- Give the other event handlers a chance to be executed.
-- 'Restart' event will be sent by the handler
UIManager:nextTick(self.event_handlers.Restart, message_text)
end
end