|
|
|
@ -29,8 +29,7 @@ local PocketBook = Generic:new{
|
|
|
|
|
hasKeys = yes,
|
|
|
|
|
hasFrontlight = yes,
|
|
|
|
|
canSuspend = no,
|
|
|
|
|
hasExitOptions = no,
|
|
|
|
|
canRestart = no,
|
|
|
|
|
canPowerOff = yes,
|
|
|
|
|
needsScreenRefreshAfterResume = no,
|
|
|
|
|
home_dir = "/mnt/ext1",
|
|
|
|
|
|
|
|
|
@ -55,6 +54,20 @@ function PocketBook:blacklistCBB()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Helper to try load externally signalled book whenever we're brought to foreground
|
|
|
|
|
local function tryOpenBook()
|
|
|
|
|
local path = os.getenv("KO_PATH_OPEN_BOOK")
|
|
|
|
|
if not path then return end
|
|
|
|
|
local fi = io.open(path, "r")
|
|
|
|
|
if not fi then return end
|
|
|
|
|
local fn = fi:read("*line")
|
|
|
|
|
fi:close()
|
|
|
|
|
os.remove(path)
|
|
|
|
|
if fn and util.pathExists(fn) then
|
|
|
|
|
require("apps/reader/readerui"):showReader(fn)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function PocketBook:init()
|
|
|
|
|
-- Blacklist the C BB before the first BB require...
|
|
|
|
|
self:blacklistCBB()
|
|
|
|
@ -89,6 +102,7 @@ function PocketBook:init()
|
|
|
|
|
return "Suspend"
|
|
|
|
|
end
|
|
|
|
|
elseif ev.code == C.EVT_FOREGROUND or ev.code == C.EVT_SHOW then
|
|
|
|
|
tryOpenBook()
|
|
|
|
|
ui:setDirty('all', 'partial')
|
|
|
|
|
if quasiSuspended then
|
|
|
|
|
quasiSuspended = false
|
|
|
|
@ -210,6 +224,10 @@ function PocketBook:setAutoStandby(isAllowed)
|
|
|
|
|
inkview.iv_sleepmode(isAllowed and 1 or 0)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function PocketBook:powerOff()
|
|
|
|
|
inkview.PowerOff()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function PocketBook:initNetworkManager(NetworkMgr)
|
|
|
|
|
function NetworkMgr:turnOnWifi(complete_callback)
|
|
|
|
|
if inkview.NetConnect(nil) ~= C.NET_OK then
|
|
|
|
|