2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
koreader/plugins/hello.koplugin/main.lua
Hzj_jie c662ca4cc8 Load plugins also in FileManager (#2426)
added is_doc_only plugin attribute
2016-12-19 23:19:54 -08:00

28 lines
706 B
Lua

local InfoMessage = require("ui/widget/infomessage")
local UIManager = require("ui/uimanager")
local WidgetContainer = require("ui/widget/container/widgetcontainer")
local _ = require("gettext")
local Hello = WidgetContainer:new{
name = 'Hello',
is_doc_only = false,
disabled = true, -- This is a debug plugin
}
function Hello:init()
self.ui.menu:registerToMainMenu(self)
end
function Hello:addToMainMenu(tab_item_table)
table.insert(tab_item_table.plugins, {
text = _("Hello World"),
callback_func = function()
UIManager:show(InfoMessage:new{
text = _("Hello, docless plugin world"),
})
end,
})
end
return Hello