mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Write highlights into PDF: revisited (#12509)
This commit is contained in:
@@ -363,8 +363,6 @@ function ReaderMenu:saveDocumentSettingsAsDefault()
|
||||
end
|
||||
|
||||
function ReaderMenu:exitOrRestart(callback, force)
|
||||
if self.menu_container then self:onTapCloseMenu() end
|
||||
|
||||
-- Only restart sets a callback, which suits us just fine for this check ;)
|
||||
if callback and not force and not Device:isStartupScriptUpToDate() then
|
||||
UIManager:show(ConfirmBox:new{
|
||||
@@ -377,36 +375,13 @@ function ReaderMenu:exitOrRestart(callback, force)
|
||||
return
|
||||
end
|
||||
|
||||
self:onTapCloseMenu()
|
||||
UIManager:nextTick(function()
|
||||
self.ui:onClose()
|
||||
if callback ~= nil then
|
||||
-- show an empty widget so that the callback always happens
|
||||
local Widget = require("ui/widget/widget")
|
||||
local widget = Widget:new{
|
||||
width = Screen:getWidth(),
|
||||
height = Screen:getHeight(),
|
||||
}
|
||||
UIManager:show(widget)
|
||||
local waiting = function(waiting)
|
||||
-- if we don't do this you can get a situation where either the
|
||||
-- program won't exit due to remaining widgets until they're
|
||||
-- dismissed or if the callback forces all widgets to close,
|
||||
-- that the save document ConfirmBox is also closed
|
||||
if self.ui and self.ui.document and self.ui.document:isEdited() then
|
||||
logger.dbg("waiting for save settings")
|
||||
UIManager:scheduleIn(1, function() waiting(waiting) end)
|
||||
else
|
||||
callback()
|
||||
UIManager:close(widget)
|
||||
end
|
||||
end
|
||||
UIManager:scheduleIn(1, function() waiting(waiting) end)
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
end)
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
if FileManager.instance then
|
||||
FileManager.instance:onClose()
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderMenu:onShowMenu(tab_index)
|
||||
|
||||
Reference in New Issue
Block a user