Reader: add open next file in folder to Dispatcher (#9916)

Closes https://www.mobileread.com/forums/showthread.php?t=350683.
reviewable/pr9921/r1
hius07 1 year ago committed by GitHub
parent be42cac98e
commit 7719ad04f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

@ -109,6 +109,7 @@ local settingsList = {
folder_shortcuts = {category="none", event="ShowFolderShortcutsDialog", title=_("Folder shortcuts"), filemanager=true, separator=true},
-- reader settings
open_next_document_in_folder = {category="none", event="OpenNextDocumentInFolder", title=_("Open next document in folder"), reader=true, separator=true},
toggle_status_bar = {category="none", event="TapFooter", title=_("Toggle status bar"), reader=true, separator=true},
prev_chapter = {category="none", event="GotoPrevChapter", title=_("Previous chapter"), reader=true},
next_chapter = {category="none", event="GotoNextChapter", title=_("Next chapter"), reader=true},
@ -282,6 +283,8 @@ local dispatcher_menu_order = {
"folder_shortcuts",
-- reader
"open_next_document_in_folder",
"show_config_menu",
"toggle_status_bar",

Loading…
Cancel
Save