rename ReaderMenu:addToMainMenuCallback to registerToMainMenu

since we are actully inserting widgets, not callbacks
pull/2/merge
Qingping Hou 12 years ago
parent 5b6558383d
commit dbd27cd600

@ -41,7 +41,7 @@ function ReaderFont:init()
}) })
face_list[k] = {text = v} face_list[k] = {text = v}
end end
self.ui.menu:addToMainMenuCallback(self) self.ui.menu:registerToMainMenu(self)
end end
function ReaderFont:onSetDimensions(dimen) function ReaderFont:onSetDimensions(dimen)

@ -107,7 +107,7 @@ end
function ReaderMenu:onCloseDocument() function ReaderMenu:onCloseDocument()
end end
function ReaderMenu:addToMainMenuCallback(widget) function ReaderMenu:registerToMainMenu(widget)
table.insert(self.registered_widgets, widget) table.insert(self.registered_widgets, widget)
end end

@ -49,6 +49,10 @@ ReaderZooming = InputContainer:new{
rotation = 0 rotation = 0
} }
function ReaderZooming:init()
self.ui.menu:registerToMainMenu(self)
end
function ReaderZooming:onReadSettings(config) function ReaderZooming:onReadSettings(config)
-- @TODO config file from old code base uses globalzoom_mode -- @TODO config file from old code base uses globalzoom_mode
-- instead of zoom_mode, we need to handle this imcompatibility -- instead of zoom_mode, we need to handle this imcompatibility

@ -67,6 +67,8 @@ function ReaderUI:init()
view = self[1], view = self[1],
ui = self ui = self
} }
self.menu = self[4] -- hold reference to menu widget
if self.document.info.has_pages then if self.document.info.has_pages then
-- for page specific controller -- for page specific controller
@ -126,9 +128,10 @@ function ReaderUI:onClose()
DEBUG("closing reader") DEBUG("closing reader")
self:handleEvent(Event:new("CloseDocument")) self:handleEvent(Event:new("CloseDocument"))
self.doc_settings:flush() self.doc_settings:flush()
if self.document then if self.document ~= nil then
self.document:close() self.document:close()
self.document = false self.document = nil
self.start_pos = nil
end end
UIManager:close(self.dialog) UIManager:close(self.dialog)
return true return true

Loading…
Cancel
Save