* Drops support for mocking the frontlight setting internally which may
cause incorrect in-memory values.
* Adds new supported value for `KOBO_LIGHT_ON_START` (-2), which sets
'Kobo eReader.conf' as the source to update `settings.reader.lua`'s
brightness setting on startup, thus using the value from it
indirectly.
* Adds the `KOBO_SYNC_BRIGHTNESS_WITH_NICKEL` configuration variable
which updates 'Kobo eReader.conf' every time the brightness setting is
changed within koreader.
* Fixes missing call to save brightness when modifying via two-finger
swipe.
Closes#1523.
_checkTasks first get number of tasks in the stack and does a numeric
for loop to go through each task. The problem is a task might call
schedule or unschedule, which will reorder tasks in the stack. This will
invalidate many of the table indexes used in the for loop.
This patch turns the task stack into an ordered queue, so _checkTasks
only pops one item out of the queue each time instead of setting up a
for loop at the beginning. This should avoid the race condition
mentioned above.
Making sure to always show up to date info.
Also fix the battery polling cache invalidation logic to actually
work?
Should make it behave properly on devices where we handle resuming
ourselves.
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
And also probably prevent a crash when trying to enable WiFi there.
We really shouldn't even show the WiFi stuff on some of these old
devices, but at least now it doesn't crash ;).
use coroutine to support ad-hoc callback in login button so that when
the username/password is incorrect it will retry automatically
currently tested with COPS on apache
This should fix#1001.
and get rid of the ugly baseurl workaround for "Internet Archive",
actually the url building of all these catalogs is perfectly
handled with `url.absolute(base, relative)`.
Without this fix, self.dimen is shared among all inputcontainers
intances, which breaks some of the UI rendering. All widget should
set/initialize their own self.dimen in self:init() method.
Allow one to go further in the FM's setting menu on legacy devices...
... and potentially shoot oneself in the foot because of the unusable
confirmdialogs (among other things ;p).
To avoid potential issues with USBMS.
Namely, make sure CWD doesn't point to the userstore for persitent
processes.
Make sure wpa_supplicant doesn't try to use our own OpenSSL lib, which,
again, is in the userstore area.
Properly kill our dhcp client invocation on when killing WiFi
Also, some related fixes to the startup script:
Properly kill wpa_supplicant & the dhcp client when we kill
wifi before rebooting to nickel.
On kindle, kobo and pocketbook the data directory is the current
running directory but on Android the app is installed in system
defined location and users may have no access to that location.
The same circumstances should be true for the upcoming Koreader for
Ubuntu touch, so the data directory (in which tessdata, dictionaries,
global settings, persistant defaults and probably history data are
stored) could be stored in another place.
Guard against trying to get any kind of frontlight info on devices
without one.
So far the flIntensity prop has always been there, even on devices
without one, but better not assume that'll always be the case ;).
That, and be consistent with the other lipc_handle tests.
My batch of startup script tweaks should ensure PRODUCT is always
exported.
Leave the fallback in place, to avoid blowing up in weird corner-cases I
haven't thought about.
More closely matches native behavior on REAGL devices.
Closing those widgets should still trigger a partial refresh though,
because we usually get back to the reader, and text, so we want REAGL
;).
The VFAT file system of `/mnt/us` is case insensitive so that
require("json") from Spore which intends to load luajson module in
rock directory actually will load `frontend/JSON.lua`, the two JSON
parser libraries have slightly different APIs.
This patch remove the pure Lua JSON library in favor of `luajson` which
uses LPeg pattern marching backend for better performance.
We can input relative page number now in the reader goto dialog.
Goto "+4" will page forward 4 pages and goto "-4" will page
backward 4 pages.
This implements #1437.
The 'KOSync' plugin will synchronize furthest reading progress
across different koreader devices after users registering their
devices.
The synchronizing service is open-sourced as the project
[koreader/koreader-sync-server](https://github.com/koreader/koreader-sync-server).
it uses non-blocking turbo I/O looper to process http request
so that multiple http request can be handled simultaneously and http request
won't block user input, and most importantly, in Lua's way.
Change from the commands from `wifi.sh` to those from `wifi_enable_dhcp.sh` from Tshering's Start Menu. See Issue #939. Should resolve hanging of Kobo Aura H2O.
I've tested this on a N905C. I assume this implementation never
worked (since charge_now is supposed to show state of charge), but
it would be useful to get a confirmation.
It turns out that one of our mupdf patch reads the FONTDIR env var
and uses it in a totally different way so we will use another env var
EXT_FONT_DIR to define external font directory for different platforms.
to support custom font directory for EPUB documents
Now Koreader could find fonts in the "fonts" directory in the USB root
directory of kindle, Kobo and PocketBook devices, thus no need to copy
fonts to "koreader/fonts" directory.
Full refresh when highlighting text is quite annoying, I fixed it by
using 'ui' refresh type.
And this patch also fixed a bug that after cleaning temporary highlights
the screen is not refreshed.
This is a larger clean-up of the refresh situation.
The general shift is that refreshes are now mainly triggered by
the (top-level) widgets when they get shown or closed via UIManager.
All refreshes for the widgets when they are in use were handled by
themselves before. This adds the case of showing/closing.
It is the desired result of not having UIManager:show()/:close()
do (full screen) refreshes on its own.
This eliminates the API difference between the extra parameters of
UIManager:show() and setDirty(). They work the same now.
Note that this also eliminates the automatic refresh that took place
before when using show() without refresh options. It always refreshed
the full screen, which led to too big refresh regions all over the
place. Thus, refresh has now explicitly to be asked for, hopefully
encouraging to implement it in the widget that gets shown (and is
aware about the screen region it covers).
Also add an event that is triggered when a widget is closed:
CloseWidget. So a widget can implement "onCloseWidget()" to trigger
actions upon closing - most commonly, this is a refresh for the area
previously taken by the widget. That way, the widget's user does not
have to take measures to ensure that the area is refreshed later.
for now, we have show() automatically call setDirty() for the new
widget, as before. However, now show() takes two arguments for
refresh configuration that will get passed on to setDirty().
For compatibility, the default is here in show() to do a partial
refresh. So if you want no refresh triggered (via this show() call),
add a function that doesn't return anything.
it was set to a full refresh. However, we want to behave as if in
non-scrolling mode and issue a partial refresh. That might get
updated to a full refresh if the full-refresh counter has reached
the limit - which is configurable.
This serves as a good example for the way refreshes are done:
setDirty("all", function() ... end)
* the "all" will have all widgets on screen repainted.
In this case that is needed because the config pane has
different sizes, covering different parts of underlying
widgets. So they need to be repainted every time.
* the function will return the area to refresh and is evaluated
after painting. In this example, we take the area that is covered
by the config pane before switching it (if present at all), and
hand it to the refresh area function as an upvalue.
When the function is called later after painting, it will
use that saved area and combine it with the area that is covered
then by the widget. That way, parts that are covered no more are
included in the refresh area, too.
See documentation in the code.
In short: There is now one single method, setDirty(), that triggers
repaints and/or refreshes.
All variables in UIManager are gone - at least from an external
perspective. Everything is done through setDirty().
This also allows for easier debugging, since all requests come
in via function calls.
when the image (e.g. a PNG) does contain an alpha channel, that can
be honored by ImageWidget. It doesn't do so by default for compatibility
(arguably, we should change that in the future), it has to be enabled
by setting the "alpha" property to "true" (boolean, not string).
external data (and in bad cases our own) can contain invalid byte
sequences in UTF8 strings. A prominent example are file names.
There was a 1-off bug in calculating the allowed length for multibyte
chars, and the iterator was a bit too greedy when stumbling upon
invalid sequences, returning a single "invalid" char for a sequence
up to the point where it became invalid in calculation. Now, we present
one invalid char for the first byte of that sequence and then check
for a valid char starting with the next byte.
This is the remaining gruntwork of #1276. I believe that only leaves networkmgr.lua and filemanagersearch.lua, which will require a little more thought.