mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[chore] Fix a few luacheck errors (#8461)
This commit is contained in:
@@ -6,51 +6,51 @@ local _ = require("gettext")
|
||||
local exit_settings = {}
|
||||
|
||||
exit_settings.exit_menu = {
|
||||
text = _("Exit"),
|
||||
-- submenu entries will be appended by xyz_menu_order_lua
|
||||
text = _("Exit"),
|
||||
-- submenu entries will be appended by xyz_menu_order_lua
|
||||
}
|
||||
exit_settings.exit = {
|
||||
text = _("Exit"),
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Exit"))
|
||||
end,
|
||||
text = _("Exit"),
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Exit"))
|
||||
end,
|
||||
}
|
||||
exit_settings.restart_koreader = {
|
||||
text = _("Restart KOReader"),
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Restart"))
|
||||
end,
|
||||
text = _("Restart KOReader"),
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Restart"))
|
||||
end,
|
||||
}
|
||||
if not Device:canRestart() then
|
||||
exit_settings.exit_menu = exit_settings.exit
|
||||
exit_settings.exit = nil
|
||||
exit_settings.restart_koreader = nil
|
||||
exit_settings.exit_menu = exit_settings.exit
|
||||
exit_settings.exit = nil
|
||||
exit_settings.restart_koreader = nil
|
||||
end
|
||||
if Device:canSuspend() then
|
||||
exit_settings.sleep = {
|
||||
text = _("Sleep"),
|
||||
callback = function()
|
||||
UIManager:suspend()
|
||||
end,
|
||||
}
|
||||
exit_settings.sleep = {
|
||||
text = _("Sleep"),
|
||||
callback = function()
|
||||
UIManager:suspend()
|
||||
end,
|
||||
}
|
||||
end
|
||||
if Device:canReboot() then
|
||||
exit_settings.reboot = {
|
||||
text = _("Reboot the device"),
|
||||
keep_menu_open = true,
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Reboot"))
|
||||
end
|
||||
}
|
||||
exit_settings.reboot = {
|
||||
text = _("Reboot the device"),
|
||||
keep_menu_open = true,
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("Reboot"))
|
||||
end
|
||||
}
|
||||
end
|
||||
if Device:canPowerOff() then
|
||||
exit_settings.poweroff = {
|
||||
text = _("Power off"),
|
||||
keep_menu_open = true,
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("PowerOff"))
|
||||
end
|
||||
}
|
||||
exit_settings.poweroff = {
|
||||
text = _("Power off"),
|
||||
keep_menu_open = true,
|
||||
callback = function()
|
||||
UIManager:broadcastEvent(Event:new("PowerOff"))
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
return exit_settings
|
||||
|
||||
Reference in New Issue
Block a user