mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
commit
cc230f0300
@ -74,7 +74,8 @@ function BasePowerD:getCapacity()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BasePowerD:refreshCapacity()
|
function BasePowerD:refreshCapacity()
|
||||||
self:getCapacityHW()
|
-- We want our next getCapacity call to actually pull up to date info instead of a cached value ;)
|
||||||
|
self.capacity_pulled_count = self.capacity_cached_count
|
||||||
end
|
end
|
||||||
|
|
||||||
function BasePowerD:isCharging()
|
function BasePowerD:isCharging()
|
||||||
|
@ -381,6 +381,8 @@ function TouchMenu:init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.bar:switchToTab(self.last_index or 1)
|
self.bar:switchToTab(self.last_index or 1)
|
||||||
|
-- Make sure we always show an up to date battery status when first opening the menu...
|
||||||
|
Device:getPowerDevice():refreshCapacity()
|
||||||
self:updateItems()
|
self:updateItems()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ if [ "${INIT_TYPE}" == "upstart" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Keep track of what we do with pillow...
|
# Keep track of what we do with pillow...
|
||||||
PILLOW_DISABLED="no"
|
PILLOW_HARD_DISABLED="no"
|
||||||
|
PILLOW_SOFT_DISABLED="no"
|
||||||
|
|
||||||
# Keep track of if we were started through KUAL
|
# Keep track of if we were started through KUAL
|
||||||
FROM_KUAL="no"
|
FROM_KUAL="no"
|
||||||
@ -177,12 +178,18 @@ fi
|
|||||||
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
||||||
count=$(lipc-get-prop -eiq com.github.koreader.kpvbooklet.timer count)
|
count=$(lipc-get-prop -eiq com.github.koreader.kpvbooklet.timer count)
|
||||||
if [ "$count" == "" -o "$count" == "0" ] ; then
|
if [ "$count" == "" -o "$count" == "0" ] ; then
|
||||||
#logmsg "Disabling pillow . . ."
|
# NOTE: We want to disable the status bar (at the very least). Unfortunately, the soft hide/unhide method doesn't work properly anymore since FW 5.6.5...
|
||||||
#lipc-set-prop com.lab126.pillow disableEnablePillow disable
|
if [ "$(printf "%.3s" $(grep '^Kindle 5' /etc/prettyversion.txt 2>&1 | sed -n -r 's/^(Kindle)([[:blank:]]*)([[:digit:].]*)(.*?)$/\3/p' | tr -d '.'))" -ge "565" ] ; then
|
||||||
|
# FIXME: So we resort to killing pillow completely on FW >= 5.6.5...
|
||||||
|
logmsg "Disabling pillow . . ."
|
||||||
|
lipc-set-prop com.lab126.pillow disableEnablePillow disable
|
||||||
|
PILLOW_HARD_DISABLED="yes"
|
||||||
|
else
|
||||||
logmsg "Hiding the status bar . . ."
|
logmsg "Hiding the status bar . . ."
|
||||||
# NOTE: One more great find from eureka (http://www.mobileread.com/forums/showpost.php?p=2454141&postcount=34)
|
# NOTE: One more great find from eureka (http://www.mobileread.com/forums/showpost.php?p=2454141&postcount=34)
|
||||||
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.hideMe();"}'
|
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.hideMe();"}'
|
||||||
PILLOW_DISABLED="yes"
|
PILLOW_SOFT_DISABLED="yes"
|
||||||
|
fi
|
||||||
if [ "${NO_SLEEP}" == "no" ] ; then
|
if [ "${NO_SLEEP}" == "no" ] ; then
|
||||||
# NOTE: Leave the framework time to refresh the screen, so we don't start before it has finished redrawing after collapsing the title bar
|
# NOTE: Leave the framework time to refresh the screen, so we don't start before it has finished redrawing after collapsing the title bar
|
||||||
usleep 250000
|
usleep 250000
|
||||||
@ -253,16 +260,16 @@ if [ "${STOP_FRAMEWORK}" == "yes" ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# display chrome bar (upstart & framework up only)
|
# Display chrome bar if need be (upstart & framework up only)
|
||||||
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
||||||
# Only if we actually killed it...
|
# Depending on the FW version, we may have handled things in two different manners...
|
||||||
if [ "${PILLOW_DISABLED}" == "yes" ] ; then
|
if [ "${PILLOW_HARD_DISABLED}" == "yes" ] ; then
|
||||||
#logmsg "Enabling pillow . . ."
|
logmsg "Enabling pillow . . ."
|
||||||
#lipc-set-prop com.lab126.pillow disableEnablePillow enable
|
lipc-set-prop com.lab126.pillow disableEnablePillow enable
|
||||||
|
fi
|
||||||
|
if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then
|
||||||
logmsg "Restoring the status bar . . ."
|
logmsg "Restoring the status bar . . ."
|
||||||
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}'
|
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}'
|
||||||
# Poke the search bar too, so that we get a proper refresh ;)
|
|
||||||
lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "search_bar", "function": "nativeBridge.hideMe(); nativeBridge.showMe();"}'
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user