mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Clear UI leftovers before doing an OTA-install, add unmovable to InfoMessage and ConfirmBox (#11412)
This commit is contained in:
@@ -415,6 +415,15 @@ function Device:install()
|
||||
end
|
||||
UIManager:broadcastEvent(Event:new("Exit", save_quit))
|
||||
end,
|
||||
cancel_text = _("Later"),
|
||||
cancel_callback = function()
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = _("The update will be applied the next time KOReader is started."),
|
||||
unmovable = true,
|
||||
})
|
||||
end,
|
||||
unmovable = true,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ function ConfirmBox:init()
|
||||
}
|
||||
self.movable = MovableContainer:new{
|
||||
frame,
|
||||
unmovable = self.unmovable,
|
||||
}
|
||||
self[1] = CenterContainer:new{
|
||||
dimen = Screen:getSize(),
|
||||
|
||||
@@ -36,6 +36,10 @@ local MovableContainer = InputContainer:extend{
|
||||
-- Events to ignore (ie: ignore_events={"hold", "hold_release"})
|
||||
ignore_events = nil,
|
||||
|
||||
-- This can be passed if a MovableContainer should be present (as a no-op),
|
||||
-- so we don't need to change the widget layout.
|
||||
unmovable = nil,
|
||||
|
||||
-- Initial position can be set related to an existing widget
|
||||
-- 'anchor' should be a Geom object (a widget's 'dimen', or a point), and
|
||||
-- can be a function returning that object
|
||||
@@ -59,7 +63,7 @@ local MovableContainer = InputContainer:extend{
|
||||
}
|
||||
|
||||
function MovableContainer:init()
|
||||
if Device:isTouchDevice() then
|
||||
if Device:isTouchDevice() and not self.unmovable then
|
||||
local range = Geom:new{
|
||||
x = 0, y = 0,
|
||||
w = Screen:getWidth(),
|
||||
|
||||
@@ -169,6 +169,7 @@ function InfoMessage:init()
|
||||
}
|
||||
self.movable = MovableContainer:new{
|
||||
frame,
|
||||
unmovable = self.unmovable,
|
||||
}
|
||||
self[1] = CenterContainer:new{
|
||||
dimen = Screen:getSize(),
|
||||
|
||||
@@ -92,6 +92,8 @@ ko_update_check() {
|
||||
NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar"
|
||||
INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar"
|
||||
if [ -f "${NEWUPDATE}" ]; then
|
||||
# Clear screen to delete UI leftovers
|
||||
./fbink --cls
|
||||
./fbink -q -y -7 -pmh "Updating KOReader"
|
||||
# Setup the FBInk daemon
|
||||
export FBINK_NAMED_PIPE="/tmp/koreader.fbink"
|
||||
|
||||
Reference in New Issue
Block a user