mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Reader: add open next file in folder to Dispatcher (#9916)
Closes https://www.mobileread.com/forums/showthread.php?t=350683.
This commit is contained in:
@@ -91,7 +91,7 @@ function ReaderStatus:onEndOfBook()
|
||||
text = _("Open next file"),
|
||||
enabled = collate,
|
||||
callback = function()
|
||||
self:openNextFile(self.document.file)
|
||||
self:onOpenNextDocumentInFolder()
|
||||
UIManager:close(choose_action)
|
||||
end,
|
||||
},
|
||||
@@ -141,7 +141,7 @@ function ReaderStatus:onEndOfBook()
|
||||
UIManager:close(info)
|
||||
-- Delay until the next tick, as this will destroy the Document instance, but we may not be the final Event caught by said Document...
|
||||
UIManager:nextTick(function()
|
||||
self:openNextFile(self.document.file)
|
||||
self:onOpenNextDocumentInFolder()
|
||||
end)
|
||||
else
|
||||
UIManager:show(InfoMessage:new{
|
||||
@@ -183,12 +183,12 @@ function ReaderStatus:openFileBrowser()
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderStatus:openNextFile(next_file)
|
||||
function ReaderStatus:onOpenNextDocumentInFolder()
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
if not FileManager.instance then
|
||||
self.ui:showFileManager()
|
||||
end
|
||||
next_file = FileManager.instance.file_chooser:getNextFile(next_file)
|
||||
local next_file = FileManager.instance.file_chooser:getNextFile(self.document.file)
|
||||
FileManager.instance:onClose()
|
||||
if next_file then
|
||||
self.ui:switchDocument(next_file)
|
||||
|
||||
Reference in New Issue
Block a user