Menu key support for some widgets. would have closed#11783 and #6463 (cumulative with @comphilip's fixes)
It fixes a problem where some virtual keys were not available for non-touch users. closes#11862
Also, adds keyboard settings to non-touch devices. closes#11934
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.
Closes#11887.
Currently, links with a scheme other than http or https are rejected. But plugins may want to handle them. This allows them to, by registering the scheme with self.ui.link:registerScheme("example") during the plugin's init.
We now build the "page/total %" string ourselves,
with the same logic as used in the footer (including
when hidden flows or reference page numbers are used)
and give it to crengine to be displayed instead of
its own way of doing it.
When using Reference page numbers, "Pages left" was showing the
same info as "Current page", because Reference pages, being strings,
couldn't be used for arithmetics. But we can just count the number
of items left in the Reference pages array of strings.
Also fix edge case with "page progress" with hidden flow when
we are before the first chapter with a hidden flow before.
Includes:
- html5.css: really ensure ruby centering
- getRenderedWidths(): fix possible crash with 0-width images
- Page splitting: ignore empty non-linear flows
- LvDocView header: allow overriding "page/total %"
CreDocument: add setPageInfoOverride() to allow tweaking
top status bar display of page number/count/% (to be
implemented in a later commit).
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...
This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
The info messages for opening files always show the full path. By using `filemanagerutil.abbreviate`, the info messages now show the shortened home folder path (only if the setting "shorten home folder" is enabled).
Many PocketBook devices include a web browser, but when clicking a link in KOReader, there was no option to open the link in the browser, there was only an option to show a QR code (which can then be scanned by a smartphone).
This commit implements `canOpenLink`/`openLink` on PocketBook using the "browser.app", if available.
Tested on PB740 (InkPad 3).
Fixes: https://github.com/koreader/koreader/issues/11782
Related: https://github.com/koreader/koreader/issues/6597
* Kindle: Don't forget to open INPU_DPAD devices for the fiveways. Somehow managed to skip my mind, they're often on a separate input device.
Regression since #11807
* Update FBInk to fix a few cases of input_scan misdetection (on misconfigured drivers (e.g., no DIRECT prop on supported kernels), or old kernels with no EVIOCGPROP support).
Fix#11824
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
* Support the Clara B&W, Clara Colour & Libra Colour
* Enable HW dithering on *all* the Kobo MTK devices
* Enforce 32bpp instead of 8bpp for Kobo devices with a color panel (the driver doesn't actually support 8bpp anyway)
* Enable standby support on MTK (whenever possible, i.e., not when plugged in, as that is horribly, horribly broken).
* Enforce the dedicated "color" waveform mode for image content in ScreenSaver, ImageViewer & Reader.
* Fix charging LED support on MTK
* Tweak the frontlight ramp on MTK + LM3630 so that it actually ramps smoothly
Search may highlight matches on the current page, and if there
are no others in the book, we would stay there and resume reading;
but we would get a spurious previous location (ie. in Book map)
that we would not expect keeping, and we may accidently go back
to previous location, losing our reading position.
Avoid this by only adding current page to location stack when
actually leaving the current page.
Because of complications with other reading modes, this is
currently only enabled for CRE document when in page mode.
When on a page before the first ToC item (the first chapter),
that first chapter title may be shown in the footer instead
of a more correct blank title.
This bug might still have had other small effect elsewhere.
Device:getDefaultRoute parses /proc/net/route and converts the hex
addresses to textual IP addresses, but in `isOnline` we don't care what
address the gateway actually has, we only care about whether we have a
default route into the Internet.
This provides a simpler alternative that does the equivalent of
"ip route get 203.0.113.1 || ip route get 2001:db8::1" (note that it
does support IPv6-only connectivity as opposed to
Device:getDefaultRoute) and returns true if we have a route.
Inspired by https://github.com/pavel-odintsov/get_default_outgoing_ip_linux
Doing the `isOnline` check (`socket.dns.toip("dns.msftncsi.com")`)
without having internet connectivity (`!isConnected`) results in the
`isOnline` check never succeeding again even if connectivity is later
acquired. This is most likely caused by /etc/resolv.conf only being
parsed once - https://sourceware.org/bugzilla/show_bug.cgi?id=984, an
issue that was fixed in glibc 2.26 (PocketBook firmware U740.6.8.2461
has glibc 2.23).
This fix works around the problem by checking if we have a default route
first before even attempting to check `isOnline`. If we don't, then
`isOnline` is (almost) guaranteed to fail anyway.
We could alternatively check `isConnected` instead, but that only checks
wireless connectivity on many platforms, and we could have internet
access via USBNet instead. Checking for the default route via any
interface should work reliably for both wireless and USBNet
connectivity.
Another alternative fix is to add a fallback nameserver to
/etc/resolv.conf like we do for the Kobo platform [1]. Unfortunately,
this fix would not work in the following (rather common) scenario:
1. PocketBook boots, connects to WiFi
2. KOReader starts, /etc/resolv.conf looks all right, no fallback needed
3. PocketBook goes to sleep, disconnects from WiFi, clears resolv.conf
4. PocketBook wakes up, stays disconnected
5. KOReader user does a Wikipedia lookup, networking freezes
[1]: https://github.com/koreader/koreader/pull/6424/files#diff-be863601c59a2d6607af6b04b3be2392ec4494df6d25dae48250fae57b737f61R216-R224
Fixes: https://github.com/koreader/koreader/issues/10183
Related: https://github.com/koreader/koreader/issues/6421
Added in <https://github.com/koreader/koreader/pull/8722> and unproblematic for the past two years, but Weblate has now decided to complain about it to the extent of disabling translations:
> Error message
String contains control character: 'If some book titles, dictionary entries and such are not displayed well but shown as \ufffe\ufffe or ��, it may be necessary to download the required fonts for those languages. They can then be enabled as additional UI fallback fonts.\nFonts for many languages can be downloaded at:\n\nhttps://fonts.google.com/noto\n\nOnly fonts named "Noto Sans xyz" or "Noto Sans xyz UI" (regular, not bold nor italic, not Serif) will be available in this menu. However, bold fonts will be used if their corresponding regular fonts exist.'
Include in the EPUB stylesheet most of our epub.css
tweaks, so we get our expected styling even when
html5.css is used as the default stylesheet.
(Users liking the "web page" look can still get it
by enabling some of our existing style tweaks.)
- Reword and document most menu items.
- Handle internally two default styles, one applying only
to FB2/FB2 books, and the other to all other formats.
- Also don't reset the stylesheet to epub.css when
toggling Embedded Styles to off.
If there's only one contact, we won't get an ABS_MT_SLOT, so we need to
make sure we fall back to the main finger slot once we've caught a tool
switch.
Also, move the dedicated pen slot further away, so it has zero chance of
being detected as a potential buddy contact to a finger contact.
Fix#11514
When we open the document for the first time, the pan
positions are not being applied. If I use the bottom-to-top
mode we should see the bottom first, but the top is being
shown instead.
Can be used to inspect the state of the objects in
a running KOReader.
It can also be used to execute actions (like the ones
available to associate to a gesture) with HTTP requests
from a remote computer/devices/gadgets.
The TCP server side is provided either with a new
ZeroMQ StreamMessageQueueServer (thanks bneo99),
or with a LuaSocket based SimpleTCPServer.
Minor UIManager tweak to avoid uneeded inputevent
when such a ZeroMQ module is running.
The previous check was inlined in the dir walk, so it always saw a
relative path.
Here, it gets an absolute one instead, so act accordingly ;).
Fix#11390
Regression since #11056
FrameContainer now behaves like other widgets, and no longer re-computes
dimensions in paintTo *if you provide a dimen*.
Since we do here, for.... reasons I'm not entirely sure still make any
sense, make sure we actually compute valid dimensions,
instead of an empty rect from Geom:new ;).
Fix#11389
@hius07 mentioned something to that effect a while back, makes sense.
Unlike the set of checkmarks in the dev settings, this one flips both
debug + verbose at once, *and* asks for a restart for framebuffer's
sake.
Also update the "Report a bug" spiel to request verbose debug logs.
Allow for embedding "tags" (invalid Unicode codepoints)
in the text string to trigger some text formatting:
for now only bolding some parts of text is possible.
Use it with fulltext search "all results" to highlight the
matched word (instead of the previously used brackets).
Fixes issue #8023
Related to issue #4029
The fix takes exactly the same approach as other PRs like #6195 to add some usability to devices with few hardware keys. The front-light widget can now be closed using the left key on the d-pad.
We currently don't do anything with it, but this might help someone come
up with fancier smartcover handling, like we do on Kobo...
Simplify the fake events w/args checks:
We can just hitcheck the table directly, no need for another hash
Also catch ExitedSS on Kindle.
And, again, dn't do anything with it ;p.
People using 2-steps text selection (via the Select button) may
want to not be annoyed by this feature.
Also tweak a bit its behaviour, requiring now the text selection
to come from outside a corder into a corner to activate it, which
should allow starting text selection from a corner without
triggering a scroll yet.
* UIManager: Init a full Geom on region-less refreshes in _refresh
* Never call refreshFull with no arguments
I got rid of the low-level nil guards, because UIManager itself guarantees that it can never happen
* Bump base (https://github.com/koreader/koreader-base/pull/1718) (fix#11303)
* Kindle: Re-enable HW dithering on the Scribe
Now that the underlying issue is fixed in base ;).
* Input: Harden setCurrentMtSlotChecked
The current implementation was assuming that the only case where we
might be missing slot storage was for the *first* contact point,
given that ABS_MT_SLOT is (if all goes well) guaranteed to be present
and come first for every subsequent additional contact points.
While this works just fine in practice, we can simplify and generalize
the check by just checking if we've actually recorded the requested
slot, even if it's not the first contact point.
The hit check is possibly ever so slightly faster than the length
computation, to boot.
* Input: Handle snow_protocol devices with newer hardware revisions that do *NOT* need the snow quirks.
If a sane input frame is detected, the snow quirks will be disabled at runtime, ensuring sane behavior.
Given the extremely non-standard behavior of the snow quirks, this is fairly easy to detect,
as a snow device will *never* emit EV_ABS:ABS_MT_TRACKING_ID:-1, so if we catch one, it's not snow ;).
(We've had reports of this on a Clara HD, FWIW)
Namely, don't recompute layouts, as they do not change.
(The gyro codepaths were already doing something similar.)
* Keep ConfigDialog, FileManagerMenu & ReaderMenu open on rotation.
(In practice, only ConfigDialog is affected, as *Menu doesn't handle the rotation event.)
* Plugged an instance leak in the aforementioned Menu classes.
* Unify behavior & code with the gyro codepaths.
Something in the gettext/weblate pipeline doesn't like it...
These are real unicode codepoints, not custom nerdfont ones, so just
render the actual glyph instead of escaping it.
Fix#11328
Cf. #10845.
Simplify the code, because the bit trickery was fairly nasty to follow.
KISS: flip one value at a time, either in or out.
Actually allow flipping *all* of the things via the UI, to help track
what the hell is actually happening when you touch a button.
Make some of 'em radio to make it clear when flipping one might affect
the other(s).
Brought on by https://www.mobileread.com/forums/showthread.php?t=358166
These changes make the title bar in File manager, History and Collection windows of the same height.
The items and book covers thumbnail dimensions in Mosaic and Detailed list display modes are now equal, and up/down scaling of the thumbnails is not needed when switching between File manager, History and Collection.
Get rid of the silly precomputed tables, and do More Maths(TM) instead!
Thanks to @zwim for the magic sauce ;).
Minor simplification of the API while I'm in there, and unify the warmth
computations, do everything in the native scale (much like what
effectively happens for intensity) to workaround the silly public API
being an unhelpful PITA, ensuring consistent & effective changes.
For some mysterious reason, we init fl_warmth_max to 100 on Kobo &
Cervantes, despite this being the case on absolutely none of them.
TL;DR: We update it according to nl_max during init, but this was
missing on Cervantes.
Add some menu items under Screen>Rotation to allow inverting
the default rotation of ImageViewer, and to auto-rotate for
best fit on launch, so landscape images are auto-rotated to
the preferred rotation.
Maintain correct records in History and Favorites when moving/deleting folders or group of files.
Optimize Collection module to minimize storage requests.