nextTick was too early ;).
Prevents small hitches when turning the page for the page where this
triggers.
Apply the same trickery to the Stats DB insert, even if that one probably
had a much smaller impact.
* Warn on restart if the startup script has been updated, because a restart will not reload it.
* Also warn right after the update if it contained a startup script update...
- Move zoom options from top menu to bottom config
- Add option to manually define zoom (relative to
page width) and overlap (in percent)
- Add options to zoom to columns or rows, possibly
with overlap. Add panning direction options when
page forward in these modes
Some stuff was still hacked on manually instead of trusting the widget system to do things right, which it does, if you update the right stuff at the right time the right way ;). *This Is The Way*.
Fix#6893 (and address https://github.com/koreader/koreader/pull/6878#discussion_r523411883, because it was indeed redundant ^^).
Includes a bonus fix for a number of (footer) settings not being applied immediately in PDFs.
By essentially dropping the whole XHTML block, instead of trying to salvage each and every tag one by one as we did before.
Also, as that's usually the result after broken parsing, handle nil URLs slightly better in the frontend, so that they get caught/reported properly instead of doing nothing and/or crashing half the time.
Add option to hide (skip) non-linear fragments, only working
in 1-page mode. Tweaks mostly to footer, toc and skim code
to make it clear(er) which pages belong to linear or non-linear
fragments.
* Don't attempt to restart Nickel when asking for a reboot/shutdown
Use a magic exit code to ID those cases.
* Limit this to Kobo, to avoid breaking potentially existing assumptions
with other platform's startup scripts
In case of no environment language. I suppose that doesn't tend to happen much in the wild since I added the offending code early in 2020. ;-)
Fixes <https://github.com/koreader/koreader/issues/6873>.
* Use a CRe set* method when toggling nightmode
This ensures it gets flagged as add_reset by the call cache, and that
CRe will actually re-render, as it's necessary if nightmode_images is
enabled (the default).
Fix#6845
* Prevent ReaderHighlight:onTap from running ReaderHighlight:clear when
it's unnecessary.
Avoiding a clearSelection call in CRe that could invalidate the cache
and cause unnecessary redraws.
* Don't store empty highlight arrays when all HLs on a page have
been deleted
- Lcd devices won't use the SurfaceView, just the good old native content/window (except AndroidTv and ChromeOS)
- All android dialogs will be presented with Material Design on recent devices.
- Added an option to device settings to manage application battery optimization.
- Permissions that require the user to go to a settings page will be presented with a native android dialog.
- bump android-luajit-launcher
- Changes under the hood: koreader/android-luajit-launcher#257
2 new widgets:
- QRWidget, that's like an ImageWidget, but with a text property that will be converted to a QR code ;
- QRMessage, that's like an InfoMessage, but shows the message as QR code.
Moreover, it adds the ability to export QR codes to the text editor.
1 new plugin:
- Generate QR codes from clipboard
Changes to text editor plugin:
- Add the ability to export QR codes.
Have ReaderBack be the sole handler of onBack.
Add 4 mutually exclusive options for the Back key,
to avoid ReaderLink and ReaderBack location stacks
from interfering (ReaderBack's stack being always a
superset of ReaderLink's stack).
So, remove "Enable back history", which is replaced
by Back option "Go to previous read page".
Fix a few possible crashes and inconsistencies (when
zoom, scroll or reflow have changed) with ReaderPaging
and ReaderView when restoring previous page/view.
Follow up to b90f6db8: allow specifying an other
value for tap interval when the keyboard is shown
(a good value for tap interval on reader and UI
elements might be too long on the keyboard, and
prevent typing fast).
* When auto_refresh_time is enabled, don't actually refresh anything when the footer is hidden.
* Fix a bunch of state tracking related to height computations, meaning `getHeight()` is now actually accurate, always, and we don't need shitty workarounds anymore.
* `footer_container.dimen.h` *includes* the progress bar, so, never reset it to 0 unless the progress bar is disabled (some `settings.progress_bar_position` codepaths were mistakenly doing just that).
* More aggressively set/reset `footer_text.height` (not sure this one makes much of a difference, and/or if it's actually useful at all, but, the tracking was already there, but hella inconsistent, so, just fix it).
* Honor `settings.reclaim_height` in other bits of code that were only checking `footer_visible` to figure out the visible page area.
* Ask ReaderView to update the `visible_area` *now* when toggling the footer's visibility (for ReaderPaging).
* Fix initial tap on the H2O
There's no slot 0, so make sure the initialState doesn't get confused by input's init data that otherwise assumes the main slot is 0
* When closing a widget, stop sending setDirty call for widgets lower on
the stack as soon as we hit a full-screen one.
This prevents inflated refresh regions when closing stuff on top of a
stack of multiple covers_fullscreen widgets (i.e., InfoMessages on top
of the Favorites page on top of the FM, for instance).
And, while we're there, also prevent getting infected by dithered
widgets when they're below a non dithered full-screen widget (the exact
same examples works, if the underlying FM page requires dithering).
* handle onDestroy
we need it if killed by the system (ie: battery optimizations or OOM)
we need it to exit the lua VM when we call finish() from Kotlin
This prevents us for being trapped into a zombie state
On pocketbook, update modes are not as clear cut due to overall
chipset and kernel version mess. Inkview solves this by always
using the slowest (and safe) GC16 waveform. We now do that too
by default.
Slow updates suck though, so there's now a menu entry to configure
it for speed (with mild artifacts at best, kernel panic at worst).
This is a generic interface (any eink Screen can announce support).
The driver may interpret the slow/fast range however they want.
On devices where the event time is the uptime (time since
boot), we don't need to trash it and use TimeVal:now()
and lose precision. We can still use these times for
relative delays and durations computations, which is
mostly all we use them for.
We just need a real clock time in GestureDetector for
two timers (long-press and double tap), where we do
the event time type detection on the first event, on
all devices.
This allows for better energy efficiency (no more 50Hz tick poll),
as well as lower input lag / higher precision - touch events are
native linux ones.
In addition, auto off/suspend plugin is used in this mode, as we need
to trigger (timed) sleep / poweroff on our own, since the OS ones
will no longer work whenever koreader has focus.
This is for rooted devices only, and possibly somewhat FW
specific, so enabled only on PB740-2 where it's reasonably tested.
* Update the data collection format & handler to make it much less tortuous
* Update the pagecount & resync the stats on document layout changes
* Update the database schema to allow doing most queries against a SQL view that rescales the collected data to be accurate regardless of document layout (thanks to @marek-g for the SQL magic ;)).
* Add a "reset stats for current book" entry in the list of reset options, one that won't horribly break stats in said book ;).
* Fixed a couple of resource (SQL connection) leaks (in ReaderStatistics:getCurrentBookStats & ReaderStatistics:getCurrentBookStats).
* Flush stats to the DB on periodical metadata saves.
* Minor cosmetic tweaks to the code
* PB Crash Screen:
* We don't actually support the "tap to restart now" behavior, it's a
plain sleep.
* Remove CBB toggling leftovers missed in #6696Fix#6780
* Enable AutoSuspend plugin on rM
Fix#6769
Re: #6028
* Use the PowerEvent handler on rM
It makes much more sense than the fire & forget & hope for the best
approach copied from the Kindle platform, because we *are* controlling
suspend ourselves (mostly), unlike on Kindle ;).
Fix#6676
* Enable HW inversion on the rM
I mean, we kinda forgot to ever test that, but I don't really see why it
wouldn't work ;).
Previously items weren't actually moved, but swapped with the item
at their new position. That works well if you move an item for one position.
However, if you move an item over several positions, you won't get the
expected behaivor.
And to make it the screensaver image.
Done on two-finger large diagonal tap on multitouch
devices (like regular ScreenShoter) as long-diagonal
swipe is reserved for panning.
Fallback to tap in the bottom left corner on
non-multitouch devices.
Includes:
- (Upstream) various unimpacting changes to keep in sync
- (Upstream) Fix issues with legacy text rendering
- (Upstream) FB3/DocX/ODT: get lang and description metadata
- (Upstream) remove some global settings, make them per-doc
- TextLang, hyphenation: add Armenian, Friulian, Piedmontese,
Romansh, Zulu and Brazilian Portuguese.
Also make cre the prefered engine for .xhtml (over MuPDF)
and for .xml (which might be HTML).
* In icons mode, just use two different icons to display Wi-Fi status
* Enable Wi-Fi status icon on Kobo & Cervantes, too
* Refresh footer on (dis)connect if the Wi-Fi status item is enabled
The differences between Allwinner/MXC matter surprisingly little in practice, it's not even worth
it to bother the base mxc driver with it. Instead, frontend can make some informed choice by
probing for the hardware and tweaking requested device caps accordingly.
On Allwinner B288, we disable both hwrot (done in software in kernel and terribly, ie not worth it)
and hwinverse (no support whatsoever). On NXT we'll keep both on, as the kernel driver seems
to be using the hardware properly .
In the current KOReader version the folder shortcuts are sorted by date of addition. When a user has many folder shortcuts (like I do blush ) they are easier to find again when sorted alphabetically.
As things were, when I activated USBMS, any bookmarks recently added and not yet stored in the sidecar file would be lost after returning to the reader. These changes fix that.
This pull requests aims to provide convenient way to zoom in comics. The idea is when user holds/double taps (not decided yet) on a manga/comic panel, it gets cut out from the rest of the image and zoomed. More details in koreader/koreader-base#1148. Depends on koreader/koreader-base#1159
CBB now handles nightmode correctly (by deferring to Lua), so we no longer
need to do monkey dances about disabling it when hw invert is missing.
canUseCBB cap is resolved by generic device re-configuring blitbuffer
on the go, so as to avoid repeating the same thing in every device driver.
The dev setting can now flip cbb on the go, so one can gloat at the near
meaningless perf difference - 2Mp draw is 15ms Lua / 10ms C on 1GHz Cortex A7.
* Uses bunch of new plumbing in base to configure screen rotations in hardware (koreader normally does this via blit buffer rotations, except for android).
* Some PB specific kludges that used to pollute core/framebuffer_linux are brought into PBs frontend driver.
move state change event to higher level function so it will be called after powerd.is_fl_on is updated.
makes _setIntensity redundant so get rid of it
obsoletes #6667
Includes:
- Update German hyphenation patterns
- (Upstream) Adds ODT (ODF) format support
- TextLang, hyphenation: add Basque, Croatian, Esperanto,
Estonian, Georgian, Latvian, Lithuanian, Macedonian,
Occitan, Welsh; update Bulgarian, Irish, Portuguese,
Slovak, Dutch, Norwegian, Spanish; update hyphen min
for Czech, English, Greek; fix Romanian and Ukrainian
pattern file names
- HyphMan: adds HyphMethod::getLeft/RightHyphenMin()
- epub.css: update HR default style
- fb2.css: keep <date> in main text left-aligned
- getRenderedWidths(): inline-block and table fixes
- CSS: avoid style hash mismatch when serializing content:''
- Tables: re-order row groups when necessary
- XML parsing: don't drop trailing text
- HTML parser: tweak implicit head/body insertion code
- Fix text search failure when blank at start or end
readertypography.lua: some cleanup by removing the first
table listing hyph dicts, and including their filenames
in the second table so we can build the first table
dynamically. Also fetch hyph left/right min limits from
crengine to not have to duplicate them here and keep them
in sync.
css_tweaks.lua: for in-page footnotes, switched from
"-cr-only-if: epub-document" to ": -fb2-document"
("not" FB2 documents), so these tweaks also work with
DocX and ODT footnotes.
Also included in base bump:
- KOPTContext: add comic panel detection function/additional
leptonica declarations
- Forcibly disable docs when building giflib
In the "Set footnote popup font size", allow toggling
between setting a relative (to the document) font size
and setting an absolute font size (that won't change
with the document font size).
Since 8815cbe0 and getSafeFilename() taking additional
parameters, and :gsub() returning multiple values,
filesystem type wasn't really checked and replacements
were not ensured, so saving articles like "Portal:Stuff"
failed on VFAT devices as ':' wasn't replaced.
After the awesome work made by @ezdiy:
- Remove empty dir from release zip
- Remove misc files (txt, md, html, gif) to prevent displaying them in PB library
- Do not asociate executable files (sh and py for the moment), just openable files
- Rename the font sample from html to template (to prevent wiping it during clean)
* Only ask to start an USBMS session when plugged into a USB host on Kobo
Also, fix a typo that broke plugout detection on cervantes
* Bump base (necessary input/KoboUSBMS changes)
https://github.com/koreader/koreader-base/pull/1183
Only with CreDocuments (as no way currently to highlight links
in PDFs).
Tab or Shift-Tab to select next or previous links.
Press to follow (or show footnote in popup, and in there Press
to follow), back to go back.
Adaptively pins the auto-standby UI lock. When frequent input
from user is observed, we'll prevent for increasingly longer
periods of time, and revert back to more aggressive standby
with infrequent input (infrequent taps when reading a book).
A BackgroundRunner plugin instance will stop running
(rescheduling a check every 2 seconds) when there is no
(or no more) job to run.
Clients of this service now have to emit an event after
adding a job into PluginShare.backgroundJobs, so an
already loaded but stopped BackgroundRunner can notice
it and start running again.
Out of the box, it behaves exactly as native pocketbook apps should, ie aggressive
standby, but no freezing at operations in progress.
Config UI will be done via koplugin that will also do adaptive standby. This is
because the API is now device independent (albeit PB is the only implemented user).
* Be even more defensive around KoboUSBMS handling in the startup script
And add some more logging. To the log before a session, to the syslog
after, because we can't be sure onboard is viable.
* Display a short version string straight in the Version label
* Move system statistics inside the Help menu
* Move Version inside Help
* Bump base
https://github.com/koreader/koreader-base/pull/1173
* Enable i18n in KoboUSBMS
* Rejig the "No confirmation" USBMS setting:
In now *only* affects the USB plug in event.
The menu entry will never show the popup (clicking on it should already
be confirmation enough, that, yes, we really would like to do that,
please ;)).
Also, enable said plug in behavior on Cervantes, too ;).
* Add an option to disable USBMS entirely
* Bump base
https://github.com/koreader/koreader-base/pull/1170
(Not sure how and with what this check works and if
we still get such kind of items, but avoid a crash
when item2.pos0 exists but item1.pos0 does not.)
It's only needed by all_at_once, but we were skipping it if nothing or
only a single mode was enabled.
It lead to desync w/ the settings, or a crash.
Fix#6561
Includes:
- Revert "FB2: don't draw cover in scroll mode"
- (Upstream) FB2: fix coverpage drawing in scroll mode
- FB2 footnotes: only merge run-in when next is erm_final
- fb2.css: use OTF tabular-nums for footnote numbers
- Text: ignore ascii and unicode control chars
- Fix HR positionning when floats involved
- writeNodeEx(): minor tweaks
- OnTagClose(): add self_closing_tag parameter
- HTML format detection: accept HTML5 doctype
- HTML parser: rework Lib.ru specific handling
- HTML parser: new more conforming implementation
- HTML parser: ensure foster parenting inside tables
Also includes:
- SDL: don't bypass X11 WM compositor
* Boundaries are now detected both when paging forward and backward.
Fixes potential false-negatives in the chapter boundary heuristic code, as mentioned in https://github.com/koreader/koreader/pull/6528#issuecomment-678610188 ;).
* Tweaked ReaderFooter to not repaint ReaderUI when it's unnecessary. (toggling/cycling it on a page with significant image content would flash the full screen).
* Only flash the first time a page w/ significant image content is shown. (Menus, among other things, could otherwise re-trip the flash).
* Add an option to *always* flash on chapter boundaries
* Optionally, in flash on chapter boundaries mode, also flash on the *second* page of a chapter.
(There's often a large river at the top of the page on a chapter's first page)
* In CRe, request a flashing update when there is significant image content on the page.
* Register all refresh rate related options in Dispatcher, making them available in Gestures & Profiles.
when rotation was caused by a gesture the gesture settings were not flushed leading to weird state when the FM reinit reloaded the gestures plugin
discovered in #6530 caused by #6309
Includes:
- (Upstream) LVBase64NodeStream: fix possible segfault
- (Upstream) Fix getting encoding from HTML META tags
- FB2: also look for cover in <src-title-info>
- FB2: fix cover image colors
- FB2: don't draw cover in scroll mode
- TextLang: better linebreaks at em-dash (EN/ES/FR)
- TextLang: increase _lb_props static array size
FB2 footnotes style tweaks: avoid gap above first footnote,
caused by the title bottom margin collapsing into it.
This change to the parser in `cloudstorage.lua` adds support for the [Apache WebDAV module][1]
It was manually tested using the [bytemark/webdav][2] docker container.
I developed this in Windows, with a docker container that hosted an extracted AppImage and a VNC server that I viewed using a VNC client.
I will write up my work flow at a later point.
Changes have not been tested against other webdav servers (what was this originally tested against?). Please could someone test against other webdav servers?
I also noticed a logic inversion error where we were looking for a slash at the end of the URL and if it exists, then we explicitly set `has_trailing_slash=false` - so I fixed it to set to `true`. I had to do this so that we weren't visiting the URL without a trailing slash - apache sends back a 301 redirect with a `location` header with a trailing slash, if you don't put a trailing slash.
As a side note, I think we should consider replacing this regexp pattern matching parser with the [XML parser in the newsreader plugin[3]
[1]: https://httpd.apache.org/docs/2.4/mod/mod_dav.html
[2]: https://github.com/BytemarkHosting/docker-webdav
[3]: https://github.com/koreader/koreader/blob/master/plugins/newsdownloader.koplugin/lib/xml.lua
* deduplicate code on warmth/brightness swipes
if device has a small scale (e.g. warmth is going from 0..10)
* adjust warmth message
* use a smaller gesture sensitivity
* bump crengine: reworked hanging punctuation
* move setting management from ReaderTypeset to ReaderTypography
And fix initial handling of defaults being loaded as true/false
but needing to be saved as 1/0.
* fix luacheck
Add Set Frontlight/Set Frontlight warmth events to dispatcher. This allows users to set day/night profiles with different fl/warmth values as requested in #6444
there is no need to pass the caller rather just the table where the setting is located. passing the setting alone is not enough as sometimes it is nil and then you do not get a reference to its location
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix#6421
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
Witnessed with "L/R Margins": tapping on a button
sets the value to the preset table, by reference.
Tapping the -/+ fine tuning buttons was updating
these tables in-place, in effect modifying the presets.
It doesn't do so for the FM, so the inconsistency is confusing.
Plus, if you're actively using sticky rotation, saved rotations are
ignored anyway.
Re #6420
* Allow switching to SW dithering on a HW-capable device without that being lost on boot (and, worse, left in an undithered state).
* Make sure the automagic toggles between HW/SW in the Dev menu are properly saved.