Cervantes: Add back to stock reader (#5316)

pull/5309/head
Martín Fernández 5 years ago committed by Frans de Jonge
parent ae50569055
commit cb2a3d9e72

@ -11,6 +11,19 @@ local T = require("ffi/util").template
local common_settings = {}
if Device:isCervantes() then
local util = require("util")
if util.pathExists("/usr/bin/restart.sh") then
common_settings.start_bq = {
text = T(_("Start %1 reader app"), "BQ"),
callback = function()
UIManager:quit()
UIManager._exit_code = 87
end,
}
end
end
if Device:hasFrontlight() then
local ReaderFrontLight = require("apps/reader/modules/readerfrontlight")
common_settings.frontlight = {

@ -149,6 +149,7 @@ local order = {
"poweroff", -- if Device:isKobo()
"reboot", -- if Device:isKobo()
"----------------------------",
"start_bq",
"exit",
}
}

@ -172,6 +172,7 @@ local order = {
"poweroff", -- if Device:isKobo()
"reboot", -- if Device:isKobo()
"----------------------------",
"start_bq",
"exit",
}
}

@ -73,7 +73,7 @@ fi
# check if QBookApp was started before us, then
# restart the application after leaving KOReader
export STANDALONE="true"
if pkill -0 QBookpp; then
if pkill -0 QBookApp; then
STANDALONE="false"
fi
@ -86,6 +86,7 @@ fi
# any number lower than that will exit this script.
RESTART_KOREADER=85
ENTER_USBMS=86
ENTER_QBOOKAPP=87
RETURN_VALUE="${RESTART_KOREADER}"
# Loop forever until KOReader requests a normal exit.
@ -105,6 +106,19 @@ while [ "${RETURN_VALUE}" -ge "${RESTART_KOREADER}" ]; do
safemode storage --force 2>/dev/null
# waiting forever for home button events.
elif [ "${RETURN_VALUE}" -eq "${ENTER_QBOOKAPP}" ]; then
# iface is down and wpa killed. Start connman
[ -x /etc/init.d/connman ] && /etc/init.d/connman start
# (re)start the reading application in the background
restart.sh >/dev/null 2>&1
sleep 2
# loop while BQ app is running.
while pkill -0 QBookApp; do
sleep 10
done
fi
done

Loading…
Cancel
Save