mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderStatus: fix End of Document action (#13144)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
This commit is contained in:
@@ -23,14 +23,11 @@ function ReaderStatus:addToMainMenu(menu_items)
|
||||
}
|
||||
end
|
||||
|
||||
function ReaderStatus:onShowBookStatus(before_show_callback)
|
||||
function ReaderStatus:onShowBookStatus(close_callback)
|
||||
local status_page = BookStatusWidget:new{
|
||||
ui = self.ui,
|
||||
close_callback = close_callback,
|
||||
}
|
||||
if before_show_callback then
|
||||
before_show_callback()
|
||||
end
|
||||
status_page.dithered = true
|
||||
UIManager:show(status_page, "full")
|
||||
return true
|
||||
end
|
||||
@@ -157,8 +154,8 @@ function ReaderStatus:onEndOfBook()
|
||||
elseif settings == "book_status_file_browser" then
|
||||
-- Ditto
|
||||
UIManager:nextTick(function()
|
||||
local before_show_callback = function() self:openFileBrowser() end
|
||||
self:onShowBookStatus(before_show_callback)
|
||||
local book_status_close_callback = function() self:openFileBrowser() end
|
||||
self:onShowBookStatus(book_status_close_callback)
|
||||
end)
|
||||
elseif settings == "delete_file" then
|
||||
-- Ditto
|
||||
@@ -169,12 +166,9 @@ function ReaderStatus:onEndOfBook()
|
||||
end
|
||||
|
||||
function ReaderStatus:openFileBrowser()
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
local file = self.document.file
|
||||
self.ui:onClose()
|
||||
if not FileManager.instance then
|
||||
self.ui:showFileManager(file)
|
||||
end
|
||||
self.ui:showFileManager(file)
|
||||
end
|
||||
|
||||
function ReaderStatus:onOpenNextDocumentInFolder()
|
||||
|
||||
@@ -537,6 +537,9 @@ function BookStatusWidget:onClose()
|
||||
end
|
||||
-- NOTE: Flash on close to avoid ghosting, since we show an image.
|
||||
UIManager:close(self, "flashpartial")
|
||||
if self.close_callback then
|
||||
self.close_callback()
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user