mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
filemanager: align UI plugin registration with reader
With the addition of the language support module, ReaderDictionary tries to use modules registered with the UI instance, but the FileManager doesn't provide key-based registration of its UI modules. In order to allow the same code to be used by both FileManager and Reader seamlessly, copy the :registerPlugin() method from Reader and use it with FileManager. This will ensure any other hidden assumptions about UI module registration are handled properly. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
@@ -83,8 +83,10 @@ local ReaderUI = InputContainer:new{
|
||||
}
|
||||
|
||||
function ReaderUI:registerModule(name, ui_module, always_active)
|
||||
if name then self[name] = ui_module end
|
||||
ui_module.name = "reader" .. name
|
||||
if name then
|
||||
self[name] = ui_module
|
||||
ui_module.name = "reader" .. name
|
||||
end
|
||||
table.insert(self, ui_module)
|
||||
if always_active then
|
||||
-- to get events even when hidden
|
||||
|
||||
Reference in New Issue
Block a user