ReaderGesture: cleanup (#6292)

convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
This commit is contained in:
yparitcher
2020-07-12 14:47:49 -04:00
committed by GitHub
parent f4dad2fae8
commit 70f89c4df1
26 changed files with 585 additions and 595 deletions

View File

@@ -87,7 +87,7 @@ function FileManagerMenu:initGesListener()
})
end
function FileManagerMenu:openLastDoc()
function FileManagerMenu:onOpenLastDoc()
local last_file = G_reader_settings:readSetting("lastfile")
if not last_file or lfs.attributes(last_file, "mode") ~= "file" then
local InfoMessage = require("ui/widget/infomessage")
@@ -478,7 +478,7 @@ function FileManagerMenu:setUpdateItemTable()
-- @translators Search for files by name.
text = _("Find a file"),
callback = function()
self.ui:handleEvent(Event:new("ShowFileSearch", self.ui.file_chooser.path))
self.ui:handleEvent(Event:new("ShowFileSearch"))
end
}
@@ -496,7 +496,7 @@ function FileManagerMenu:setUpdateItemTable()
return G_reader_settings:readSetting("lastfile") ~= nil
end,
callback = function()
self:openLastDoc()
self:onOpenLastDoc()
end,
hold_callback = function()
local last_file = G_reader_settings:readSetting("lastfile")
@@ -504,7 +504,7 @@ function FileManagerMenu:setUpdateItemTable()
text = T(_("Would you like to open the last document: %1?"), BD.filepath(last_file)),
ok_text = _("OK"),
ok_callback = function()
self:openLastDoc()
self:onOpenLastDoc()
end,
})
end