mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
readermenu: move book status to info tab & minor cleanup
This commit is contained in:
@@ -20,23 +20,21 @@ function ReaderStatus:init()
|
||||
if self.ui.document.is_djvu or self.ui.document.is_pic then
|
||||
self.enabled = false
|
||||
return
|
||||
end
|
||||
-- register event listener if enabled
|
||||
self.onEndOfBook = function()
|
||||
self:showStatus()
|
||||
end
|
||||
self.total_pages = self.document:getPageCount()
|
||||
self.ui:registerPostInitCallback(function()
|
||||
else
|
||||
self.total_pages = self.document:getPageCount()
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
end)
|
||||
-- register event listener if enabled
|
||||
self.onEndOfBook = function()
|
||||
self:showStatus()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderStatus:addToMainMenu(tab_item_table)
|
||||
table.insert(tab_item_table.typeset, {
|
||||
text = _("Status"),
|
||||
table.insert(tab_item_table.info, {
|
||||
text = _("Book status"),
|
||||
callback = function()
|
||||
self:showStatus()
|
||||
UIManager:setDirty("all")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -171,12 +171,6 @@ function ReaderUI:init()
|
||||
view = self.view,
|
||||
ui = self
|
||||
}, true)
|
||||
-- history view
|
||||
self:registerModule("history", FileManagerHistory:new{
|
||||
dialog = self.dialog,
|
||||
menu = self.menu,
|
||||
ui = self,
|
||||
})
|
||||
-- frontlight controller
|
||||
if Device:hasFrontlight() then
|
||||
self:registerModule("frontlight", ReaderFrontLight:new{
|
||||
@@ -297,13 +291,17 @@ function ReaderUI:init()
|
||||
view = self.view,
|
||||
ui = self
|
||||
})
|
||||
|
||||
-- book status
|
||||
self:registerModule("status", ReaderStatus:new{
|
||||
ui = self,
|
||||
document = self.document,
|
||||
view = self.view,
|
||||
})
|
||||
|
||||
-- history view
|
||||
self:registerModule("history", FileManagerHistory:new{
|
||||
dialog = self.dialog,
|
||||
ui = self,
|
||||
})
|
||||
-- koreader plugins
|
||||
for _,plugin_module in ipairs(PluginLoader:loadPlugins()) do
|
||||
DEBUG("Loaded plugin", plugin_module.name, "at", plugin_module.path)
|
||||
|
||||
@@ -516,7 +516,6 @@ function BookStatusWidget:getStatisticsSettings()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function BookStatusWidget:onSwitchFocus(inputbox)
|
||||
self.note_dialog = InputDialog:new{
|
||||
title = "Note",
|
||||
|
||||
@@ -100,7 +100,7 @@ function InputText:initTextBox(text)
|
||||
text_widget,
|
||||
}
|
||||
self.dimen = self[1]:getSize()
|
||||
|
||||
-- FIXME: self.parent is not always in the widget statck (BookStatusWidget)
|
||||
UIManager:setDirty(self.parent, function()
|
||||
return "ui", self[1].dimen
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user