Kobo: Warn on restart if the startup script is outdated (#6916)

* Warn on restart if the startup script has been updated, because a restart will not reload it.

* Also warn right after the update if it contained a startup script update...
This commit is contained in:
NiLuJe
2020-11-28 22:48:09 +01:00
committed by GitHub
parent b9a59f3930
commit 931f01ef26
5 changed files with 47 additions and 2 deletions

View File

@@ -259,8 +259,21 @@ dbg:guard(ReaderMenu, 'setUpdateItemTable',
end
end)
function ReaderMenu:exitOrRestart(callback)
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{
text = _("KOReader's startup script has been updated. You'll need to completely exit KOReader to finalize the update."),
ok_text = _("Restart anyway"),
ok_callback = function()
self:exitOrRestart(callback, true)
end,
})
return
end
UIManager:nextTick(function()
self.ui:onClose()
if callback ~= nil then