2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
koreader/plugins/hello.koplugin/main.lua
Qingping Hou 1461574894 Support configurable extra plugin lookup path (#2693)
* plugin loader(feat): support loading plugins from user defined directories
Extra plugin lookup paths can be set in global reader setting via key
`extra_plugin_paths`. Value of the key can either be a string or an array
of strings.
* build(fix): also purge non-exist plugins on build
* plugin: migrate debug plugin to menu sorter
2017-04-06 11:12:35 +02:00

32 lines
768 B
Lua

-- This is a debug plugin, remove the following if block to enable it
if true then
return { disabled = true, }
end
local InfoMessage = require("ui/widget/infomessage") -- luacheck:ignore
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,
}
function Hello:init()
self.ui.menu:registerToMainMenu(self)
end
function Hello:addToMainMenu(menu_items)
menu_items.hello_world = {
text = _("Hello World"),
callback = function()
UIManager:show(InfoMessage:new{
text = _("Hello, plugin world"),
})
end,
}
end
return Hello