2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/frontend/ui/elements/common_info_menu_table.lua
NiLuJe e402c9d6f3
More KoboUSBMS related tweaks & cleanups (#6590)
* Be even more defensive around KoboUSBMS handling in the startup script

And add some more logging. To the log before a session, to the syslog
after, because we can't be sure onboard is viable.

* Display a short version string straight in the Version label

* Move system statistics inside the Help menu

* Move Version inside Help


* Bump base

https://github.com/koreader/koreader-base/pull/1173
2020-08-29 05:20:28 +02:00

93 lines
2.5 KiB
Lua

local BD = require("ui/bidi")
local Device = require("device")
local Event = require("ui/event")
local InfoMessage = require("ui/widget/infomessage")
local UIManager = require("ui/uimanager")
local Version = require("version")
local _ = require("gettext")
local T = require("ffi/util").template
local common_info = {}
if Device:hasOTAUpdates() then
local OTAManager = require("ui/otamanager")
common_info.ota_update = OTAManager:getOTAMenuTable()
end
common_info.version = {
text = T(_("Version: %1"), Version:getShortVersion()),
keep_menu_open = true,
callback = function()
UIManager:show(InfoMessage:new{
text = Version:getCurrentRevision(),
})
end
}
common_info.help = {
text = _("Help"),
}
common_info.more_tools = {
text = _("More tools"),
}
common_info.device = {
text = _("Device"),
}
common_info.quickstart_guide = {
text = _("Quickstart guide"),
callback = function()
local QuickStart = require("ui/quickstart")
local ReaderUI = require("apps/reader/readerui")
ReaderUI:showReader(QuickStart:getQuickStart())
end
}
common_info.about = {
text = _("About"),
keep_menu_open = true,
callback = function()
UIManager:show(InfoMessage:new{
text = T(_("KOReader %1\n\nA document viewer for E Ink devices.\n\nLicensed under Affero GPL v3. All dependencies are free software.\n\nhttp://koreader.rocks/"), BD.ltr(Version:getCurrentRevision())),
icon_file = "resources/ko-icon.png",
alpha = true,
})
end
}
common_info.report_bug = {
text = _("Report a bug"),
keep_menu_open = true,
callback = function()
UIManager:show(InfoMessage:new{
text = T(_("Please report bugs to \nhttps://github.com/koreader/koreader/issues\n\nVersion:\n%1\n\nDetected device:\n%2"),
Version:getCurrentRevision(), Device:info()),
})
end
}
if Device:canSuspend() then
common_info.sleep = {
text = _("Sleep"),
callback = function()
UIManager:suspend()
end,
}
end
if Device:canReboot() then
common_info.reboot = {
text = _("Reboot the device"),
keep_menu_open = true,
callback = function()
UIManager:broadcastEvent(Event:new("Reboot"))
end
}
end
if Device:canPowerOff() then
common_info.poweroff = {
text = _("Power off"),
keep_menu_open = true,
callback = function()
UIManager:broadcastEvent(Event:new("PowerOff"))
end
}
end
return common_info