2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

4937 Commits

Author SHA1 Message Date
hius07
752ec49c6f
FM: Make "Refresh content" an actual Event/Gesture (#7592)
* And enable it by default in the FM as the "hold on top-right corner" Gesture, instead of the onHold handler of the "+" button.
2021-05-05 20:43:43 +02:00
zwim
3d9ed32458
Android: Send Suspend/Resume Events on STOP/START (#7630)
* ReaderHeader: Refresh it *now* on Resume, instead of just re-scheduling an update if auto-refresh is enabled..
2021-05-05 20:41:14 +02:00
NiLuJe
06a273b48d Port ffiUtil.getTimestamp users to TimeVal:now()
They were all using it to compute durations,
something which is going to be more sensible
from a monotonic clock source.
2021-05-05 20:37:33 +02:00
NiLuJe
21b067792d Cache: Rewrite based on lua-lru
Ought to be faster than our naive array-based approach.
Especially for the glyph cache, which has a solid amount of elements,
and is mostly cache hits.
(There are few things worse for performance in Lua than
table.remove @ !tail and table.insert @ !tail, which this was full of :/).

DocCache: New module that's now an actual Cache instance instead of a
weird hack. Replaces "Cache" (the instance) as used across Document &
co.
Only Cache instance with on-disk persistence.

ImageCache: Update to new Cache.

GlyphCache: Update to new Cache.
Also, actually free glyph bbs on eviction.
2021-05-05 20:37:33 +02:00
NiLuJe
ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
2021-05-05 20:37:33 +02:00
NiLuJe
e7acec1526 ReaderUI: Saner FM/RD lifecycle
* Ensure that going from one to the other tears down the former and
    its plugins before instantiating the latter and its plugins.

UIManager: Unify Event sending & broadcasting
  * Make the two behave the same way (walk the widget stack from top to
    bottom), and properly handle the window stack shrinking shrinking
    *and* growing.
    Previously, broadcasting happened bottom-to-top and didn't really
    handle the list shrinking/growing, while sending only handled the list
    shrinking by a single element, and hopefully that element being the one
    the event was just sent to.

These two items combined allowed us to optimize suboptimal
refresh behavior with Menu and other Menu classes when
opening/closing a document.
e.g., the "opening document" Notification is now properly regional,
and the "open last doc" option no longer flashes like a crazy person
anymore.

Plugins: Allow optimizing Menu refresh with custom menus, too.

Requires moving Menu's close_callback *after* onMenuSelect, which, eh,
probably makes sense, and is probably harmless in the grand scheme of
things.
2021-05-05 20:37:33 +02:00
NiLuJe
b24ecf35d4 CreOptions: Display weight classes names, in addition to their raw value. 2021-04-30 06:02:09 +02:00
NiLuJe
56d7a2d86b CreOptions: Minor wording tweak after #7616
c.f., https://github.com/koreader/koreader/pull/7616#discussion_r622732969
2021-04-30 06:02:09 +02:00
NiLuJe
9f835156d1
PluginLoader: Allow querying whether a specific plugin is loaded (#7607)
* PluginLoader: Allow querying whether a specific plugin is loaded (instantiated, actually).

Re #7598

* PluginLoader: Add a method to access a specific Plugin's instance
(Besides `self.ui[plugin_name]`, that is).

Requires some nastiness to avoid pinning stale references in memory :s.

* PluginLoader:  Tweak genPluginManagerSubItem to keep from rebuilding `self.all_plugins`, it's using `loadPlugins`, which is cached, so it made no sense to re-compute this one.
2021-04-29 19:30:18 +02:00
poire-z
9ef435c97a
bump crengine: more granular font weights (#7616)
Includes:
- MathML: a few minor fixes
- (Upstream) lvtext: fix possible index out of range
- Fonts: RegisterExternalFont() should take a documentId
- Fonts: fix: letter-spacing should not be applied on diacritic
- (Upstream) Fonts: more granular synthetic weights
- Fonts: synthesized weights: tweak some comments
- Fonts: keep hinting with synthetic weight
- Fonts: fix synthesized weight inconsitencies
- Fonts: fix getFontFileNameAndFaceIndex()
- Fonts: adds LVFontMan::RegularizeRegisteredFontsWeights()
- Fonts: handle synth_weight tweaks in glyph/glyphinfo slots
- (Upstream) Fonts: fix some compiler warnings
- Fix hyphenation on Armenian and Georgian text

Update the bottom menu widget "Font Weight" to allow more
granular weights than the previous "regular | bold".

Also bump thirdparty/luasec to v1.0.1.
2021-04-29 01:37:53 +02:00
hius07
3cb9508185
Filemanager: enhance file operations dialogs (#7582) 2021-04-27 21:22:16 +02:00
hius07
86126d042f
Dispatcher: add "Toggle status bar" action (#7606) 2021-04-26 21:45:34 +02:00
hius07
9d9667c226
Status bar: do not hide alone empty indicators (#7602) 2021-04-26 17:40:06 +02:00
NiLuJe
da4aec223c CloudStorage (FTP): Unbreak after #7597 2021-04-26 04:00:26 +02:00
Andy Bao
ea6576d2b6
CloudStorage (FTP): Do not buffer entire download in memory (#7597) 2021-04-25 13:08:49 +02:00
NiLuJe
e0a67bb656
OTA: Handle tar checkpointing visual feedback w/ an FBInk daemon (#7588)
Instead of forking it on every checkpoint.

Won't change much in the grand scheme of things, but FIFOs are fun.
2021-04-25 01:15:38 +02:00
gbyl
617ed2c078
Gestures: Allow disabling tap and/or swipes for page turns (#7572)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
Co-authored-by: NiLuJe <ninuje@gmail.com>
2021-04-22 18:35:08 +02:00
yparitcher
dde3c80e73
do not exit when opening unsupported file by last for FM (#7580)
fixes: #7577

see prior art in #3935 #3933
2021-04-22 16:35:00 +02:00
zwim
e4c9409f97
[plugin] Add a caching mechanism for CoverImage (#7510) 2021-04-22 08:38:49 +02:00
NiLuJe
14f9f9d3fc
FileManager: Tweak #7564 (#7571)
Tweak the goHome handler directly, instead of only the Home button.
Also, limit it to when it's actually needed, as changeToPath already
does it.
2021-04-19 21:29:26 +02:00
NiLuJe
9e9a87434b
NetworkManager: Just warn if the gateway is unreachable after a (#7570)
successful authentication.

Fully tearing down Wi-Fi was a bit optimistic, as the AP list can
technically still be up, so the user might want to try again and/or
connect to another AP.

Fix #5912, regression since #4616.

The reasoning behind #4616 doesn't really apply anymore anyway, as the
Wi-Fi prompt now handles this inconsistent state properly.

The whole codepath should be *extremely* rare anyway (and/or require
super-broken network conditions).
2021-04-19 21:29:12 +02:00
Martín Fernández
53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
2021-04-19 09:04:31 +02:00
NiLuJe
9988eab1a1
ReaderToc: Unbreak ToC depth detection (#7569)
No need to reinvent the wheel.

Fix #7568, regression since #7553
2021-04-19 02:21:58 +02:00
hius07
3df1ce3644
Style tweaks: add links italic style (#7567) 2021-04-19 02:21:44 +02:00
gbyl
508a294016
ScreenSaver: Allow toggling the reboot/poweroff overlay message (#7566)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-19 02:20:46 +02:00
NiLuJe
d3213e6b80 UIManager: Follow the same ScreenSaver preparations than Generic's
PowerEvent handler

(i.e., flash to white befor eimages).

Re #7519
2021-04-18 01:03:33 +02:00
NiLuJe
14cd6febbb Kindle Legacy: Cleanup key mappings
The K3 has a mapping similar to the K4, not to the DX & K2.

Fix #7561
2021-04-18 01:03:33 +02:00
NiLuJe
d6c6b3eb71 ReaderHeader: Skip the refresh if we're not visible
Similar in spirit to the previous commit, although since we're drawn as
part of the CRe page, this is just the refresh per-se that's optimized,
it had no chance to actually be visible.
2021-04-18 01:03:33 +02:00
NiLuJe
079418d3cd ReaderFooter: Smarter hardware event handlers
Make sure we don't repaint the footer over anything else than ReaderUI,
as some events are fired without direct UI interaction, so we can't be
assured of the actual state of the UI.

Fix #7556

Exposed since #7379, but could arguably happen with other existing
handlers before.
2021-04-18 01:03:33 +02:00
NiLuJe
832d915795 SortWidget: More tweaks
* Support cancelling individual moves.

Coopt the cancel button to actually do just that, cancel, instead of close.

* Don't close when hitting the accept button, allowing to chain multiple moves.

Changes are still propagated to the caller on each individual move, though.

* Update the new icons to match our usual stroke width.
2021-04-18 01:03:33 +02:00
gbyl
32802ee7f2
reMarkable: Remove refresh before poweroff (#7563)
This is now handled in a platform-agnostic manner (#7558).

Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-18 01:02:59 +02:00
gbyl
915c5c7755
FileManager: Also refresh content when tapping the "Home" button (#7564)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-18 01:01:59 +02:00
hius07
7b169dfa5e
FileManager: Hold the "+" button to refresh content (#7559) 2021-04-18 00:58:52 +02:00
yparitcher
475f46c427 fix for #7553: missing comma 2021-04-16 16:53:02 -04:00
NiLuJe
6def0bb7f0 FrontLight: Workaround potential crashes when swiping the frontlight bar.
This whole widget is a mess.
2021-04-16 22:12:15 +02:00
NiLuJe
956ecdc910 FrontLight: Ensure the warmth bar is empty at 0
Fix #7548
2021-04-16 22:12:15 +02:00
NiLuJe
7f3a9f4761 ReaderToc: Minor look'n feel tweaks
* ReaderToc: Tweak padding around items to be a tad more balanced for multi-level ToCs, and perfectly balanced for flat ToCs. (Re #7548)
* ReaderToc: Make the onHold popup's width match said padding. (Re #7548)
* InfoMessage: Allow passing the alignment flag to TextBoxWidget
* ReaderToc: Center text inside the InfoMessage onHold popup
2021-04-16 22:12:15 +02:00
NiLuJe
1ac0ad2f1a Android: More input handling tweaks
* Android: Fix #7552 by simply ensuring we drain the input/cmd queue first, simply by scheduling the task to the next tick, instead of locally re-implementing part of the event loop ;). (Requires https://github.com/koreader/koreader-base/pull/1356 for extra safety).
* Android: Clear input state when the window loses focus. (Related to the above fix).

* Bump base:

https://github.com/koreader/koreader-base/pull/1356
https://github.com/koreader/koreader-base/pull/1357

* Bump android-luajit-launcher:

https://github.com/koreader/android-luajit-launcher/pull/293
https://github.com/koreader/android-luajit-launcher/pull/298
https://github.com/koreader/android-luajit-launcher/pull/299
2021-04-16 22:12:15 +02:00
NiLuJe
97b81a7eb6 Menu: Don't share the dimen object across Menu instances (!)
The object was never re-assigned, so closing a smaller menu (e.g.,
Calibre metadata search) made the underlying one (e.g., CoverBrowser's
ListMenu) inherit the smaller dimensions...

Instead of creating the object in the Class constructor, create it in the
instance constructor (i.e., :init).

Similar cleanups in other Menu* related classes.
2021-04-16 22:12:15 +02:00
NiLuJe
3274183466 Minor Input & TimeVal cleanups
* Input: Don't create a new TimeVal object for input frame timestamps, just promote our existing table by assigning it the `TimeVal` metatable.
* TimeVal: Export (const) `zero` & `huge` TimeVal objects, because they're common enough in our codebase. (NOTE: not actually const, that's a Lua 5.4 feature ;p).
* GestureDetector: Explain the behavior of the `last_tevs` & `first_tevs` tables, and why one needs a new object and not the other.
* Speaking of, simplify the copy method for `first_tevs`, because it doesn't need to create a new TimeVal object, we can just reference the original, it's unique and re-assigned for each frame.
2021-04-16 22:12:15 +02:00
hius07
fce63d3c0f
Numberpicker: show hint with boundaries instead of the current value (#7529)
* Numberpicker: show hint with boundaries

* Show current value in the hint
2021-04-16 22:01:24 +02:00
hius07
c560be3740
SortWidget: Redesign the footer to be more in line w/ Menu & KeyValuePage 2021-04-16 22:00:02 +02:00
hius07
d879062eeb
ReaderToc: Add an option to display a separator between entries (#7551) 2021-04-16 21:59:01 +02:00
hius07
7092df7f4e
Button setIcon: Allow keep button width (#7546)
Useful when said Button was instantiated with a custom width, as is the case in SortWidget.
2021-04-16 01:35:04 +02:00
NiLuJe
ea3fa5c2c7
Calibre: More QoL tweaks (#7545)
* Wireless: Optimize memory usage in StreamMessageQueue (use an array of string ropes, that we only concatenate once). Allowed to relax the throttling, making transfers that much faster.
* Persist: Add a "zstd" codec, that uses the "luajit" codec, but compressed via zstd. Since both of those are very fast, it pretty much trounces everything in terms of speed and size ;).
* Persist: Implemented a "writes_to_file" framework, much like the existing "reads_from_file" one. And use it in the zstd codec to avoid useless temporary string interning.
* Metadata: Switch to the zstd codec.
2021-04-14 00:35:20 +02:00
NiLuJe
47c59e0e5a
Persist: Add the new native LuaJIT serializer to the list of supported codecs (#7543)
And swap the Calibre metadata cache to it.
2021-04-13 18:11:39 +02:00
NiLuJe
22b9396696
Centralize one time migration code after updates (#7531)
There have been a couple of these this month, and keeping stuff that should only ever run once piling up in their respective module was getting ugly, especially when it's usually simple stuff (settings, files).

So, move everything to a dedicated module, run by reader.lua on startup, and that will actually only do things once, when necessary.
2021-04-13 17:54:11 +02:00
NiLuJe
f2e90f505b
Input: Minor cleanups (#7542)
* TimeVal: Log the results of the COARSE probes in debug logs
* GestureDetector: Print details of failed clock probes in debug logs
* GestureDetector: Skip the BOOTTIME probe when CLOCK_BOOTTIME is unsupported.
* Input: Decode ABS_DISTANCE events in debug logs
* Get rid of duplicated <linux/input.h> constants, use the FFI module everywhere (re #7536)
* Kobo: Get rid of the `touch_alyssum_protocol` quirk. Replace it by setting `main_finger_slot` to `1`, like on the H2O.
2021-04-13 17:53:15 +02:00
Glen Sawyer
b6b332e311
Fix for PR #7415 breaking reMarkable touch input (#7536)
The Wacom pen reports sane CLOCK_REALTIME timestamps, but the Touchscreen reports timestamps frozen at the boot time ts (in REALTIME) :s.

So, make everyone use synthetic CLOCK_MONOTONIC timestamps in order to make gesture detection behave.
2021-04-12 18:54:12 +02:00
NiLuJe
b8d0cc4c35
Calibre: Minor QoL fixes (#7528)
* CalibreMetadata: Get rid of the now useless NULL-hunt: here, this was basically looking for `rapidjson.null` to replace them with... `rapidjson.null` :?. IIRC, that's a remnant of a quirk of the previous JSON parser (possibly even the previous, *previous* JSON parser ^^).
* CalibreSearch: Update the actually relevant NULL-hunt to make it explicit: replace JSON NULLs with Lua nils, instead of relying on an implementation detail of Lua-RapidJSON, because that detail just changed data type ;).
* UIManager: Make sure tasks scheduled during the final ZMQ callback are honored. e.g., the Calibre "Disconnect" handler. This happened to mostly work purely by chance before the event loop rework.
* Calibre: Restore a proper receiveCallback handler after receiving a book, in order not to break the "Disconnect" handler's state (and, well, get a working Disconnect handler, period ^^).
* Calibre: Unbreak metadata cache when it's initialized by a search (regression since #7159).
* Calibre: Handle UTC <-> local time conversions when checking the cache's timestamp against the Calibre metadata timestamp.
* Bump base (Unbreak CRe on Android, update RapidJSON)
2021-04-12 02:31:53 +02:00
hius07
ad924e3c1c
Dict/Wiki lookup results window: improve the 'pencil' button (#7523) 2021-04-10 22:08:59 +00:00
hius07
25b40fd1b6
Input dialogs: do not allow blank input cont'd (#7516) 2021-04-10 22:08:29 +00:00
NiLuJe
d31dc1e450 FileManager modules: Slightly less hackish onSetRotationMode handlers...
And, also, rotate the parent widget (i.e., FM/RV) to avoid leaving the
user with a broken layout when they exit in a different orientation ;).
2021-04-10 00:39:49 +02:00
NiLuJe
e27925f4bb FileManagerShortcuts: Handle rotation events 2021-04-10 00:39:49 +02:00
NiLuJe
99372e8c63 FileManagerCollection: Handle rotation events 2021-04-10 00:39:49 +02:00
NiLuJe
a185290549 FileManagerHistory: Handle rotation events
Fix #7518
2021-04-10 00:39:49 +02:00
NiLuJe
5f9f7ce1da ReaderBookmark: Don't confuse bookmarks with highlights
Attempting to update a highlight when matching on a bookmark doesn't
make sense, and no longer works since #7411

Also, switch to ipairs(), and stop piggybacking on a new local that
shadows or uses the function's item argument.
It works in Lua, but it's super weird and error-prone.

Fix #7520 (regression since #7411).
2021-04-10 00:39:49 +02:00
NiLuJe
a62561e81e Fontlist: Move cache file in a subdirectory, so as not to mess with
Cache's state tracking

Re #7510

Legacy cache has to be deleted in Cache,
*before* the first getDiskCache call.

Reword the "Clear caches" Dev menu entry & callback:
We now have an actual "Restart" action (on most, if not all, platforms).
And we clear the whole cache folder, which may host other things (e.g.,
fontlist)
2021-04-10 00:39:49 +02:00
hius07
17e6049e30
Inputtext: don't allow the cursor to move within a hint (#7507) 2021-04-05 12:59:15 +02:00
gbyl
d3f3e37f23
hidden setting: highlight lighten factor (#7497) 2021-04-05 10:02:41 +02:00
NiLuJe
e4adcdf422 ReaderHighlight: Allow customizing the highlight lightening factor.
Followup to #7497
2021-04-05 09:54:59 +02:00
NiLuJe
01224e5f49 Hide the zoom spiel when swicthign to continuous mode with reflow
enabled.

Zoom modes are disabled w/ reflow since #7463

Fix #6572
2021-04-05 09:54:59 +02:00
hius07
aef1e271b5
[UX] Search dialogs: don't close when searching with nothing entered (#7501)
File search, Fulltext search, Search dictionary, Search Wikipedia, DictQuickLookup: do nothing when nothing entered and search is pressed.
2021-04-04 17:27:17 +02:00
zwim
10922561dd
Add update of the top and bottom status bars, on +/-Charging (#7379) 2021-04-04 12:17:09 +02:00
Frans de Jonge
627065c354
Add a period (#7493) 2021-04-04 08:53:34 +02:00
NiLuJe
cbfcb2373d
ScreenSaver: Get rid of automagic settings (#7496)
By which I mean, explicitly initialize default settings, making everything seven hundred billion percent less weird.

Also, split the background option between image and (solo) message, because the defaults for those are different, and trying to twist the one into the other was leading to pure madness.
2021-04-04 03:28:45 +02:00
NiLuJe
03e9fac156
Input: Process input events in batches (#7483)
Requires https://github.com/koreader/koreader-base/pull/1344 & https://github.com/koreader/koreader-base/pull/1346 (fix #7485)

Assorted input fixes:

* Actually handle errors in the "there's a callback timer" input polling loop.
* Don't break timerfd when the clock probe was inconclusive.

Not directly related, but noticed because of duplicate onInputEvent handlers:

* HookContainer: Fix deregistration to actually deregister properly. "Regression" extant since its inception in #2933 (!).
* Made sure the three plugins (basically the trio of AutoThingies ;p) that were using HookContainer actually unschedule their task on teardown.
2021-04-03 01:48:35 +02:00
poire-z
25aabd69d9 Style tweaks: remove "Toggle alternative EPUB content"
With MathML support, this is no longer all or nothing.
As it's quite rare and technical, let this be handled
via user style tweaks.
2021-04-02 23:05:51 +02:00
poire-z
bc5881668e TOC: highlight first chapter on page instead of last
So its in sync with the chapter shown in the footer,
which was previously fixed with a482baac.
2021-04-02 23:05:51 +02:00
poire-z
fbb4f21720 Notifications: add some top margin
68a5fcdb moved them a bit to near the top than before,
and it can overlap with CRE rendering progress bar.
Also makes it nicer when multiple notications are stacked.
2021-04-02 23:05:51 +02:00
poire-z
247085ad3e Font menu: open on page with currently selected font
Generic feature added to TouchMenu: an optional callback
'open_on_menu_item_id_func()' set on an items table can
tell which menu item should be shown when opening a menu.
TouchMenu: allows jumping to first or last page with
long-press on the chevrons.
2021-04-02 23:05:51 +02:00
hius07
052e19ead5
Standardize search/find to search (#7398)
* Change 'Find a file' to 'File search' for consistency

There is 'File search' in the Gesture manager already.
There is 'Fulltext search' in the readermenu.
Some help text added.
2021-04-02 17:59:29 +02:00
hius07
b907386933
Fulltext search: show notification when nothing found (#7436) 2021-04-01 11:19:36 +00:00
NiLuJe
8a923e3e77
Input: Followup tweaks to #7415 (#7478)
* Actually load librt properly on old Linux systems (fix #7472)
* Made sure SDL & Android honored timeouts properly in some edgy (or not so edgy, in SDL's case) cases (c.f., https://github.com/koreader/koreader-base/pull/1343).
* Try harder not to consume a timer callback when the timerfd backend is in use and `select` timed out *not* because of a timerfd expiring. This would take some particularly heinous timing to reproduce (e.g., a timerfd set, but a task deadline expiring *before* it). May or may not help with #7473.
* Decode `BTN_` KEY codes in verbose debug logs.
* Fix MultiTouch on the H2O (GestureDetector was hard-coding the two slots as 0 & 1, but the H2O kernel is a special snowflake that doesn't use slot 0, instead switching to slot 1 & 2).
2021-04-01 04:30:48 +02:00
NiLuJe
dfc9d16a19
ScreenSaver: Fix default settings (#7479)
* ScreenSavers: Fix default settings

Awesome typo ;D.
2021-04-01 03:39:25 +02:00
hius07
91262f9647
File manager: some broken actions for parent folder (#7475)
For parent folder (..):
disabled `Copy`, `Cut`, `Delete`, `Rename`.
enabled `Paste`, `Set as HOME folder`.
2021-03-31 22:37:08 +02:00
NiLuJe
766ec91a84
ReaderFooter: Workaround a bad interaction with ReaderHighlight (#7466)
Related to hold handlers.

Fix #7464
2021-03-30 20:01:38 +02:00
Frans de Jonge
975e2d4b80
Add DBNL footnotes styletweak (#7467)
`.voetnoten` is standard in DBNL ebooks.

A good test book can be found at <https://www.dbnl.org/tekst/veld028jnot01_01/>.
2021-03-30 19:13:37 +02:00
NiLuJe
f0f69e9a7a
ReaderZooming: Fix defaults handling (#7463)
It appears the fancy split settings from #6885 were not being honored at all.

Also:

* Made sure "pagewidth" is actually the default zoom mode again, "full" had sneaked in as the default state of the zoom type toggle).
* Display human-readable values in the "Make as default" popup, instead of the raw, meaningless numerical setting.
* Disable zoom options when reflow is enabled, and restore 'em properly when it's disabled.

Fix #7461, #7228, #7192
2021-03-30 18:47:52 +02:00
poire-z
b9ffc3d05b
bump crengine: add support for MathML (#7465)
Includes (among others):
- LVImg: Tweak JPEG decoding some more
- toStringV2(): fix (again) when target node is a boxing node
- LVFontCache::find(): give more weight to first fonts in list
- Page splitting: more accurate rendering progress
- getRenderedWidths(): fix nowrap around image/inlineBoxes
- Tables rendering: tweak column widths algorithm
- CSS: parse/handle "currentcolor", default for border-color
- CSS: add units 'ch' (just like 'ex')
- SVG images: proper alpha blending
- MathML: add parsing and rendering support files
- MathML: plug MathML code into crengine core
- MathML: <epub:switch/case/default>: accept MathML
- (Upstream) Make crengine.font.fallback.faces plural
- (Upstream) Option to not limit font size to a set
- Text: dont adjust space after consecutive initial marks/dashes
- Update German hyphenation patterns
2021-03-30 15:25:13 +00:00
Hzj_jie
ffc7ccb576
PluginLoader should update lookup_path_list if data_dir is not ".". (#7447)
Should update lookup_path_list instead of extra_paths

It looks like a problem introduced by dee72a431c (diff-b3b0e0e90ea7b43a9d97a1c7572acef3f1dc7d1d2f75fe634345a1b841c624fa).
2021-03-30 10:02:06 +02:00
NiLuJe
1f15184bbb
Kindle: Fix gyro events on Zelda (#7459)
* Kindle: Fix gyro event on Zelda

Like on Kobo, only honor the face-up events.
2021-03-30 03:05:10 +02:00
NiLuJe
6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
2021-03-30 02:57:59 +02:00
Frans de Jonge
7a925a3caf
Improve fit to … help text (#7462)
Cf. https://github.com/koreader/koreader/issues/7461#issuecomment-809582341
2021-03-29 20:32:38 +02:00
NiLuJe
e33476996a
Rotation icons: make 'em dynamic. (#7440)
Followup to #7306.

As discussed there, the only way to make everybody happy is to make 'em context-aware. At which point, trying to make the fact that it's a *device* rotation and not a *content* one come across in the icon design loses its interest, and would actually only further muddy the issue.

So, these are similar is spirit to the traditional rotation icons in pretty much anything that can rotate text content, with a special inspiration from the Kindle 4 & PocketBook UI.

Fix #7429
2021-03-29 05:12:22 +02:00
NiLuJe
f3341d9dc0
PdfDocument: Unbreak highlights (#7457)
Regression since #7411
Fix #7456
2021-03-29 05:11:02 +02:00
hius07
17129915f9
Standardize directory/folder to folder (#7410)
Follow-up to https://github.com/koreader/koreader/pull/7328
2021-03-28 13:35:56 +02:00
NiLuJe
b325fa4a50
Initial KOA3 support (#7446)
* Move MXCFB capchecks to front

The fact that this was halfway in front/halfway in base was weird and
mistake-prone (c.f., the amount of times I forgot to update one bit or
the other).

* Initial KOA3 support

Assume it's essentially a KOA2. Meaning no warmth handling for now.

* Bump base

https://github.com/koreader/koreader-base/pull/1339
https://github.com/koreader/koreader-base/pull/1338
2021-03-26 17:13:27 +01:00
poire-z
79f0b8a132
TOC settings: fix ticks disappearing (#7443)
Don't assume self.ticks is usable, but get them updated
with :getTocTicks(), even after a :resetToc().
2021-03-23 13:40:30 +00:00
Toromtomtom
3706196bfe
Update PDF annotations when changing bookmark text (#7411) 2021-03-23 10:31:52 +01:00
John Beard
70c79fd27d
Unbreak HTTP authentication (#7425)
Fixes a regression in #7405 that broke Basic auth (OPDS/WebDav).
2021-03-21 14:00:13 +01:00
NiLuJe
2944d53e7e
DictQuickLooup: Fix a few bad interactions with ReaderHighlight's dialog (#7432)
* Disable the Search button when docless and highlight-less.
* Make sure launching a Search closes ReaderHighlight's dialog in all cases. Fix #7430
2021-03-21 13:57:18 +01:00
NiLuJe
861214ce2a
Kobo: Allow toggling the WAIT_FOR_UPDATE_COMPLETE hack (#7431)
* Allow toggling the MXCFB_WAIT_FOR_UPDATE_COMPLETE bypass

* Drive-by: enable the abort_on_crash menu on Pb & rM, since they support
it
2021-03-21 10:56:21 +01:00
poire-z
932df881b4
TOC settings: fix possible crash (#7434) 2021-03-20 19:27:07 +01:00
NiLuJe
2f9db25969
Unify LuaSocket usage (#7405)
* Add a new socketutil module with a few helper functions that allow us to:
  * Always use a sane User-Agent (previously, only Wikipedia did so)
  * Set timeouts in an almost sane manner. Doing it explicitly prevents an interaction with KOSync that does crazy stuff I don't even want to try to understand.
* Unified said timeouts based on the request's intended usage (except for Wikipedia, which already had meaningful timeout values).
* Stopped using LuaSec directly, LuaSocket defers to LuaSec sanely on its own. Everything now transparently supports HTTPS without code duplication.
2021-03-15 01:25:10 +01:00
hius07
89c0578c8d
SkimToWidget: swap '1' and '10' buttons (#7408)
More logical buttons allocation, increasing from left to right.
2021-03-14 00:10:30 +01:00
NiLuJe
41182349bc
Re-implement the PB fb fixup insanity (#7404)
* Re-implement the PB fb fixup insanity

It's apparently still necessary on a number of devices.
Fix #7072

* Bump base

(Fix FBInk on the same devices, for another reason).
2021-03-10 18:11:58 +01:00
NiLuJe
0b3747927c
WakeupMgr: Minor usage tweak (#7400)
* Unify logging with AutoSuspend (e.g., keep ourselves to showing the delay in seconds, not the raw timestamp, as that's way harder to interpret, and the RTC module and/or logger will do that for us when the time comes).
* Speaking of, minor revamp of RTC related logging to make it more human-readable.
* On Kobo, if we hit the unexpected wakeup limit, re-engage AutoSuspend's *suspend* check, so that the device has a chance to poweroff instead of being kept awake.
2021-03-10 02:21:02 +01:00
Glen Sawyer
3f0654f530
Hold "Wi-Fi" menu to show network selection instead of auto-connecting (#7395)
* Hold "Wi-Fi connection" to show network connection options.
* Honor backend connections (e.g., if wpa_supplicant found a matching AP in its own config first).
* When user clicks "Wi-Fi connection" in menu, only prompt if state is ambiguous.
2021-03-10 02:16:17 +01:00
NiLuJe
601d2fc3d2
Screensaver: Unbreak screensaver_stretch_images (#7403)
* Screensaver: Unbreak screensaver_stretch_images

We don't have real ternary operators in Lua, if the second argument evaluates to false, it doesn't work.
Invert the test to avoid this pitfall.
(c.f., http://lua-users.org/wiki/TernaryOperator).

Fix #7402, regression since #7371

* Free a few similar constructs (incidentally, some of 'em also tweaked in #7371 ^^).
2021-03-10 02:14:26 +01:00
NiLuJe
0674e6060a
Screensaver: Fix a fallback snafu (#7397)
* Screensaver: Don't assume a missing show_message setting means that type
setting is, too.
2021-03-08 06:30:14 +01:00
NiLuJe
08648d8870 Menu/KVP: Make sure icons are hidden when no items are to be shown.
Fix #7394
2021-03-08 01:29:29 +01:00
NiLuJe
681c00ecac Screensaver: Use the current ReaderUI instance if available.
Instead of always opening the document & docsettings twice...
2021-03-08 01:29:29 +01:00
NiLuJe
fba0b8eec7 Kobo: Refresh the system clock on resume.
Mimics Nickel's behavior, should fix #7092

Thanks to @gtalusan for the pointers ;).

Bump base

(https://github.com/koreader/koreader-base/pull/1322)
2021-03-08 01:29:29 +01:00
NiLuJe
bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
2021-03-06 22:44:18 +01:00
Glen Sawyer
15ef1a3a1b
reMarkable 2 clean wakeup from sleep (#7345) 2021-03-06 21:03:20 +01:00
Martín Fernández
eb57c4e0da
Add a couple of modern android dicts (#7359)
https://play.google.com/store/apps/details?id=gaurav.lookuppro and its free version.

From https://www.mobileread.com/forums/showpost.php?p=4097548&postcount=8
2021-03-06 19:32:01 +01:00
yparitcher
78c34e60fa
FileSearcher: Do not crash on space, show unsupported files if enabled. (#7362) 2021-03-06 19:31:39 +01:00
NiLuJe
32b070f3ac
Dispatcher: nil guard against access to a document instance (#7389)
Also:
* Properly update *all* the touch zones when rotating the FM
* Unbreak (Reader) rotation labels in Dispatcher
Regression since #7306
2021-03-06 19:27:23 +01:00
NiLuJe
b75ea3da03
ReaderFooter: Fix some interactions between margins and text width (#7391) 2021-03-06 19:23:12 +01:00
Frans de Jonge
c0423401aa
A few more directory to folder (#7386)
Cf. https://github.com/koreader/koreader/issues/7350#issuecomment-789672442
2021-03-05 17:49:33 +01:00
NiLuJe
9bcaae6eeb
Remove an unwanted truncation. (#7378)
This *should* be a float ;).

c.f., https://github.com/koreader/koreader/pull/7335#discussion_r586548610
2021-03-03 19:39:22 +01:00
Frans de Jonge
8bdf2c5e75
Add explanation for shorten home folder (#7365)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4098071#post4098071>.
2021-03-02 10:33:05 +01:00
NiLuJe
5303165bf9
ReaderDogEar: Enforce a minimum size, too (#7369)
* Add a semi-transparent version of the dogear icon
* Ensure the dogear won't become too tiny to be useful
2021-03-01 01:35:55 +01:00
NiLuJe
f9635bc41b
WiFi: Handle inconsistent states a tad better. (#7368)
* NetworkManager: Use a dedicated prompt if Wi-Fi is enabled but
disconnected.
2021-03-01 01:35:12 +01:00
josdion
3d8d40d797
Add Bulgarian keyboard layout (#7367) 2021-02-28 19:59:02 +01:00
Frans de Jonge
4f7f6169a6 Change a few more directory strings to folder
Fixes <https://github.com/koreader/koreader/issues/7350>.
2021-02-28 11:20:28 +01:00
Frans de Jonge
8b72ddb5de Fix nativation typo to navigation 2021-02-28 11:20:28 +01:00
NiLuJe
0e130d6a17
ReaderSearch: Switch to a real InputDialog (#7360)
Instead of piggybacking on InputContainer's onInput trickery for hold_input & tap_input.

Also, don't flag the buttons from that InputDialog as vsync, because that was stupid ;).

Fix #7357
2021-02-28 04:13:05 +01:00
NiLuJe
c2db948ff2
KeyValuePages: Handle not having anything to show slightly better (#7353)
By disabling the pagination buttons, and showing a specific label, like Menu (https://github.com/koreader/koreader/pull/7347#issuecomment-786768640)
2021-02-26 23:04:11 +01:00
NiLuJe
26b9ab2505
Minor followup to #7335 (#7347)
* Unify SortWidget's pagination button (it was using a tap_input, which is why I'd missed it ;)). (https://github.com/koreader/koreader/pull/7335#issuecomment-785628495)
* Menu*: Remove redundant screen-layout updates from `_recalculateDimen`, as it should only be concerned with item layout (https://github.com/koreader/koreader/pull/7335#discussion_r582072032)
2021-02-26 00:48:05 +01:00
NiLuJe
525b1957b9
[RFC] Pagination UI shenanigans (#7335)
* Menu/KeyValuePage/ReaderGoTo: Unify the dialogs. (Generally, "Enter page number" as title, and "Go to page" as OK button).
* Allow *tapping* on pagination buttons, too. Added spacers around the text to accommodate for that.
* Disable input handlers when <= 1 pages, while still printing the label in black.
* Always display both the label and the chevrons, even on single page content. (Menu being an exception, because it can handle showing no content at all, in which case we hide the chevrons).
* KVP: Tweak the pagination buttons layout in order to have consistent centering, regardless of whether the return arrow is enabled or not. (Also, match Menu's layout, more or less).
* Menu: Minor layout tweaks to follow the KVP tweaks above. Fixes, among possibly other things, buttons in (non-FM) "List" menus overlapping the final entry (e.g., OPDS), and popout menus with a border being misaligned (e.g., Calibre, Find a file).
* CalendarView: Minor layout tweaks to follow the KVP tweaks. Ensures the pagination buttons are laid out in the same way as everywhere else (they used to be a wee bit higher).
2021-02-25 05:15:23 +01:00
NiLuJe
d243097d75
ScreenSaver: Delay footer/header repaint if screensaver_delay is enabled (#7334)
Fix #7327
2021-02-24 00:36:05 +01:00
Anton
013a6076c1
External link: adds "Show QR code" (#7310) 2021-02-23 23:45:32 +01:00
poire-z
0883202e07
bump crengine: CSS line-break/word-break, various fixes (#7342)
Includes:
- LVString: Fix a c/p issue in lString8::atoi64
- LVTextFm: Simplify and fix resizeImage logic
- LVXMLParser::ReadText(): fix parsing at buffer boundaries
- TextLang: fix lang_tag first part comparison
- CSS font-family: fix parsing of 'inherit' and '!important'
- CSS: support a few -epub-* and -webkit-* properties
- Text fragment flags: add LTEXT_HAS_EXTRA
- CSS: add support for 'line-break' and 'word-break'
2021-02-23 20:19:49 +01:00
poire-z
37af0fd6ea
TOC: expand to show all chapters on current page (#7339) 2021-02-23 01:49:59 +01:00
NiLuJe
64611e6acb
Legacy Kindle: Actually handle (system) power events (#7336)
Otherwise, ScreenSaver handling doesn't work, duh'.
I have no idea how I managed to get that working the last time I tested
it :?.
Possibly I tested the final code on a K4 and not a K3?

Fix #7333
2021-02-22 18:55:24 +01:00
Frans de Jonge
1bd4636a03
Standardize directory/folder to folder (#7328)
Closes <https://github.com/koreader/koreader/issues/7157>.
2021-02-22 18:44:16 +01:00
NiLuJe
75356f2837
flash_ui: Workaround potential EPDC races (#7332)
* flash_ui: Yield to the kernel between the HL and the UNHL/CB to let the EPDC do its thing in peace.
* UIManager: Handle nils in task scheduling arguments.
* SkimTo: Use the same, thicker chapter nav icons as ReaderSearch (fix #7326).
* SkimTo: The bookmark toggle button doesn't require a vsync flag.
2021-02-22 02:09:44 +01:00
NiLuJe
e582036c3e
TouchMenu: Workaround an EPDC race in the hold handler w/ flash_ui (#7325)
* Also bump base, because it's mildly related

https://github.com/koreader/koreader-base/pull/1312
2021-02-21 06:26:04 +01:00
poire-z
8a0d798e9e KeyValuePage: configurable items per page
Tweak building to start from items per page instead of
a fixed item height.
Guess the best font size that fit.
Update separator specification from using a "----" to
the now generic separator=true (this allows not wasting
a slot for each separator in the page and not have
only 12 items and 2 small lines in a 14 items page).
2021-02-20 21:30:31 +01:00
NiLuJe
572900bfff When displaying a *date* (as opposed to a *time*), pad the hour with
blanks if necessary in order to get a consistent alignment.

Fix #7316
2021-02-20 19:43:15 +01:00
NiLuJe
588acfe31e DictQuickLookup: Properly scroll back to top when updating a
ScrollTextWidget

Despite a similar API between ScrollTextWidget and ScrollHtmlWiget, what
they do internally doesn't quite match.

So, while ScrollHtmlWidget's resetSCroll *does* rewind back to the top,
ScrollTextWidget's doesn't, it just updates the scrollbar itself.
So, do that on our end, *before* the (re-)init, which'll call
_renderText for us.

Fix #7318
2021-02-20 19:43:15 +01:00
NiLuJe
e6a946a048 Menu: Enable/Disable the pagination Button properly
Otherwise, the dim state isn't updated properly, because Button trusts the state flag.

Regression since 6132e8c904

Fix #7317
2021-02-20 19:43:15 +01:00
poire-z
173d9600f0
Bookmarks dogear: fix position with CRe top status bar (#7312)
Draw it below the CRe top status bar rather than over it.
2021-02-20 19:25:06 +01:00
poire-z
00aef60e17 Goto dialog: use "Go to Page" also with CreDocuments 2021-02-20 19:13:03 +01:00
poire-z
05c8cd2155 SkimToWidget: remove title bar, add bookmark button
Remove the title bar, as it was just taking uneeded
space over the book content.
Add a middle button in the top row to toggle bookmark
for the current page.
Rework the UI building to get more consistent and
aligned buttons and progress bar.
Move SkimToWidget from apps/reader/ to ui/widgets/.
2021-02-20 19:13:03 +01:00
poire-z
0f7722d4a6 TOC settings: add bind chapter navigation/titles to ticks
Add 2 convenience settings, allowing ToC ignored depths
settings to apply further than just the progress bars.
2021-02-20 19:06:51 +01:00
poire-z
d63d282806 History: avoid opening non-existent files
Mostly just so we don't get the History closed when
erroneously tapping on a deleted file.
2021-02-20 19:06:51 +01:00
NiLuJe
fe10d0bce5
Revamp flash_ui handling, once more, with feeling ;) (#7262)
* Simplify flash_ui handling (by handling the unhighlight pre-callback, c.f., #7262 for more details).
* UIManager: Handle translucent window-level widgets (and those wrapped in a translucent MovableContainer) properly in setDirty directly, making sure what's *underneath* them gets repainted to avoid alpha layering glitches. (This was previously handled via localized hacks).
* Update UIManager's documentation, and format it properly for ldoc parsing, making the HTML docs more useful.
* ReaderView: Reinitialize the various page areas when opening a new document, to prevent poisoning from the previous document.
* Event: Handle nils in an event's arguments.
* CheckButton/RadioButton: Switch to simple inversion to handle highlighting
* CheckButton: Make the highlight span the inner frame's width, instead of just the text's width, if possible.
* AlphaContainer: Fix & simplify, given the UIManager alpha handling.
* MovableContainer: When translucent, cache the canvas bb used for composition.
* Avoid spurious refreshes in a few widgets using various dummy *TextWidgets in order to first compute a text height.
* KeyValuePage: Avoid floats in size computations.
2021-02-20 18:22:48 +01:00
NiLuJe
1cdc6c61e0 Strip trailing slash from the URL in About popup 2021-02-20 18:19:17 +01:00
NiLuJe
1820c616a1
[RFC] Switch ConfigDialog's rotation toggle to custom icons (#7306) 2021-02-20 18:08:27 +01:00
NiLuJe
467264f59f
ScreenSaver: Don't expand special tokens with an empty string (#7314) 2021-02-20 18:03:13 +01:00
poire-z
6132e8c904 Button: don't handle long-press when not enabled
It was only not handled when hold_callback. Do that
also when hold_input/hold_input_func.
Also fix the handling of HoldRelease (as the Hold may
change the state of 'enabled', so we can't rely
on it to guess the Hold is being handled by Button).
Menu: prevent long-press on "No choice available",
as there's then no page to navigate to.
2021-02-16 17:05:32 +01:00
poire-z
e44c170f59 Wikipedia results: fix images not updated across results
Some results fields were forgotten by the "smarter update"
from a38881a9.
2021-02-16 17:05:32 +01:00
Rex Kerr
2510ff4847
Reversing commit 2348cd, changes to warmth values (#7296) 2021-02-16 08:07:29 +01:00
Frans de Jonge
35ff6776a5
[fix] Remove OPDS menu entry from FilemanagerMenu (#7291)
Fixes #7290.
2021-02-15 09:28:41 +01:00
Frans de Jonge
9f2c45284b
[chore, documentation] Fix up util.stringStartsWith/stringEndsWith LDoc comments (#7292)
Cf. <https://github.com/koreader/koreader/issues/7286#issuecomment-778855817>.
2021-02-15 09:28:22 +01:00
Rex Kerr
2348cdb066
Improved ramp-down of warm-light after max hour (#7272)
previously: warm light stays at 100% for 3 hours and then drops by 50% per hour
now: warm light stays at 100% for 4 hours and then drops by 15% per hour
2021-02-13 02:39:47 +01:00
NiLuJe
d8fc28df97
Page Overlap: Fix rectangle computation and arrow mode (#7269)
* In ReaderPaging, the panning step pre-PanningUpdate can be wildly overshot near page edges, so, use the corrected value instead by recomputing it after the panning has been effectively computed by ReaderView.
This fixes slight inaccuracies, as well as glaring mistakes when going backwards, or when near page edges.
This is in line with how ReaderRolling computes the value, which I only realized later because I'm an idiot. 
* Minor cleanups around the handling of the dim_area Geom object in general.

* Fix the "Arrow" page overlap mode to be painted in the right coordinates when going backward. Issue might not have been terribly clear because of the previous issue ;).
* Center the arrow's point, while we're here.
* Don't use AlphaContainer to make it translucent, because AlphaContainer is horribly broken, and has weird quirks and behavior that make no sense to me unless some very specific and unlikely constraints are met, and they definitely aren't here.
This fixes the arrow copying an arrow-sized square of the original page the book was opened on on the top-left corner of *every* page with an arrow. (lol).
* Do real proper alpha-blending via Icon/ImageWidget from the original icon, instead of faking it via addBlitFrom, in order to avoid the dimming *around* the triangle's shape.
2021-02-10 20:06:41 +01:00
poire-z
6059958ab6
File browser settings: reorganize into Settings submenu (#7259)
Move classic file browser settings from CoverBrowser plugin
into FileManagerMenu, so they are available when this
plugin is disabled (as they also apply to everything
based on Menu).
2021-02-09 12:41:17 +01:00
Frans de Jonge
ac668ecb64
Add a few more mimetypes for OPDS (#7258)
Doesn't include application/zip as CBZ, but it will be downloaded (as ZIP).

Doesn't include CBR since that's not supported.

Closes #7218, closes #5997.
2021-02-07 19:11:45 +01:00
NiLuJe
82f0e68118
Button: Fix some more weird highlighting corner-cases (#7256)
Namely, the Terminal plug-in and its chain of InputDialog on top of each other (via the "Save" button, which opens a whole new fs InputDialog to set the filename, while keeping the file's fs InputDialog open).
2021-02-07 18:29:32 +01:00
NiLuJe
23affc7414
Menu: Properly unhighlight menu items with a callback that doesn't do anything (#7254)
Fix #7251
2021-02-07 18:28:55 +01:00
NiLuJe
9e862e1126
TextViewer: Flag as a modal (#7255)
It's used that way in a few contexts (e.g., View HTML).

Fix #7249
2021-02-06 21:10:44 +01:00
Martín Fernández
5c9e649804
move opds to plugin (#7237) 2021-02-06 19:09:31 +01:00
poire-z
c7e97ca3cb
Highlight dialog: fix 'Follow Link' button not shown (#7250)
Since 7bd59330: some checks can't be done at init(),
and have to be done at onShowHighlightMenu() time.
2021-02-06 16:59:09 +01:00
Frans de Jonge
893026a2ef
[chore] Fix a few Persian keyboard luacheck issues (#7253)
Cf. <https://github.com/koreader/koreader/pulls#issuecomment-774345230>.
2021-02-06 16:27:02 +01:00
poire-z
3b89e32069 [UX] Add ToC/Bookmarks settings
- Menu widget: allow specifying the number of items per
  page and the item font size, so we can use other values
  than the default File browser ones
- Menu: fix setDirty when a border is used
- ToC: add item per page and font size settings, make
  Alternative ToC more visible (was previously
  available on long-press on Table of contents)
- Bookmarks: add item per page, font size, size reduction
- Progress bars (Skim widget and footer): allow selecting
  ToC depths from which ticks are made.
2021-02-05 23:58:32 +01:00
poire-z
316107a1cb ReaderRolling: fix possible crash in scroll mode
When opening a document in scroll mode with an invalid
last_xpointer.
This code path was never taken before 05126b94, and it has
never been updated to pass the page number in scroll mode
(so it's provided to the footer) like it has been in other
places.
2021-02-05 23:58:32 +01:00
Monirzadeh
6f50d67b5d
[UX] Add Persian keyboard (#7222)
Fixes #5791.
2021-02-05 21:30:09 +01:00
Frans de Jonge
cf3fed252a
[chore] Properly set CoverImage menu order (#7239)
Reported by @pazos in <https://github.com/koreader/koreader/pull/7237#discussion_r570395126>.
2021-02-05 12:56:31 +01:00
NiLuJe
d4d5dd25ba TextViewer: Allow tweaking the region of the refresh done on close.
Use it in ReaderBookmarks to clear flash_ui highlights.

Fix #7230
2021-02-04 06:30:16 +01:00
NiLuJe
b41567e0e6 ConfigDialog: Check alt_name_text if name_text isn't set,
as it is used for the "Set as default" popup.
This allows having that text accurate on widgets without an
actual name_text (e.g., the font size wheel).

Fix #7231

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-02-04 06:30:16 +01:00
NiLuJe
285fc75aa7
Button: Better handling of translucent MovableContainer (#7223)
* DictQuickLookup: Preserve alpha when switching dict, and scrolling
inside a dict.

* Start moving the NumberPicker alpha hack to Button itself

This makes handling flash_ui easier and saner, avoiding flickering.

* Handle the transparency hack entirely from within Button

* Murder the now unnecessary NumberPicker update_callback hack

* Tweak comments

* And the Button handling made that redundant, too

* Squish debug print

* More comment tweaks

* Reset transparency on scrolling instead of rpeserving it

* Reset alpha when switching dictionaries

* Simplify the pre/post callbakc transparency state handling

And explain why we need to care.

* Give a named reference to ButtonDialog's MovableContainer, so the Button
alpha hack behaves with it

* Document the "self.movable" convention

* Amend that comment a bit

e.g., we don't care much about MultiConfirmBox'w MpvableContainer, as
any button action will close it.

* And make SkimTo's MovableContainer accessible so that Button can grok
that it's translucent
2021-02-02 04:27:14 +01:00
Martín Fernández
4a89c93290
Remarkable1 wifi (#7216)
* add wifi support to Rm1
* remarkable: common suspend for all models
2021-02-02 03:19:37 +01:00
poire-z
68a5fcdbc1 Notifications: stack them instead of overdrawing them 2021-02-01 23:57:47 +01:00
poire-z
cdafd9438c Georgian keyboard: remove unused variable (luacheck) 2021-02-01 23:57:47 +01:00
Beka Arabuli
f665a25e70
Georgian keyboard (#7225) 2021-02-01 22:35:15 +01:00
poire-z
a192a335f1 Footer: tweak auto refresh code
Make it similar to how it's been done recently for CRe
alt status bar, avoiding scheduling when not needed.
2021-01-31 22:39:01 +01:00
poire-z
062bb68335 Alt status bar: full repaint on font size change 2021-01-31 22:39:01 +01:00
NiLuJe
a38881a9f7
Fix a few things after #7166 (#7212)
* Switching between HTML/text dicts (Fix #7209)
* Updating the scrollbar and scroll state properly when switching dicts
* Highlights in SortWidget
* Highlights in the Dictionary Download page
* Minor simplification of the tail end of the update process in ImageViewer
2021-01-31 02:51:40 +01:00
zwim
3118d0dba0 Refresh AltStatusBar once a minute, if there are changes 2021-01-30 19:07:12 +01:00
poire-z
49e2d91afb Don't toggle the footer when toggling the top status bar 2021-01-30 19:07:12 +01:00
poire-z
8ee7dcf342 Top menu: long-press on truncated menu item to show full text 2021-01-30 19:07:12 +01:00
poire-z
05126b94b6 Dual pages: shown as 2 columns on a single page
Rework Dual pages code so that the view is considered
a single page number, so it looks more like 2-columns
on a single page.
This solves a few issues like:
- Page number and count are consistent between top
  and bottom status bars
- SkimTo -1/+1 doing nothing every other tap
- Statistics being wrong (like "Pages read" never
  going over half of the book page count)
2021-01-29 01:32:52 +01:00
poire-z
7779e2d8e7 CRe: use getDocumentRenderingHash() to detect rendering changes
Instead of just relying on document full height
and number of pages.
2021-01-29 01:32:52 +01:00
poire-z
fbdff1c672 CRe top status bar: ensure 12-hours clock setting 2021-01-29 01:32:52 +01:00
poire-z
8ff50a9e24 CreDocument: disable crengine image scaling options
Since their handling in crengine has been re-enabled.
2021-01-29 01:32:52 +01:00
poire-z
a482baac5b Footer current chapter: use first chapter on page instead of last 2021-01-29 01:32:52 +01:00
poire-z
564db73cd8 TOC: show en-dash on empty titles 2021-01-29 01:32:52 +01:00
poire-z
e74c28efa9 CRe TOC, Bookmarks: show marker when jumping 2021-01-29 01:32:52 +01:00
NiLuJe
df0bbc9db7
Tame some ButtonTable users into re-using Buttontable instances if possible (#7166)
* QuickDictLookup, ImageViewer, NumberPicker: Smarter `update` that will re-use most of the widget's layout instead of re-instantiating all the things.
* SpinWidget/DoubleSpinWidget: The NumberPicker change above renders a hack to preserve alpha on these widgets almost unnecessary. Also fixed said hack to also apply to the center, value button.

* Button: Don't re-instantiate the frame in setText/setIcon when unnecessary (e.g., no change at all, or no layout change).
* Button: Add a refresh method that repaints and refreshes a *specific* Button (provided it's been painted once) all on its lonesome.

* ConfigDialog: Free everything that's going to be re-instatiated on update
 
* A few more post #7118 fixes:
  * SkimTo: Always flag the chapter nav buttons as vsync
  * Button: Fix the highlight on rounded buttons when vsync is enabled (e.g., it's now entirely visible, instead of showing a weird inverted corner glitch).
  * Some more heuristic tweaks in Menu/TouchMenu/Button/IconButton
* ButtonTable: fix the annoying rounding issue I'd noticed in #7054 ;).

* Enable dithering in TextBoxWidget (e.g., in the Wikipedia full view). This involved moving the HW dithering align fixup to base, where it always ought to have been ;).

* Switch a few widgets that were using "partial" on close to "ui", or, more rarely, "flashui". The intent being to limit "partial" purely to the Reader, because it has a latency cost when mixed with other refreshes, which happens often enough in UI ;).

* Minor documentation tweaks around UIManager's `setDirty` to reflect that change.

* ReaderFooter: Force a footer repaint on resume if it is visible (otherwise, just update it).
* ReaderBookmark: In the same vein, don't repaint an invisible footer on bookmark count changes.
2021-01-29 00:20:15 +01:00
Glen Sawyer
34b177aa69
Wifi toggle for reMarkable 2 (#7122)
reMarkable 1 is no-op for the moment
2021-01-19 21:09:17 +01:00
Jason Benwell
41ab04b49e
Fix crash attempting to set compact items in status bar (#7172) 2021-01-19 21:07:56 +01:00
NiLuJe
0c76c73e4f
Assorted fixes after #7118 (#7161)
* I'd failed to notice that ButtonTable *also* instantiates seven billion Buttons on each update. Unfortunately, that one is way trickier to fix properly, so, work around its behavior in Button. (This fixes multiple issues with stuff using ButtonTable, which is basically anything with a persistent set of buttons. A good and easy test-case is the dictionary popup, e.g., the Highlight button changes text, and the next/prev dic buttons change state. All that, and more, was broken ;p).

* Handle corner-cases related to VirtualKeyboard (e.g., Terminal & Text Editor), which screwed with both TouchMenu & Button heuristics because it's weird.

* Flag a the dictionary switch buttons as vsync

(They trigger a partial repaint of the dictionary content).

* Flag the ReaderSearch buttons as vsync

They very obviously trigger a partial repaint, much like SkimTo ;p.
2021-01-18 16:51:25 +01:00
Cali-Co
66eb939936
[feat] Add skimming support for Non-Touch devices (#7163)
Fixes #6866.
Replace InputContainer with FocusManager for easier DPad Handling.
Add ProgressBar jump via key Q to P, corresponds with 0% to 100%.

Tested on K3 and SDL. Should be safe for devices with touch.
2021-01-18 11:59:04 +01:00
Frans de Jonge
1ef6d0b257
[feat] Support mimetypes in DocumentRegistry:hasProvider() (#7155)
And make .djvu the canonical extension for DjVu.

Fixes #5478.
2021-01-17 09:22:48 +01:00
Glen Sawyer
7753577616
[reMarkable] Don't need to keep attempting WiFi connection after success (#7121)
If we're in range of multiple known WiFi Access Points (including multiple instances of the same SSID), we don't need to keep trying to connect after the first successful connection.

Minimal change would have been replacing the return inside the foreach function with return [a non-nil value].
But foreach is deprecated, and since I was touching the code anyhow, I figured I'd do that tiny update as well.
2021-01-16 21:44:47 +01:00
Frans de Jonge
5c9dc850e8
Address assorted Weblate comments (#7154)
* Fix typo in dropbox

Reported by @lescheck

* Rephrase text justification explanation more elegantly

* CoverBrowser: fix up some plurals

* Statistics: remove random use of template function

* Use ngettext for minute/minutes and second/seconds

* Change KB/MB/GB to kB/MB/GB SI units
2021-01-16 21:40:00 +01:00
Jason Benwell
cd6e2d9975
Make status bar prefix compact items a bit more compact (#7153)
For battery level, show icon only
Reduce separator between items to " " from "  "
2021-01-16 15:30:43 +01:00
NiLuJe
dffe86dfe9
Cleanup eye-gouging madness around io.read calls (#7149)
* Don't reinvent the wheel when reading a one-line int or string from sysfs

* Simplify a whole other bunch of read calls
2021-01-16 04:41:46 +01:00
Martín Fernández
f52fffd467
Mark calibrecompanion plugin as obsolete (#7147) 2021-01-15 20:31:44 +01:00
NiLuJe
183e0a2e25
Bump android-luajit-launcher (#7137)
* Check available width when using a viewport

* Mention that available_width should always match width
2021-01-13 21:43:46 +01:00
poire-z
396d1fbf46
bump crengine: parsing, lists, 2-pages mode fixes & tweaks (#7138)
Includes:
- EPUB: fix truncated HEAD>STYLE stylesheet
- XML parsing: slightly better parsing of <script>
- Update German hyphenation patterns
- (chore) Silence some clang warnings
- (Upstream) CSS content: fix regression with open-quote/close-quote
- (Upstream) HTML lists: support the 'reversed' attribute
- (Upstream) Tweak list items disc/circle/square symbols
- 2-pages mode: option to skip geometry checks

CRE bottom menu: allow toggling Dual Pages in portrait mode.
2021-01-13 20:26:14 +01:00
Martín Fdez
1148e46651 migrate fontlist to persist 2021-01-13 15:00:13 +01:00
Martín Fdez
b8f0dc3752 add table persistence module 2021-01-13 15:00:13 +01:00
NiLuJe
47b0d4089a
Remember the final rotation during Reboot/PowerOff/AutoSuspend, too (#7133)
Re #7096, Fix #7125

Co-authored-by: yparitcher <y@paritcher.com>
2021-01-12 22:31:38 +01:00
Jason Benwell
f53fa1d323
[UX] Footer: add prefix option "Compact items" (#7127)
For a compact layout, with removed/shortened spaces.
2021-01-12 02:04:15 +01:00
poire-z
9b11497652 KOPT bottom menu: hide it when applying Zoom options 2021-01-12 00:34:30 +01:00
poire-z
b92c078e9c ConfigDialog: temporarily hide when showing SpinWidgets
Hide bottom panel when showing a SpinWidget, so we gain
on the bottom the space covered by the SpinWidget to see
more how a change is affecting the book text.
For clarity, rename delay_repaint & refresh_callback
to hide_on_apply & when_applied_callback.

Normalize SpinWidgets: have them both accept a
cancel_callback and a close_callback.
InfoMessage: call dissmiss_callback also on timeout.
2021-01-12 00:34:30 +01:00
poire-z
4043ba27b0 CRE: fix to Top/Bottom margins fine tuning
Rework eb66856d so that "Sync T/B Margins" is disabled
when set Top and Bottom margins differ (previously,
the bottom one was taking over the top one when
it was enabled).
2021-01-12 00:34:30 +01:00
poire-z
8f79c662cf Notification: closed by any event, but not consuming it
Make Notification have toast=true, and UIManager deal
specifically with such widget:
a "toast" widget gets closed by any event, and let
the event be handled by a lower widget.
This should allow us to not wait or tap to get rid
of a notification, and just go on with what we're
doing.
Also make them have a default timeout of 2s,
used with all existing ones.
2021-01-12 00:34:30 +01:00
poire-z
f1046f07a9 Dispatcher: increase hold_step for usability 2021-01-12 00:34:30 +01:00
Markismus
67ca9c35f5
Prevent sdcv from interpreting search term starting with dash as an option (#7134) 2021-01-11 14:32:10 +01:00
zwim
8991ec1372
Align wording of AltStatusBar menu to the bottom one (#7130)
Also change to "Font size (%1)"
2021-01-10 19:37:51 +01:00
NiLuJe
47568ae9b4
ScreenSaver: Unbreak "disable" mode (#7124)
* Unbreak "disable" mode

Regression since f67296942f
2021-01-10 01:51:32 +01:00
NiLuJe
3060dc81af
Revamp "flash_ui" handling (#7118)
* Wherever possible, do an actual dumb invert on the Screen BB instead of repainting the widget, *then* inverting it (which is what the "invert" flag does).
* Instead of playing with nextTick/tickAfterNext delays, explicitly fence stuff with forceRePaint
* And, in the few cases where said Mk. 7 quirk kicks in, make the fences more marked by using a well-placed WAIT_FOR_UPDATE_COMPLETE

* Fix an issue in Button where show/hide & enable/disable where actually all toggles, which meant that duplicate calls or timing issues would do the wrong thing. (This broke dimming some icons, and mistakenly dropped the background from FM chevrons, for example).
* Speaking of, fix Button's hide/show to actually restore the background properly (there was a stupid typo in the variable name)
* Still in Button, fix the insanity of the double repaint on rounded buttons. Turns out it made sense, after all (and was related to said missing background, and bad interaction with invert & text with no background).
* KeyValuePage suffered from a similar issue with broken highlights (all black) because of missing backgrounds.
* In ConfigDialog, only instanciate IconButtons once (because every tab switch causes a full instantiation; and the initial display implies a full instanciation and an initial tab switch). Otherwise, both instances linger, and catch taps, and as such, double highlights.
* ConfigDialog: Restore the "don't repaint ReaderUI" when switching between similarly sized tabs (re #6131). I never could reproduce that on eInk, and I can't now on the emulator, so I'm assuming @poire-z fixed it during the swap to SVG icons.
* KeyValuePage: Only instanciate Buttons once (again, this is a widget that goes through a full init every page). Again, caused highlight/dimming issues because buttons were stacked.
* Menu: Ditto.
* TouchMenu: Now home of the gnarliest unhilight heuristics, because of the sheer amount of different things that can happen (and/or thanks to stuff not flagged covers_fullscreen properly ;p).

* Bump base
https://github.com/koreader/koreader-base/pull/1280
https://github.com/koreader/koreader-base/pull/1282
https://github.com/koreader/koreader-base/pull/1283
https://github.com/koreader/koreader-base/pull/1284

* Bump android-luajit-launcher
https://github.com/koreader/android-luajit-launcher/pull/284
https://github.com/koreader/android-luajit-launcher/pull/285
https://github.com/koreader/android-luajit-launcher/pull/286
https://github.com/koreader/android-luajit-launcher/pull/287
2021-01-10 01:51:09 +01:00
poire-z
475bb648b0 Margins info msg: show left/right margin values
As we can now tweak them independantly.
2021-01-10 01:14:48 +01:00
poire-z
ebf997dd99 DictQuickLookup: allow continuous reading with keys
We could scroll a definition with keys. Now, when
reaching top or bottom, switch to prev/next result.
2021-01-10 01:14:48 +01:00
poire-z
27b493afef Fix selected word non-highlighted on PDF
Optimisation for CRE from dd74194e made it not work with
KOpt-based documents.
2021-01-10 01:14:48 +01:00
poire-z
9ec3dcb376 ReaderDictionary: fix possible crash with Wikipedia
Also reword some "...canceled" to "...interrupted"
for consistency.
2021-01-10 01:14:48 +01:00
zwim
a44c178d74
show AltStatusBar when changing the font size (#7119) 2021-01-08 16:06:54 +01:00
yparitcher
1c9c40fb95
Save rotation across restarts (#7096) 2021-01-07 23:58:30 +01:00
yparitcher
00556715f4
Dispatcher: update document.configurable (#7116)
So ConfigDialog knows about changed settings and
properly reflects their states.
2021-01-07 23:19:23 +01:00
Martín Fernández
5ec0b049d9
Add deprecation messages to plugins (#7101)
And deprecate Goodreads plugin.
2021-01-07 23:15:32 +01:00
poire-z
6c23d29a8a ReaderDictionary: tweak timings if interrupted quickly
Rework b66d0be3 and 6205f260 by making that simpler
to comprehend:
- If interruption or search result window is shown in
less than 3 secondes: no specific tweak, a tap outside
will dismiss everything instantaneously.
- If done after 3 seconds: show the interruption or result
window, and discard input for a few 100ms.
- UIManager:discardEvents(): increase a bit default delays.
2021-01-07 23:10:24 +01:00
poire-z
02ac2c4ce6 DictQuickLookup: re-add "tap on title" to set as preferred dict
Restore feature removed in c98dfef7: tap on title
to set dict of current result as a preferred dictionary
for this document.
Changes from former implementation:
- trust sdcv for ordering, instead of doing it ourselves
  by looking at the results (which didn't always work)
- allow setting multiple preferred dicts
- order of preference is shown with a number as a prefix
  to the dictionary name in the title
- taping again allows removing it from preferred dicts,
  and taping again allows setting it back as the first
  preferred dict
2021-01-07 23:10:24 +01:00
poire-z
dc80321688 Search: fix matches not highlighted on current page
Regression (typo from cut and paste) from 7bd59330.
2021-01-07 23:10:24 +01:00
zwim
1a61e79a2c
Add menu to configure the top/alt status bar in crengine (#7107)
Allows toggling from the UI some crengine settings
related to the top status bar (which previously could
be done by editing cr3.ini).
2021-01-07 21:22:40 +01:00
yparitcher
dc964f3941
reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
2021-01-07 20:38:10 +01:00
NiLuJe
34b764dc06 Kindle Legacy: Probe for SO on the K3 & K4 2021-01-06 20:14:21 +01:00
NiLuJe
1925f6e653 ReaderFooter:
* Flush mode to settings ASAP when an unrelated option updates the mode.
    Fixes, among other things, *enabling* the progress bar while the status
    bar is hidden: this showed it, but kept mode as "off".
  * Don't stomp on the current mode when toggling the progress bar.
    And *always* pop the status bar back up to see the difference, even if
    it's hidden.
    This used to be done only when *enabling* the progress bar.
2021-01-06 20:14:21 +01:00
NiLuJe
f67296942f ScreenSaver:
* Don't try to expand a screensaver message without any special tokens
  * Don't needlessly nil the background when show_message is true
    Honor the actual nil background setting, now that we've got one.
    Also, only clear covers_fullscreen with no background *and* no widget.
  * Support special tokens outside of ReaderUI. Because the undocumented
    "Oops, I'll use the fallback otherwise" was extremely not
    user-friendly.
2021-01-06 20:14:21 +01:00
NiLuJe
b119e29218 NetworkActivity: Fix an exceedingly unlikely crash.
If you're *extremely* unlucky, the scheduled check might run *right*
after a wakeup, before the network interface is up. So, you have a
previously stored packet count, but the new one is nil. Boom.
2021-01-06 20:14:21 +01:00
NiLuJe
5ae5c99197
Legacy Kindle: Unbreak screensavers (#7112)
* The K2 & DXg cannot be SO, so, bypass the check there

* Handle native screensavers on FW 3.x & 4.x
2021-01-06 16:50:58 +01:00
poire-z
eb66856d81
CRE: allow both Top/Bottom margins fine tuning (#7104)
By having the same DoubleSpinWidget launched when
hitting "..." on any of Top margin or Bottom margin
progress bars.
DoubleSpinWidget: remove blank space when no info_text.
2021-01-02 23:15:48 +01:00
poire-z
6205f26047 Dict, Trapper: prevent dismissal by past events
Add UIManager:discardEvents(), to allow dropping events
for a period of time.
Default duration of 600ms on eInk, 300ms otherwise.
Used when showing the dict result window, so that a tap
happening just when it's being shown won't discard it.
Used with Trapper:confirm()/:info(), to avoid taps made
in a previous processing to dismiss (and so, select the
cancel action) a ConfirmBox not yet painted/visible.
2021-01-02 11:50:32 +01:00
poire-z
b6323f15fc DictQuickLookup: hold prev/next buttons go to first/last result 2021-01-02 11:50:32 +01:00
poire-z
aedab2d695 Dict/Wiki lookup: less text cleanup on manual input
Don't cleanup input text as much when entered manually
(or when it's sane) than when coming from book text
selection.
This may allow looking up words like "-suffix", or
do more precise Wikipedia queries.
2021-01-02 11:50:32 +01:00
NiLuJe
5756f1f43e
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
2021-01-02 03:00:39 +01:00
NiLuJe
a5468ba385 Fix opacity of the dictionary window
Brainfart from 6162c287e8

Forgot to zap the original UIManager:show(), so we were stacking two
identical widgets on top of each other, which obviously affected alpha.

Re #7029
2021-01-01 13:35:10 +01:00
Jason Benwell
32b28c0b80
Footer: add "Pages left in book" as footer item (#7047) 2020-12-31 23:48:16 +01:00
poire-z
f96585ece8
htmlToPlainText(): tweak format paragraphs with indentation (#7095)
Rework dafaf966, with a tabulation instead of multiple
&nbsp; to ensure a constant indentation when text
is justified.
2020-12-31 23:23:05 +01:00
poire-z
c98dfef7fc DictQuickLookup: various tweaks
- Rework widget layout to avoid implicit (and wrong)
  sizing, using proper padding/margins and correct
  measurements of components.
- Adjust lookup word font size so it's not smaller
  than the definition.
- Tweak small window positionning: keep it centered
  if possible, only move it to keep the highlighted
  word shown when we can.
- Large window: adjust to screen size correctly,
  leaving room for footer.
- Always have a "Close" button at bottom right.
  Former always displayed button "Follow link" will
  be added as a 3rd row in the rare case we select
  a word in a link.
- Replace "tap on lookup word to edit and redo the
  query" with an icon on the right: tap on it to
  edit the queries word, long-press to edit the
  current result word. Only close the current dict
  window when lookup is launched.
- Remove feature "tap on title to set current dict
  as the default dict for this document", as it didn't
  really work, and it was bad UX.
2020-12-31 13:28:08 +01:00
poire-z
b66d0be3f9 ReaderDictionary: show nothing if interrupted quickly
If interrupted quickly just after lookup launch, don't
display anything (this might help avoiding refreshes
and the need to dismiss after accidental long-press
when manipulating the device).
2020-12-31 13:28:08 +01:00
poire-z
cac7db1a1c InfoMessage: allows being drawn only after a delay
- InfoMessage: add an option show_delay.
- MovableContainer: avoid possible crash when
  not yet painted.
- ReaderDictionary: use show_delay=0.5 instead of
  scheduleIn(0.5n...) (a5b133da) as we need the
  InfoWidget to be known to UIManager to catch tap
  and allow interrupting lookups properly.
- ReaderDictionary: rework handling of no_refresh_on_close
  (6162c287) with proper regions comparisons
2020-12-31 13:28:08 +01:00
poire-z
dd74194e0a cre.getWordFromPosition(): fix a few issues
Drop the use of crengine's getWordFromPosition() which
is a bit unreliable: it may returns wrong coordinates,
or words from far away in the book (ie. when holding
in the margins).
Rely only on the robust getTextFromPositions() that
we already use for multi words selection.
Having good coordinates allows refreshing a smaller region
(the higlighted word, or the 2 lines if hyphenated).
2020-12-31 13:28:08 +01:00
John Beard
0e494169f2
Keyboard input in InputText (#7037)
For text input, use the SDL events, which contain the decoded
strings.

Still handle keypresses for non-text input.
2020-12-30 22:26:40 +01:00
John Beard
fca87b5b3a
UI: Clicking menu icon returns to top of menu (#7074)
Fixes: #6940
2020-12-29 23:08:49 +01:00
Glen Sawyer
3bd3493014
Fix double-pressing reMarkable 2 power button twice to wake up (#7065) 2020-12-28 19:09:10 +01:00
Glen Sawyer
578f92e424
Time-adjust on all reMarkable events, not just EV_ABS (#7066) 2020-12-28 19:08:28 +01:00
gbyl
d2379fc6e6
remarkable: poweroff.png ghosting fix (#7051) 2020-12-27 14:13:23 +01:00
Frans de Jonge
a96181d74f
Fix typo in "remove bookmark?" (#7062) 2020-12-27 14:10:43 +01:00
John Beard
12d1604a75
UI: Make button radius match default window radius (#7054) 2020-12-26 22:49:57 +01:00
NiLuJe
f1f439d08b
More Android trickery (#7059)
* Modernize jit syntax

It's built-in, no need for a require anymore.

* Flag Android should_restrict_JIT again

It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/281
2020-12-26 20:23:51 +01:00
Frans de Jonge
b8bed49a61
Pass dict_path to dictionary fix_html_func (#7057)
That way images can be made to work in a more generic, portable manner, such as:

```
return function(html, dict_path)
    html = html:gsub('<rref[^>]*>([^<]*%.jpg)</rref>', '<img src="'..dict_path..'res/%1">')
    return html
end
```

Cf. <https://github.com/koreader/koreader/issues/6056>.
2020-12-26 18:30:19 +01:00
yparitcher
4548ced866
Quickstart: add long press sets default (#7048)
add wiki reference
2020-12-26 12:46:14 +01:00
Frans de Jonge
53909db687
Close Lua state on all os.exit() calls (#7050)
Cf. <https://github.com/koreader/koreader/pull/7044>.
2020-12-25 16:19:16 +01:00
NiLuJe
21af9144ab
Don't paint invisible background-colored rounded corners (#7046)
* Don't paint invisible background-colored rounded corners

Made obvious when testing #7042

* Only enforce a highlight radius on buttons that don't already set a
custom one ;).

(Mostly, square buttons with a 0 radius ^^).

ffi/blitbuffer already handles radius being nil, which suits us just fine
:)
2020-12-25 00:39:13 +01:00
Frans de Jonge
dafaf966e4
htmlToPlainText(): Format paragraphs with indentation (#7027)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4072308#post4072308>.
2020-12-24 15:38:18 +01:00
Frans de Jonge
ad08ce9849
OPDS: Inform and warn about downgrade attack (#7032)
Fixes <https://github.com/koreader/koreader/issues/7007>.
2020-12-24 15:37:19 +01:00
Galunid
d5103bddc3
Add fall back to text selection option to panel zoom (#6960)
* Add fall back to text selection option to panel zoom
* Add functions to allow per extension settings
2020-12-24 09:07:27 +01:00
yparitcher
b2b9b49859 ReaderActivityIndicator: fix isStub()
it was being overridden by the EventListener:new

caused by #7002

c.f. https://www.mobileread.com/forums/showthread.php?t=335886
2020-12-23 23:49:53 -05:00
yparitcher
405c48b6ea Show only 1 End Document Dialog at a time
if scrolling past the end of a document the EndOfBook event get fired once per scroll (a lot)
2020-12-23 23:43:54 -05:00
yparitcher
c3fd6ae38b Margins: allow direct input (more_options) 2020-12-23 23:42:34 -05:00
NiLuJe
d845741b15
Android: Don't mark the platform as should_restrict_JIT (#7024)
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/278
https://github.com/koreader/android-luajit-launcher/pull/275
2020-12-24 02:37:03 +01:00
NiLuJe
09c1f35191
rM: Unbreak PowerEvents (#7043)
Most of this is scheduled with delays for reasons, so this was a stupid
idea, my bad ;).

Fix #7033
2020-12-24 02:36:05 +01:00
NiLuJe
7df60ba0e4
OPDSBrowser: Update the title during navigation (#7034)
* OPDSBrowser: Update the title during navigation

Fix #7030
2020-12-23 14:35:54 +01:00
NiLuJe
b78d9c1576
Menu: Clear path history on close (#7028)
Move the the paths table outside of the class, make it per instance instead
2020-12-23 00:24:16 +01:00
Frans de Jonge
d355e6482d
Revert ManyBooks and Flibusta to HTTP (#7031)
Cf. <https://github.com/koreader/koreader/issues/7007>.
2020-12-22 21:47:26 +01:00
NiLuJe
a15106fcc6
NetworkManager: Slightly more accurate wifi strength icons (#7020)
* Update lj-wpaclient to get more consistent link quality values out of it
* Simplify wifi strength icon selection
2020-12-21 18:48:33 +01:00
NiLuJe
f5a7541dbb
[UX] Use a full-width plus for buttons paired with a unicode minus (#7018)
U+FF0B vs. U+002B

Because otherwise it is not, in fact, the same width as the minus, which looks weird in buttons ;).

Re #3840 & #6939
2020-12-20 20:47:40 +01:00
poire-z
9f25dc75a0
IconWidget: fix user icons directory path (#7019)
Should be `DataStorage:getDataDir()` instead of `DataStorage:getSettingsDir()`.
(`koreader/icons/` instead of `koreader/settings/icons/`) https://github.com/koreader/koreader/pull/6977#discussion_r546375434
2020-12-20 20:45:55 +01:00
NiLuJe
f4e2878a3c
Implement proper alpha-blending of SVG icons (#7011)
* Implement proper alpha-blending of SVG icons

Also, instead of doing that every time, cache a pre-composited version
that matches the screen's BB type.
This is faster, and also has the advantage of making icon highlights
behave.

Jot down a few notes about corner-cases or future improvements, e.g.,
dimming icons on non-white backgrounds, and nightmode with color icons.
2020-12-19 22:34:16 +01:00
Frans de Jonge
a5b133dadc
[UX] Wait 0.5s before showing "searching for" dialog (#7012)
Fixes <https://github.com/koreader/koreader/issues/3030>.

Cross-ref to <https://github.com/koreader/koreader/pull/6998>.
2020-12-19 20:02:09 +01:00
NiLuJe
642978c97c
FileManager: Make reinit slightly less hackish (#7006)
Much like #6958 did for plugins, registering listener twice was also a
big boo-boo.

Revamp the whole thing to make it slightly less hackish.
2020-12-19 16:27:53 +01:00
poire-z
24424e505e Update UI layout code to use new SVG icons
- Add IconWidget, use it for icons instead of ImageWidget.
  Specify icons by name only, look for them (with either
  .svg or .png suffixes) in multiple directories (including
  koreader/settings/icons/ to allow customizing them).
  Don't crash when icon name not found, shown a black
  background warning icon instead.
- Don't trust the icons' native sizes: replace
  scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
  so all icons get the same (tunable) size - except in
  a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
  properly centered in them, extend vertical line
  separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
2020-12-19 14:49:18 +01:00
John Beard
3b1b9fe7cb
Radius corners of more boxes (#6997)
This gives a more uniform look than having some boxes rectangular and some
with radiused corners
2020-12-19 08:25:00 +01:00
NiLuJe
9cda84ef2f Prevent Busted from blowing up on cdata finalizers by properly closing
opened documents...
2020-12-19 06:40:00 +01:00
NiLuJe
c0981a55d9 Make sure KindlePowerD's __gc metamethod will actually be called
* Via the newproxy hack.
2020-12-19 04:16:51 +01:00
NiLuJe
e2dd68bd13 RenderImage: Fix __gc handling for GifDocument
* Via ffi/__gc, as this is a plain table.
2020-12-19 04:16:51 +01:00
NiLuJe
7f6bc28eca BookInfoManager: Convert thumbnail compression to ZSTD
* Avoid the Lua string copies when compressing/uncompressing the bb
  thumbs
* Delay the statement reset so that the pointer returned by the BLOB
  query is actually usable ;).
* Re-use a ZSTD decompression context
* Store date & mtime for successfully extracted documents
  c.f., 10477501f9 (r44914917)
* Switch to user_version pragma to handle DB schema versioning
* Update file size/date on *each* extraction attempt.
  @poirez-z raised a good point, this ought to be useful to deem a file
  re-parseable after an update.
* Remove xutil
  Functionality has been moved to ffi/zlib & ffi/zstd
* Preserve settings when migrating the BookInfo DB
* Warn via InfoMessage that the DB was updated
* Only store the series name in series, and move the index in series_index
  (Column names chosen to match Calibre's).
* Handle the new series_index column in BookInfo consumers
* This allows us to get rid of the code that stripped empty decimals
  from series index in *most* places, since it's now a real Lua
  number, and the string formatting library does that magic on its
  own.
2020-12-19 04:16:44 +01:00
NiLuJe
c1496e943b util: Simplify splitFile* util functions
* Use a single match call instead of two gsubs
2020-12-19 01:54:43 +01:00
NiLuJe
d80d6dc562 Handle the BlitBuffer struct changes
* stride is now a size_t
  On some platforms, that's 64 bits, which means it's no longer
  automatically converted to a Lua number to avoid precision loss.
  Do that ourselves, because lua-serialize doesn't know how to handle an
  uint64_t cdata ;).
2020-12-19 01:54:43 +01:00
Frans de Jonge
db9b485e2d
[chore] Minor formatting fixes (#7009)
Cf. <https://github.com/koreader/koreader/pull/6992>.
2020-12-18 23:28:39 +01:00
ddvk
77ac32d4ac
remarkable2 support (#6992)
Fixes https://github.com/koreader/koreader/issues/6792
2020-12-18 23:12:34 +01:00
NiLuJe
17356bbb2a
Kindle: Make ReaderActivityIndicator a stub (#7002)
And only actually flesh it out and register it in the very few cases
where it can actually do something (i.e., old FW 5.x with KPV).
2020-12-18 18:26:58 +01:00
Frans de Jonge
608cc04622
Fix docs (#6999)
Follow-up to <https://github.com/koreader/koreader/pull/6973>
2020-12-16 07:40:57 +01:00
NiLuJe
83e148bc9e
Tests: Make a few things more deterministic (#6991)
This way we still get the passed/expected actual values in Busted's
output

Which helps not make this any more maddening than it already is to
update...
2020-12-15 21:10:36 +01:00
Martín Fernández
a90038e4eb
Calibre plugin fixes for android (#6996)
* calibre plugin: scan on sdcard too
* calibre plugin: force inbox chooser in android's primary partition
* downloadMgr: override dir
2020-12-15 00:46:38 +01:00
NiLuJe
248e508c7e
Deal with hr/br in a single gsub call (#6995) 2020-12-14 18:47:11 +01:00
NiLuJe
a0f4015f7d
Workaround luxl's issue with self-closing tags once and for all (#6994)
* luxl and self-closing tags, once more with feeling...

Fix #6993

* More generic fix to the self-closing tag issue w/ luxl

Re #6902 & co.
2020-12-14 18:43:23 +01:00
NiLuJe
e0ac00f310
Make sure getting rid of a DPI override actually restores default behavior (#6984)
* Make switching *back* to the default DPI via auto actually work
properly.

eg., by actually setting DPI back to defaults, and clearing the override
flag.

* Bump base to pickup https://github.com/koreader/koreader-base/pull/1258
2020-12-13 01:41:44 +01:00
NiLuJe
32bf53cfdf
ReaderFooter: Don't duplicate a 12h clock time format option (#6973)
* ReaderFooter:
	* Honor the global twelve_hour_clock setting, instead of
	  duplicating a local one.
	  (Re #6969)

* os.date is a thin wrapper around strftime, so we might be able to get
away with some not-quite-standard extensions...

These are *definitely* supported on Linux, but are *NOT* the glibc
extension (that'd be e.g., %-I), so, hopefully, they're somewhat
portable...

They are also supported on BSD/macOS.
They are *not* supported by the MS UCRT. That means MinGW-w64, too.
This *appears* to be supported on current Bionic (it might even support
said glibc format altering extensions).

* And of course, Windows is terrible, so, make this terribly ugly to not
break it there...

* Turns out BSD also supports the dash trim format extension, so, leave
the trimming to the libc, and handle the special-casing in a way that
doesn't create stupid locals.

* Random unrelated cleanup ^^.

(https://gitter.im/koreader/koreader?at=5fd24be492aa1c4ef5d11f31)

* Update the testsuite

(Because the default used to be 24h clock).

Changed the default to 24h clock ;p.

* Explain why we don't try to fix it in Lua
2020-12-12 10:44:35 +01:00
John Beard
096b3176dc
Add columns to ReaderZooming paged_modes (#6970)
This means it will warn when changing to continuous mode while
zoom to columns is active.
2020-12-11 19:28:55 +01:00
poire-z
a0eb91d6ab
Some RTL UI fix up after #6885 (#6975)
Avoid crash with RTL UI after options we moved.
Swap Zoom direction items when RTL UI.
Also don't check show_func when sizing the names
on the bottom menu, to avoid icons moving or
resizing when toggling options.
2020-12-10 23:53:33 +01:00
Martín Fernández
c481c5aa04
move unpackArchive to Device, use native version on android (#6959) 2020-12-10 16:59:14 +01:00
yparitcher
b0a1077756
FileManager: fix Plus menu override (#6957)
manage it in FM not in gestures, as  #6918 made the menu tap zone the entire width so the tap is not passed through to the gesture plugin
2020-12-07 20:30:07 +01:00
jperon
53a7067c24
FileManager: don't load already loaded plugins (#6958)
FileManager:init is called by FileManager:reinit, which caused duplicate
loads. Those can't be useful, (for example to re-load a modified plugin
on runtime), as PluginLoader:loadPlugins memoizes loaded plugins.
2020-12-07 20:29:03 +01:00
poire-z
c20ad8f5e9
RenderImage: add renderSVGImageFile() (#6950)
ImageWidget: allow picking SVG versions of provided
PNG icons if available.
2020-12-05 23:57:00 +01:00
jperon
8b7d60299f
JPG/PNG: MuPDF as default provider (#6931)
As said in #6929
2020-12-04 19:10:50 +01:00
NiLuJe
4b9627456e
Fix the frontlight gesture range scaling (#6946)
xref https://www.mobileread.com/forums/showthread.php?t=335341
2020-12-04 08:07:53 +01:00
NiLuJe
6162c287e8
ReaderDictionary: Avoid an irritating refresh when dismissing the InfoMessage (#6934)
* ReaderDictionary: Don't refresh when dimissing the lookup info
InfoMessage

Re #6932

* Fix dict_largewindow in Landscape

Have to leave some room for the UI chrome
2020-12-03 17:37:46 +01:00
NiLuJe
493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
2020-12-03 17:33:54 +01:00
Galunid
059ffc0040
Fix bad authentication handling in opds browser (#6942)
Fixes #6941.
2020-12-03 15:38:31 +01:00
John Beard
5bd055206d
Use Unicode minus in ButtonProgressWidget (#6939)
Change the text in the button from a hypen (-) to a
Unicode minus size (−, U+2212). This is the same width
as the + sign.

The NaturalLightWidget and FrontLightWidget controls
already use minus signs in this way.
2020-12-02 16:21:52 +01:00
jperon
3d8342a98c
Fix #6929 (#6930)
A check was missing on a flag not defined for images.
2020-11-30 11:21:14 +01:00
Frans de Jonge
908e3ae363
[chore] Don't translate numbers (#6928)
Cross-ref to <https://github.com/koreader/koreader/pull/6885>.
2020-11-30 10:08:03 +01:00
Frans de Jonge
575b86593f
[chore, i18n] Remove extra quotation marks (#6927)
@jperon Did my review comment about this get lost? :-/
2020-11-30 09:03:23 +01:00
Martín Fdez
be2bcac28e switch between internal and external sdcard 2020-11-29 10:19:47 +01:00
jperon
1f16815f94
[chore] Get rid of ui/data/strings.lua (#6921)
As suggested [here](https://github.com/koreader/koreader/pull/6885#issuecomment-734865881)
2020-11-29 10:18:59 +01:00
NiLuJe
bba8b31e1d
AutoSave: Delay I/O until after the pageturn (#6917)
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.
2020-11-28 22:59:27 +01:00
NiLuJe
931f01ef26
Kobo: Warn on restart if the startup script is outdated (#6916)
* 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...
2020-11-28 22:48:09 +01:00
jperon
8eeb010dc9
Paged documents: rework zoom options (#6885)
- 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
2020-11-28 17:18:57 +01:00
zwim
52f66a89d2
CoverImage plugin: enable on Remarkable and PocketBook (#6906) 2020-11-28 13:58:44 +01:00
poire-z
da95091e7b
ReaderTypography: fix language names order in menu (#6913)
Also fix just added "Latin (liturgical)" hyph filename.
See https://github.com/koreader/koreader/pull/6910#discussion_r531091283
2020-11-26 20:53:34 +01:00
jperon
16b37b5605
bump base (thirdparty, crengine), add Latin hyphenation (#6910)
Includes:
- Resync libue w/ KoboUSBMS
- Update to FBInk v1.23.0
- Update to KoboUSBMS v1.0.0
- Revert "blitbuffer: Always enable JIT workaround" (6705c028)
- BB: Ensure consistent types are being used in writePNG
- bump crengine: hyphenation: add Latin, update Esperanto
2020-11-26 16:06:46 +01:00
NiLuJe
0ae86fc0ec
ReaderFooter: Cleanup some more messy dimensions handling (#6898)
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.
2020-11-22 04:52:03 +01:00
NiLuJe
960b2ae62a
OPDS*: Mangle Calibre feeds some more so that they don't confuse luxl/us (#6902)
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.
2020-11-22 04:51:32 +01:00
poire-z
dde497a0df
ReaderCropping: prettier bottom buttons (#6900)
Also remove the grey gap between the page and the buttons
that would appear only when the footer is visible.
2020-11-21 00:19:24 +01:00
Frans de Jonge
ded8ae6efb
[lang] Minor touch-up to non-linear info text (#6895)
As an aside, it should be "ToC," not "Toc." ;-)

Cf. <https://github.com/koreader/koreader/pull/6847>.

* Also fix newlines in to be translated string
2020-11-20 09:02:30 +01:00
Jellby
5e3c554dd7 Hide non-linear fragments
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.
2020-11-18 18:28:47 +01:00
Jellby
f892d4559f Fix typos 2020-11-18 18:28:47 +01:00
Martín Fernández
4a6f8769ae
android: fix dict overrides (#6887)
- User overrides marked as false were not checked
- Actions without app were skipped.
2020-11-18 16:43:20 +01:00
Jellby
dba7112390
Footer: ensure minimum height for the in-fill in progress bar (#6878) 2020-11-18 13:06:36 +01:00
poire-z
314ac1973a Dict/Wiki: update footer on full refresh 2020-11-18 11:41:51 +01:00
poire-z
8d49b8d46b Reference page numbers list: highlight current page 2020-11-18 11:41:51 +01:00
NiLuJe
510ea5963c
[Kobo] Don't attempt to restart Nickel when asking for a reboot/shutdown (#6880)
* 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
2020-11-14 23:39:19 +01:00
Martín Fernández
d914476973
sdl: resize FM (#6882)
Required after #6309.

Uses the same logic as in android (I cannot locate the PR right now). Tested on a mac.
2020-11-14 21:15:05 +01:00
Frans de Jonge
6cc0ab8dc9
[fix] Always initiate empty context table (#6874)
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>.
2020-11-13 16:54:01 +01:00
zwim
f24d6f8aea
Update statusline immediately when toggling a bookmark (#6872) 2020-11-13 13:04:27 +01:00
jperon
c5ba8a8301
Order keys in settings.reader.lua (#6868)
* Order keys in settings.reader.lua
* Comma at the end of last item in table.
2020-11-12 20:38:11 +01:00
zwim
926e7dd402
coverimage plugin (#6813)
* Plugin for saving the cover image to file. Useful in some e-ink android devices.
2020-11-10 15:00:56 +01:00
Galunid
25cfef3f6d
Fix wording in previous commit (#6862) 2020-11-09 22:45:27 +01:00
Galunid
8a5c2e3af6
Add menu item allowing users to disable "hold on footer to show Skim Widget" (#6852) 2020-11-09 20:16:53 +01:00
yparitcher
edec69ac8b
[CRe] Tweak nightmode and CRe call cache interaction (#6859)
Simplify 4caf8f28 (#6854), allowing us not to track
nightmode in two places.
2020-11-08 22:55:11 +01:00
yparitcher
7fb20f2c55
Dispatcher: add Screenshot action (#6858) 2020-11-08 22:43:37 +01:00
jperon
7bd5933066
Methods to modify highlight menu. (#6851)
* Allow plugins to hook into highlight menu
2020-11-08 13:07:51 +01:00
tastytea
9277568a65
Apply CSS tweaks for links to all elements below a elements. (#6856)
This is for ebooks that have <span> inside of <a>.
2020-11-08 13:03:18 +01:00
NiLuJe
4caf8f281d
[CRe] Ensure toggling nightmode invalidates the drawCurrentView cache (#6854)
* 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
2020-11-08 02:18:50 +01:00
jperon
dee72a431c
Set extra_plugin_paths to data_dir/plugins (#6849) 2020-11-06 17:46:26 +01:00
Martín Fernández
91708e25d0
android-luajit-launcher refactor (#6821)
- 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
2020-11-04 19:15:07 +01:00
jperon
43ba8a1173
Qrcode support (#6844)
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.
2020-11-04 18:59:39 +01:00
poire-z
8403154d4d
Reader: rationalize "Back" key/action handling (#6840)
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.
2020-11-03 22:51:11 +01:00
poire-z
74c1813a82 GestureDetector: add Tap interval on keyboard setting
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).
2020-10-31 09:36:24 +01:00
poire-z
8f2bdf959d Style tweaks: fix some wording 2020-10-31 09:36:24 +01:00
NiLuJe
a393137273
Another round of ReaderFooter fixes (#6830)
* 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).
2020-10-27 16:48:34 +01:00
NiLuJe
c810a19040
H2O: Fix initial tap detection (#6832)
* 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
2020-10-27 16:42:22 +01:00
NiLuJe
8e1c6c8409
UIManager: Handle covers_fullscreen properly in close (#6828)
* 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).
2020-10-26 12:28:00 +01:00
Martín Fernández
40b4ccffa8
KoptInterface:getWordFromBoxes: guard against nil boxes (#6827)
Fixes #6825
2020-10-26 12:26:18 +01:00
ezdiy
144fd78986
fontlist: Skip fonts with missing family_name (#6820)
* Also don't trip on pipes
2020-10-24 13:23:05 +02:00
Martín Fernández
99ad13b13c
android: handle onDestroy (#6811)
* 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
2020-10-22 20:18:36 +02:00
ezdiy
5a86443eb1
Pocketbook: waveform presets (#6794)
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.
2020-10-22 13:23:09 +02:00
NiLuJe
dda905271d
[Kobo, Mk. 7] Enable the power LED when charging (#6810) 2020-10-22 01:17:34 +02:00
yparitcher
602e0b3feb ldoc fixes 2020-10-20 18:11:55 -04:00
yparitcher
433b82f162 Dispatcher: allow registering actions at runtime 2020-10-20 18:11:55 -04:00
ezdiy
a73bf1afda
fontlist: Cache categorized font info (for mupdf) (#6786)
Info about each face (l10n, name, family, style etc) is
now cached offline, so fonts can be queried ahead of time.

Fixes https://github.com/koreader/koreader/issues/6763
2020-10-20 06:30:41 +02:00
NiLuJe
0406be3319
Random nano optimizations (#6801)
* Don't call Screen:afterPaint if nothing was actually painted

* Stupid micro-optimization (os.)time! (pun intended :D)
2020-10-18 20:38:17 +02:00
poire-z
633d43b322 Devices: get rid of touch_probe_ev_epoch_time
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.
2020-10-18 20:13:44 +02:00
poire-z
b90f6db876 GestureDetector: add Tap interval setting, to avoid bounces
Also fix info_text not displayed, and add more
descriptive ones.
2020-10-18 20:13:44 +02:00
ezdiy
893909146d
Pocketbook: use raw input I/O (#6791)
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.
2020-10-17 12:59:24 +02:00
NiLuJe
dfe3502b91
ReaderStatistics: Data collection improvements (#6778)
* 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
2020-10-15 05:31:21 +02:00
Martín Fdez
009e2b3b94 android: reinit FM after surface change 2020-10-13 21:16:19 +02:00
NiLuJe
d2f533e5b7
A couple of hotfixes for 2020.10.1 (#6781)
* 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 #6696

Fix #6780
2020-10-11 23:08:24 +02:00
NiLuJe
ac6b121c85
Disable HW inversion on rM (#6779)
Turns out it's being weird like on Mk. 7 Kobos with a crapload of PxP
processing flags.
Except without the "crapload of flags", part :D.
2020-10-10 21:43:24 +02:00
Galunid
39faa8b860
Move numeric sort up, so it looks better (#6777) 2020-10-09 22:27:57 +02:00
NiLuJe
b932b97b20
A few reMarkable QoL fixes (#6772)
* 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 ;).
2020-10-09 19:23:57 +02:00
yparitcher
fca89a816b
InfoMessage: accept options for lang and para direction (#6766) 2020-10-08 12:58:13 +02:00
Marek Gibek
20a413389c
[UX] Add Polish keyboard layout (#6762) 2020-10-07 17:29:47 +02:00
NiLuJe
0295bfa124
ReaderFooter: Make the wonky "hide me if I'm off" behavior consistent and user-configurable. (#6754)
* ReaderFooter:
	* Make the wonky "hide me if I'm off" behavior consistent and user-configurable.
2020-10-06 05:25:37 +02:00
poire-z
eb137d720e Font menu: show font names with their own font 2020-10-06 00:34:17 +02:00
georgeto
0fa45c21cf SortWidget: Fix moving of items over several positions
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.
2020-10-05 18:22:47 +02:00
georgeto
b668791c9c SortWidget: Toggle checked status when tapping on checkmark
In a checkable SortWidget a tap on a checkmark now toggles the checkmark,
instead of selecting the corresponding item.
2020-10-05 18:22:47 +02:00
georgeto
f31bd736f7 Allow sorting of dictionaries 2020-10-05 18:22:47 +02:00
georgeto
ace3525ce1 SortWidget: Add support for checkmarks 2020-10-05 18:22:47 +02:00
NiLuJe
d6cecc9ee3
Bump base to bring in a few fixes & cleanups (#6753)
* Bump base

https://github.com/koreader/koreader-base/pull/1205
https://github.com/koreader/koreader-base/pull/1206
https://github.com/koreader/koreader-base/pull/1207

* The strcoll shenanigans have been moved to ffi/util
2020-10-05 16:34:46 +02:00
NiLuJe
e17a0d4068
Don't generate separators for empty generators (#6752) 2020-10-05 16:18:31 +02:00
poire-z
a50774003f ImageViewer: allow saving current view as an image
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.
2020-10-03 18:12:10 +02:00
poire-z
f9e06c8d8b Font: fix possible messy font sizes when geometry/dpi change 2020-10-03 18:12:10 +02:00
poire-z
8b886e5922
bump crengine: sync with upstream, new hyphenation languages (#6746)
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).
2020-10-03 15:07:07 +02:00
ezdiy
6b4188074e
Pocketbook: Fix silly rotation bug on PB1040 (#6735)
Ditto as PB740
2020-10-01 00:10:22 +02:00
ezdiy
592e54aa02
Pocketbook: Fix silly rotation bug on PB740 (#6734)
It detects B288, disables hwrot...
.... and there wasn't the isAlwaysPortrait enabled to serve as an alternative.
2020-09-30 23:27:40 +02:00
NiLuJe
ec3ec8dc21
Show full ToC entry on hold (#6729)
Fix #6728
2020-09-30 19:56:56 +02:00
NiLuJe
e169b34577
Fancier Wi-Fi status icons in ReaderFooter (#6725)
* 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
2020-09-29 01:06:41 +02:00
ezdiy
7a40b496fb
blitbuffer: fixups for base (#6714)
fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
2020-09-28 01:04:59 +02:00
NiLuJe
1ac5846eff
Revamp ToC ticks handling (#6716)
Replace the level `0` `getTocTicks` heuristic with a simple sorted, deduped flat listing of *every* ToC node (via `getTocTicksFlattened`).
2020-09-27 22:25:16 +02:00
ezdiy
25d5e9322c
Pocketbook: Try to auto-detect HW feature caps more precisely (#6721)
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 .
2020-09-27 21:35:03 +02:00
Galunid
b297fb7cf6
Panel zoom - improve output image resolution (#6709) 2020-09-25 20:14:01 +02:00
smartscripts-nl
abfba6c709
Sort folder shortcuts (#6707)
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.
2020-09-25 15:54:14 +02:00
smartscripts-nl
9a9f6f5d28
[fix] Save document settings before activating USBMS (#6713)
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.
2020-09-25 15:52:08 +02:00
ezdiy
ef8d2d0d6e
linuxfb: is_always_portrait must be passed to screen init() from all frontends. (#6712)
This is because fb driver should not be inspecting self.device for low level
caps anymore.

Fixes #6711
2020-09-25 13:20:02 +02:00
Galunid
15455b594d
[feat] Comics: zoom to panel (#6511)
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
2020-09-24 15:17:37 +02:00
NiLuJe
aeaf911758
Make sure Dispatcher doesn't pickup eInk settings on !eInk devices (#6702) 2020-09-24 05:06:13 +02:00
ezdiy
5345728cc4
Clean up C blitbuffer kludges. (#6696)
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.
2020-09-22 23:26:05 +02:00
ezdiy
d59a3e217e
Pocketbook: Implement HW screen rotation, bring in PB specific kludges from linuxfb (#6684)
* 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.
2020-09-22 22:04:37 +02:00
yparitcher
34b3d5541d Gestures/Profiles: make sure dispatcher is initalized
even when the menu is not opened. this was causing a crash when the event name was parsed from creoptions
2020-09-22 07:21:37 +02:00
yparitcher
c6ce316d4e Dispatcher: crengine contrast (gamma) 2020-09-22 07:21:37 +02:00
NiLuJe
dcb8215a3f
Fix point release and revision detection in Version:getShortVersion (#6693) 2020-09-21 21:40:48 +02:00
Frans de Jonge
a5089f0272
[i18n] Add missing bookmark count translation (#6692)
Cf. <https://www.mobileread.com/forums/showpost.php?p=4037153&postcount=8>.
2020-09-21 20:52:40 +02:00
yparitcher
3e063498fc
FrontLight: fix footer update on FL on/off toggle (#6664)
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
2020-09-20 21:48:06 -04:00
Frans de Jonge
9e96fdfb5f
[fix] Czech is now cs, not cs_CZ (#6689)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4036709#post4036709>.
2020-09-20 20:43:13 +02:00
Martín Fernández
27fe0d7957
add eudic from gplay (#6682) 2020-09-19 20:25:51 +02:00
NiLuJe
23efabb913
[PB] Fix WAIT_FOR_UPDATE_COMPLETE ioctl (#6669)
* Fix WAIT_FOR_COMPLETE ioctl (fix #6000)

* Prevent a promotion to a flashing on fg/bg toggle

* Bump base for the matching PB updates

(https://github.com/koreader/koreader-base/pull/1188)
2020-09-19 19:05:35 +02:00
poire-z
4d53ec76fe
bump crengine: ODT support, more typography languages (#6675)
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
2020-09-18 19:34:46 +02:00
poire-z
b4214d3f16 Footnote popups: allow setting an absolute font size
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).
2020-09-18 18:09:54 +02:00
poire-z
fca426c17c Footnote popups: CSS: add more styles for FB2 elements
Add styles for some more non-HTML FB2 tags, so MuPDF
can render them as expected.
2020-09-18 18:09:54 +02:00
poire-z
62d0cf5dfa Wikpedia EPUBs: fix failure saving some files
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.
2020-09-18 18:09:54 +02:00
NiLuJe
f1918cdfbb
[Kobo] Don't send a flood a FrontlightStateChanged events during the FL ramps (#6667)
* Only send a single FrontlightStateChanged event on toggle

Prevents the ReaderFooter refresh from going wonky
2020-09-17 19:49:03 +02:00
zwim
73b0c701ce
correct bug introduced with #6641 (#6665) 2020-09-17 13:16:19 +02:00
ezdiy
152ee087a8
Pocketbook: Fix frontlight handling. (#6663)
Account for InkView 5.x having different API for on/off states.
2020-09-17 11:36:58 +02:00
NiLuJe
99045b4311
Minor util & ffi/util cleanups (#6657) 2020-09-15 20:39:32 +02:00
NiLuJe
078b579081
More verbose debug logging around OPDS caching (#6653)
Re #6649
2020-09-13 22:14:05 +02:00
NiLuJe
592e4f42df
Hilariously simpler fix for #6616 (#6650)
* Hilariously simpler fix for #6616

Reverts #6648 for a much, much simpler solution, that will actually
cover every possible situation automagically.
2020-09-13 19:00:03 +02:00
NiLuJe
e0546d0fc8
Prevent automatic footer refreshes from drawing the footer on top of stuff that isn't ReaderUI (#6648)
* Prevent refreshing the footer automatically where it doesn't make sense to.

Issue exposed by #6540
Fix #6616
2020-09-12 22:57:53 +02:00
Martín Fernández
2263931b99
Pocketbook misc fixes (#6633)
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)
2020-09-12 10:47:35 +02:00
NiLuJe
c28f1b3450
Only ask to start an USBMS session when plugged into a USB host on Kobo (#6645)
* 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
2020-09-11 23:23:57 +02:00
Martín Fernández
ffa9857ff1
ftp: guard against nil file (#6640)
Fixes #6636
2020-09-09 17:59:57 +02:00
Martín Fernández
8f61bc750b
AndroidPowerD: remove unneded syntactic sugar & JNI calls (#6641)
Each JNI call has a little overhead, so don't use them when it is not needed.
The syntactic sugar is not needed to use android module's functions.
2020-09-09 17:58:44 +02:00
smartscripts-nl
16ece06d45
[UX] Add bookmark count as footer item (#6629)
Optionally display number of bookmarks in footer. If no bookmarks defined, don't show this item
2020-09-05 14:54:53 +02:00
smartscripts-nl
4e281f00ed
Dispatcher: adds Show terminal (#6626) 2020-09-03 01:14:06 +02:00
ezdiy
a110fe8686
Pocketbook: Add reboot option. (#6625)
Turns out there's an IPC command for it.
2020-09-02 23:35:59 +02:00
ezdiy
63e938f508
Pocketbook: Add file associations into "Open with" menu (#6624)
We used to put koreader alone in there, but apparently other
handlers can be left in as optional - see #6415
2020-09-02 22:44:38 +02:00
smartscripts-nl
20ddad2951
Terminal: add shortcuts for re-useable commands (#6609)
To be able to quickly repeat often used terminal commands
2020-09-02 16:09:27 +02:00
poire-z
f15aa7103f
Allow following links and footnotes with keys (#6619)
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.
2020-09-01 23:29:56 +02:00
ezdiy
4857e97e30
Pocketbook: Launcher OS integration (#6620)
* Bring in restart koreader & shutdown device exit options
* Existing instance reused for opens via native book explorer
2020-09-01 21:43:21 +02:00
ezdiy
c9a339ead0
Pocketbook: File handling OS integration (#6617)
* Show opened file in task manager
* Remember file to open on power-off
* Perform file associations
2020-09-01 17:52:16 +02:00
ezdiy
426f7b5ddc
Add API to set OS level file associations (#6615) 2020-09-01 16:39:47 +02:00
poire-z
000fb45ed9 bump crengine: TextLang, hyphenation: add Serbian 2020-09-01 15:13:01 +02:00
Strana (eng: Page)
d26ab968c9
Added Serbian typography rules (#6596)
(required crengine bump in next commit)
2020-09-01 14:37:15 +02:00
ezdiy
724d3aa5ff
PocketBook: Auto-standby plugin (#6602)
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).
2020-09-01 00:23:09 +02:00
poire-z
962fd02c98
Tame BackgroundRunner: stop running when no more job (#6605)
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.
2020-08-31 16:48:29 +02:00
smartscripts-nl
0e7f1ba317
Dispatcher: adds Texteditor: open last file (#6600) 2020-08-31 11:47:37 +02:00
ezdiy
6d3d45a93b
Pocketbook frontend: Fix up missing require. (#6604)
This one slipped through tests somehow.
2020-08-30 18:36:41 +02:00
ezdiy
3c0e14703d
Poll mode pocketbook frontend. (#6559)
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).
2020-08-30 17:27:37 +02:00
ezdiy
fd31bcc5fd
Make UIManager track prevent/allowStandby state. (#6558)
Conversely, Trapper and plugins report standby interruptibility.
2020-08-30 15:01:56 +02:00
Galunid
0d501f2308
[chore] Fix a few typos (#6601) 2020-08-30 05:27:17 +02:00
tjader
54b299b639
Fix typo (#6570) 2020-08-29 20:38:12 +02:00
poire-z
85a16d0064 Open with: add Text Editor plugin 2020-08-29 20:07:26 +02:00
poire-z
cfa45f8d88 History: show last read date instead of file size
In classic and list display modes.
2020-08-29 20:07:26 +02:00
poire-z
bafc52afd1 util: adds util.secondsToHour(), util.secondsToDate() 2020-08-29 20:07:26 +02:00
poire-z
5c1ccda314 FileChooser: allow traversing unreadable directories 2020-08-29 20:07:26 +02:00
zwim
2c1d87a956 resolve ANR on hold and native light dialog 2020-08-29 20:06:09 +02:00
zwim
6fb2a0469b
update statusline after native light dialog (#6584) 2020-08-29 16:46:59 +02:00
zwim
24af0810d2
turn on frontlight switch on Tolino. (#6586) 2020-08-29 16:42:57 +02:00
NiLuJe
e402c9d6f3
More KoboUSBMS related tweaks & cleanups (#6590)
* 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
2020-08-29 05:20:28 +02:00
zwim
06bce655c5
[chore] Remove frontlightDialog leftover (#6578) 2020-08-28 13:14:20 +02:00
Martín Fernández
c7f77de72a
refactor thirdparty app integration (#6513)
* refactor thirdparty app integration
* Fix fora package name
2020-08-27 21:41:16 +02:00
Martín Fdez
454ed0ebeb enable usage of system fonts 2020-08-27 21:40:18 +02:00
NiLuJe
1919764825
Some more KoboUSBMS tweaks (#6566)
* 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
2020-08-27 01:06:41 +02:00
poire-z
29d83b67d3 Text/HTML widgets: allow scrolling with the scrollbar
By tapping on or panning the scrollbar.
2020-08-26 23:43:10 +02:00
poire-z
69d11ebfd9 Start with: add Favorites 2020-08-26 23:43:10 +02:00
poire-z
27e953b127 Bookmarks: avoid possible crash
(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.)
2020-08-26 23:43:10 +02:00
Martín Fernández
189397e38c
android: fix frontlight dialog gesture (#6568) 2020-08-26 09:13:19 +02:00
Rodrigo Exterckötter Tjäder
9d4c85d6c1
Fix typo in font test sample (#6571) 2020-08-26 08:18:28 +02:00
yparitcher
4639b03c29
Dispatcher: incremental gesture fix (#6565)
have a user set number override a gesture (gestures will still work when set to 0), this allows incremental FL changes with a tap gesture
2020-08-25 21:07:17 +02:00
NiLuJe
af3d98aeb7
Always update the table of footer text generators (#6563)
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
2020-08-25 16:47:32 +02:00
poire-z
8d99523388
bump crengine: new HTML parser, libRu and FB2 tweaks (#6560)
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
2020-08-25 15:45:05 +02:00
zwim
66e8087c66
[android]: fix backlight toggle (#6520)
* check on startup if frontlight can be changed.
* Init fl_min if necessary not to use intensity==0
2020-08-25 14:42:39 +02:00
NiLuJe
6e3a3e8069
[Kobo] Support USBMS exports (#6552)
* \o/

* Make sure the (debug) event log doesn't end up in the fd table of our child processes...
Otherwise, it breaks USBMS.

* Close suspicious fds in the Wi-Fi scripts
To prevent any and all issues w/ USBMS down the road...

* Minor USBMS UI tweaks

* Always ask for confirmation to start on USBMS session on plug

* Bump base

https://github.com/koreader/koreader-base/pull/1161
https://github.com/koreader/koreader-base/pull/1162
https://github.com/koreader/koreader-base/pull/1163
https://github.com/koreader/koreader-base/pull/1165
https://github.com/koreader/koreader-base/pull/1167
2020-08-25 02:00:59 +02:00
NiLuJe
9abd92044a
Make sure "Clear history of deleted files" actually persists. (#6557)
* Make sure "Clear history of deleted files" actually persists.

The current code was only clearing the live table, it was forgotten after a restart.
2020-08-25 01:47:04 +02:00
Martín Fdez
09e5143d2f pocketbook: fix for devices without natural light :p 2020-08-23 14:30:14 +02:00
roshavagarga
61e9d0b40a
Specify that PocketBook 515 has no frontlight (#6549)
It doesn't have one, and having it in there might lead to issues.
2020-08-23 11:15:49 +02:00
NiLuJe
0e27963ae7
Minor flash tweaks after #6528 (#6540)
* 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).
2020-08-23 03:46:05 +02:00
NiLuJe
b5d3305876
A few e-Ink flash rate QoL tweaks (#6528)
* 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.
2020-08-21 14:33:08 +02:00
NiLuJe
1b904f0f0d
Revamp manual rotation events (#6530)
Restore a Swap event like before #6309
Implement an Invert one
And keep the fairly useless +90° CW one, but under an accurate name.

Fix #6524
2020-08-20 13:38:48 +02:00
roshavagarga
87fac74ea2
Fixes and changes to PocketBook definitions (#6533)
**Changes:**
- [x] Added new CIS-unique device definition for PocketBook 606 - [News article](https://pocketbook.ru/news/novyy-pocketbook-606/)
- [x] Added new CIS-unique codename for PocketBook Aqua (640) - [Russian manual](http://support.pocketbook-int.com/fw/640/ru/4.4.1853/manual/User_Guide_PocketBook_640_RU.pdf) (last page)
- [x] Added new CIS-unique codename for PocketBook Ultra (650) - [Russian manual](http://support.pocketbook-int.com/fw/650/ru/5.14.789/manual/User_Guide_PocketBook_650_RU.pdf) (last page)
2020-08-20 10:09:54 +02:00
yparitcher
b9311a1772
FM: rotation flush setting before reinit (#6532)
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
2020-08-20 05:31:57 +02:00
Martín Fernández
b9ffb2e0d0
pocketbook: warmth lights support (#6531)
* also enables natural light controls for the emulator
2020-08-19 22:41:10 +02:00
Teteros
01ed79fb92
Update PB633 device definition (#6529) 2020-08-19 16:24:39 +02:00
roshavagarga
a9aa63d94c
Update PocketBook device definitions (#6525) 2020-08-19 14:49:17 +02:00
poire-z
c8b8ee3ba9
bump crengine: better linebreaks at em-dash, fb2 fixes (#6521)
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.
2020-08-18 13:34:28 +02:00
yparitcher
d53dc3f890
Dispatcher: fix events with static argument (#6519)
Fixes showing Favorites from a gesture.
2020-08-18 12:41:58 +02:00
yparitcher
986f45871a
Dispatcher: show selected number (#6472)
followup to #6441
2020-08-17 09:55:03 +02:00
themanifold
23ebe39031
Support for Apache WebDAV module (#6510)
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
2020-08-17 09:54:16 +02:00
zwim
b3f64dc73b
gesture: messages and sensitivity changes for small (warmth) scales; devicelistener dedup (#6468)
* 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
2020-08-17 09:42:34 +02:00
yparitcher
5a7ecabaed
ReaderRolling: fix gotoPercent (#6503)
Before it only worked in scroll mode not page mode & it used 10000 instead of 100%
2020-08-15 21:42:27 +02:00
Martín Fernández
d935ca6937
sdl: keep track of window position and size (#6495) 2020-08-13 13:20:49 +02:00
roshavagarga
ec87d36e57
PocketBook: Add new device definitions (#6481) 2020-08-07 23:02:30 +02:00
Martín Fdez
9037a1f4f2 bump luajit-launcher and remove frontlightwidget leftovers 2020-08-06 17:19:12 +02:00
Galunid
627716db9c
Allow setting text selection rate (#6449) 2020-08-06 00:13:26 +02:00
Martín Fdez
bdbebb9e08 standalone osx application bundle 2020-08-05 13:04:06 +02:00
yparitcher
7583571707
Dispatcher Gestures Profiles: only flush settings when changed (#6471) 2020-08-05 00:19:28 +02:00
Frans de Jonge
49a5aa179b
[fix] Allow closing SortWidget (#6464)
For now, close on any keypress.

Cf. https://github.com/koreader/koreader/issues/6463
2020-08-03 15:56:44 +02:00
yparitcher
79c5e088af Dispatcher: get name from item & add separators to menu & fixes 2020-08-02 16:55:09 -04:00
yparitcher
2a99b014a2 initial refactor of ReaderGesture into Gestures plugin 2020-08-02 16:55:09 -04:00
zwim
a6763465b4
[Android]: Native light dialog (#6426)
* Adds support for Tolino Epos 2 warmth light
2020-08-02 22:27:49 +02:00
Frans de Jonge
0511cb1d48
[chore] Allow translating "Font Size" in Dispatcher (#6462)
See https://github.com/koreader/koreader/pull/6428#issuecomment-667687997
2020-08-02 20:31:21 +02:00
poire-z
517c31e3e1
bump crengine: reworked hanging punctuation (#6456)
* 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
2020-07-30 22:58:00 +02:00
Frans de Jonge
991dcab27b
Update tesseract data files URL (#6452)
Reported by @lescheck on Weblate.
2020-07-30 22:15:02 +02:00
poire-z
cd0d248dc5 fix luacheck 2020-07-30 21:37:58 +02:00
poire-z
5662712549 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.
2020-07-30 21:29:45 +02:00
Galunid
a9d0990f84
Add Set Frontlight/Set Frontlight Warmth to dispatcher (#6440)
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
2020-07-29 23:48:28 +02:00
Gauthier
f91a855dd7
add more media types to OPDS browser (#6450)
following #6443 i thought i would check the other types

application/x-mobi8-ebook is replaced by application/vnd.amazon.mobi8-ebook (see https://www.iana.org/assignments/media-types/application/vnd.amazon.mobi8-ebook)
application/djvu doesn't seem to be an official one. image/x-djvu was the previous one, and is replaced by image/vnd.djvu (https://www.iana.org/assignments/media-types/image/vnd.djvu)
2020-07-29 07:49:04 +02:00
NiLuJe
2ad976387d
More #6424 cleanups (#6442)
* Simplify logic, and more detailed debug logging
* Kill Nickel's FIFO on startup
Avoids udev/udhcpc scripts hanging when trying to open() it.
2020-07-29 03:27:04 +02:00
Gauthier
072d960b68
Add additional media types to OPDS Browser (#6443)
* Add additional media types to OPDS Browser

The media types for CBZ and CBR (added in #5940) are deprecated, and replaced by `vnd.comicbook+zip` and `vnd.comicbook+rar`. In addition, many OPDS servers will use the actual media type of the file, ie `application/zip` and `application/x-rar-compressed`.

See here about the new `vnd` types:
- https://www.iana.org/assignments/media-types/application/vnd.comicbook+zip
- https://www.iana.org/assignments/media-types/application/vnd.comicbook-rar

* added vnd.rar also
2020-07-28 17:24:31 +02:00
NiLuJe
744e933036
Minor cleanups after #6424 (#6438)
* Minor cosmetic code cleanup
* String tweak
2020-07-28 03:53:20 +02:00
yparitcher
87b1f0c1f2
simplify Dispatcher (#6435)
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
2020-07-27 21:26:56 -04:00
yparitcher
93eadbaf88
recalculate footer progress bar correctly on UpdatePos (#6436)
Closes: #6434
2020-07-26 22:38:09 -04:00
NiLuJe
37a01100b7
Various Wi-Fi QoL improvements (#6424)
* 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.
2020-07-27 03:39:06 +02:00
poire-z
1c49f817fd
Fix ConfigDialog's ButtonProgress Fine tune updating presets (#6433)
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.
2020-07-25 23:15:31 +02:00
yparitcher
2f3fda3fe8
allow some strings to be translated (#6428) 2020-07-25 15:26:26 +02:00
NiLuJe
db843929f0
Don't store document-specific rotation when sticky rotation is enabled (#6423)
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
2020-07-24 11:26:49 +02:00
Frans de Jonge
7c1a716d57
Fake battery status in readerfooter_spec to succeed on devices with batteries (#6417)
Cf. <https://github.com/koreader/koreader/pull/6370#issuecomment-662382487>.
2020-07-24 00:06:23 +02:00
NiLuJe
b4d5cfccb7
Fix a few logic holes in dithering mode selection (#6419)
* 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.
2020-07-23 06:01:46 +02:00
Martín Fernández
ca21d1401a SDL: use platform as model for desktop computers, report battery if available 2020-07-22 14:41:11 +02:00
Martín Fernández
94c0d7854f remove filechooser 2020-07-22 14:41:11 +02:00
poire-z
6e7c7bb841
Text selection: cleanup text obtained from engines (#6410) 2020-07-22 00:14:57 +02:00
Frans de Jonge
da507f8607
[chore] Update MD5 calls with new sha2 library (#6411)
Depends on <https://github.com/koreader/koreader-base/pull/1149>.
2020-07-21 23:25:46 +02:00
Martín Fdez
fca7f9e7d5 desktop/emulator 2020-07-21 00:23:05 +02:00
clach04
a328f09cc4
Fix issues #6362 - ftp corruption of binary files (#6363) 2020-07-20 22:53:52 +02:00
poire-z
cc653ef5b0 Style tweaks: limit EPUB/FB2 footnotes to these formats
Avoid conflicts having "In-page EPUB footnotes (smaller)"
affects FB2 documents that use "<a type=note>12</a>" which
would then get smaller if both tweaks are enabled (which
they are, by default).
Also switch "-cr-hint: strut-confined" from being set on "*"
to being set only on "body", now that it is inherited.
Footnote popups: add styles for some non-HTML FB2 tags,
so MuPDF can render them as expected.
2020-07-20 22:18:15 +02:00
Frans de Jonge
8e66494ec2
[fix] Use orderedPairs in touch menu item table (#6404)
Cf. <https://github.com/koreader/koreader/pull/6403> and <https://github.com/koreader/koreader/pull/6371>.
2020-07-20 20:58:39 +02:00
Frans de Jonge
45d2dff86c
[fix] MenuSorter: use orderedPairs for orphans (#6403)
Skipped in <https://github.com/koreader/koreader/pull/6371>.
2020-07-20 20:58:01 +02:00
yparitcher
e7b183382a
[fix] Set FULL_REFRESH_COUNT default value (#6400)
Set FULL_REFRESH_COUNT to a sane value if no pref is set and toggleNightMode

regression from #6386

Closes: #6398
2020-07-20 08:48:07 +02:00
yparitcher
7849d58a76
Fix footer update on UpdatePos event (#6392)
Regression from 70f89c4d (#6292).
2020-07-19 06:56:39 +02:00
Galunid
62daa7b783
Implement numeric collator (natural sorting) in file manager (#6378) 2020-07-18 13:04:39 +02:00
yparitcher
1db2b7d875
better logic for #6386 (#6388) 2020-07-17 19:37:49 +02:00
Frans de Jonge
9a5b659a46
[fix, lang] Filemanager → file browser consistency (#6387) 2020-07-17 09:57:46 +02:00
yparitcher
6671d984ed
SetNightMode event & Night Mode refresh rate (#6386)
If the user has not set a separate refresh rate for night mode
the default one will be used, as was the previous behavior

Closes: #5019
Closes: #6094
2020-07-17 08:54:21 +02:00
zwim
4349272d9c
[UX] German keyboard layout qwertz (#6385)
Add support for German keyboard. It's mainly en_keyoard.lua with changed z/Z and y/Y.
2020-07-16 21:25:02 +02:00
NiLuJe
a8da762955
Initial handling of the upcoming Kobo Nia (#6380)
Obviously untested ;p
2020-07-16 13:18:10 +02:00
yparitcher
bda44a99ef
Dispatcher: use sections (#6364)
use `device` `filemanager` `rolling` and `paging` sections to organize the
dispatcher menu and allow the user to know when the action will apply

add events from ReaderGesture

allow profiles in FM
2020-07-14 17:39:03 -04:00
NiLuJe
4e5def4282
Tame a few tests that relied on pairs being somewhat deterministic (#6371)
* Mangle stupid defaults test so that it compares tables, and not a non-deterministic string representation of one.

It's still extremely dumb and annoying to update. (i.e., feel free to kill it with fire in a subsequent PR, I think everybody would cheer).

* Rewrite DepGraph to be deterministic

i.e., fully array based, no more hashes, which means no more pairs randomly re-ordering stuff.

Insertion order is now preserved.

Pretty sure a couple of bugs have been fixed and/or added along the way
;p.

* Resync frontend/apps/filemanager/lib/md.lua w/ upstream

And use orderedPairs in the attribute parsing code, just to make that stupid test happy.
2020-07-14 18:25:26 +02:00
yparitcher
70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
2020-07-12 14:47:49 -04:00
Martín Fernández
1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
2020-07-11 01:29:49 +02:00
Martín Fdez
a376a52c3a easier user font paths with Device.home_dir 2020-07-10 15:16:38 +02:00
NiLuJe
509ee7bb86
Allow locking the gyro to the current screen mode (#6347)
* Allow locking the gyro to the current screen mode (i.e., orientation).
* Tweak the "sticky rota" option to work both ways
* More rotation constant usage instead of magic numbers
2020-07-09 19:11:44 +02:00
Martín Fernández
f9293a67b0
[fix] Remove isAllowedScript leftovers (#6366)
Fixes #6365
2020-07-09 18:11:56 +02:00
Martín Fdez
8324154177 keep newlines outside translations 2020-07-09 01:08:47 +02:00
Martín Fdez
7094519e1b android: support for native surface rotation 2020-07-09 01:08:47 +02:00
yparitcher
8f2399caa9
[fix] Allow default FM rotation on init when Keep FM rotation is disabled (#6348) 2020-07-05 17:34:44 +02:00
yparitcher
f7d538b108
Landscape FM / Refactor rotation (#6309)
* landscape FM / Refactor rotation

refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode

* bump base

update luasocket, libjpeg-turbo, curl
add logging to evernote-sdk-lua
update framebuffer for proper rotation
2020-07-01 16:17:41 -04:00
Frans de Jonge
09c654c7ec
[chore] Simplify OPDSBrowser http.request handling (#6334)
Cf. <https://github.com/koreader/koreader/pull/6307>.
2020-06-30 17:37:34 +02:00
Frans de Jonge
bb376fb16b
[feat] Add text/html to OPDSBrowser (#6335) 2020-06-30 17:37:08 +02:00
Frans de Jonge
4a3710b6d3
[i18n] Add support for fledgling Hebrew translation (#6333)
See <https://hosted.weblate.org/languages/he/koreader/> if you'd like to contribute.
2020-06-30 17:20:03 +02:00
Frans de Jonge
86db43a052
[UX] Move double tap to gesture manager (#6322)
Also replaces the default with +10/-10 pages instead of prev/next chapter.

Closes <https://github.com/koreader/koreader/issues/2721>.
2020-06-28 15:41:24 +02:00
yparitcher
5795e6d63c
Dispatcher: fix table (#6324)
accessing the table via reference rather than copying the values was breaking the configdialog
2020-06-28 12:18:45 +02:00
Frans de Jonge
7a37accdcc
[UX] Add left to close to ConfigDialog for hasFewKeys (#6318)
Follow-up to <https://github.com/koreader/koreader/pull/6195>.

Part of <https://github.com/koreader/koreader/issues/4029>.
2020-06-27 09:11:05 +02:00
Frans de Jonge
060ee98048
[feat] FocusManager: wrap around horizontally (#6315)
There doesn't seem to be a reason not to, but it could be limited to `Device:hasFewKeys()` if desired.

Cf. <https://github.com/koreader/koreader/pull/6312#issuecomment-650207697>.
2020-06-27 08:43:28 +02:00
Martín Fernández
32207523b0
emulator: add fake network manager (#6314) 2020-06-26 20:47:09 +02:00
roshavagarga
46bf88c573
Add PocketBook 614W (Basic 3) definition (#6312)
Cf. <#6311>.
2020-06-26 16:15:49 +02:00
zwim
43693c9fe9
Add the possibility run shell scripts from filemanager on android (#6288) 2020-06-25 21:33:51 +02:00
poire-z
9385728769
Bookmarks prev/next via gestures: add location to stack (#6306)
Was correctly done when jumping bookmarks via the Bookmarks
menu and the SkimTo widget, but not from gestures.
Also prevent fillToc() on each page turn when book has no TOC.
2020-06-25 21:19:50 +02:00
poire-z
71744688c7 Style tweaks: use 0.8rem instead of 80% for in-page footnotes 2020-06-25 14:51:32 +02:00
poire-z
8a568a2721 bump crengine: add support for <ruby> elements
Includes:
- Fix some non-recursive subtree walkers
- Text: skip formatting optimisations when inlineBoxes
- CSS parsing: parse selectors starting with [attrib]
- Use T="" for internal elements attributes
- CSS: re-order css_d_* (display) enum for easier checking
- Rendering methods: remove erm_table_cell
- Rendering methods: remove erm_table_caption
- Rendering methods: remove erm_list_item
- getRenderedWidths(): better estimate table width
- styleToTextFmtFlags(): adds is_block parameter
- Adds support for "display: ruby" and <ruby> elements
- Fix prev/next-VisibleWord-Start/End() with CJK text

Also bump HarfBuzz to 2.6.8 and evernote-lua-sdk.
2020-06-25 14:51:32 +02:00
Galunid
f09a4e7c8e
Translator: Add definition of the word to the translation (#6295)
closes #6293
2020-06-22 15:17:14 +02:00
NiLuJe
ff1e50c5c0
Don't rotate BookStatus & ReadingProgress in screensavers. (#6286)
They're full-screen, and they work fine in Landscape.

re: #5724

* Fix multiline indents in the Kindle c/p ;p
2020-06-21 16:27:43 +02:00
yparitcher
a9d4e97115
[plugin] Dispatcher: for profiles & gestures (#6106)
add a Dispatcher module that allows for dispatching multiple events at once.
This will allow for profiles & for gestures that do multiple things.

it has 2 methods:
Execute which is given a kv table of settings to change and fires an event for each of them.
addSubMenu adds a menu item to a menu to allow for modifying which events are called
it also has settingsList which is a master table of all allowed setting and their corresponding info
(it is mostly from ReaderGesture and needs a lot of work)

to allow for a new setting all one has to do is add a entry to settingsList with a corresponding event and it will work out of the box.

the profile plugin is right now still a stub, just to test Dispatcher. the plan is to finish it and eventually refactor ReaderGesture to rely on this.
This also needs effort to move many functions out of reader gesture into events where they belong.
2020-06-19 23:38:53 +02:00
Martín Fernández
88feefe788
[chore, UX] Move some 'permanent' settings inside more_tools (#6282)
Err, kind of nitpick PR. Is just add some "permanent" menus other than plugins to the new "more_tools" submenu. So it will never be empty.

Follow-up: #6279
Supersedes: #5512 #6092
Fixes: #5461
2020-06-19 20:40:40 +02:00
Martín Fernández
83cde64bcc
unified calibre plugin (#6177)
joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
2020-06-19 12:22:38 +02:00
Martín Fernández
2e731dd4dd
[chore] Device abstraction (#6280)
* generic Device:info() function which returns the model

* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator

* also enable fake poweroff/reboot on the emulator

* add Device.home_dir

* add Device:hasExitOptions() and update menus & comments
2020-06-19 09:41:50 +02:00
Frans de Jonge
f3489cdd24
[chore] Rename 'More plugins' to 'More tools' (#6279)
More tools is a submenu in the tools menu, not in the plugins menu. That everything in there happens to be plugins is merely a technical detail and not considered part of the unifying menu vision. Plugin management should be last as it is because it's only used once in a blue moon, if it should be in the tools menu at all. The same applies to settings more broadly. Putting plugin management in the tools menu is traditional, however.

Plugins should not and are not supposed to be most at home in the tools menu. Those plugins that happen to be in the tools menu are by and large there because that's where they fit best. Those that don't are new and I didn't have the heart or energy to make much of a fuzz about it provided they had a reasonable claim to the tools menu. That includes plugins like tweak document settings which should be more at home in settings → document.

Also see <https://github.com/koreader/koreader/issues/6105#issuecomment-621653800>.
2020-06-18 12:21:09 +02:00
Galunid
cd440acdc4
Add chapter title when exporting notes in Evernote (JSON/HTML, remote) (#6146)
closes #4566
closes #6138
2020-06-17 23:51:02 +02:00
poire-z
5aab341ed0
Fix bottom menu item titles truncation (#6273)
Revert bit from #6267 , see https://github.com/koreader/koreader/pull/6267#issuecomment-644903608.
2020-06-16 22:14:14 +02:00
Martín Fernández
765b35a7bf
android: add a toggle to ignore back button events (#6269)
Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117

It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
2020-06-15 07:43:37 +02:00
NiLuJe
b23af97914
Fix partial HW dithered refreshes sometimes appearing to shift refreshed content (#6267)
* Fix HW dithered partial refreshes sometimes behaving as if the refreshed
content had moved a few pixels to the side...

Probably a kernel issue with the alignment fixup in the EPDC?

* Get rid of the legacy coordinates fixup

It shouldn't be necessary anymore.
And I'd rather fix the root cause, anyway.

* Bump base

(https://github.com/koreader/koreader-base/pull/1116)

* Missed a few DIVs in #6224
2020-06-14 02:21:41 +02:00
Martín Fdez
835f9f62c6 fix ANRs in Kosync plugin login/register 2020-06-13 19:05:10 +02:00
NiLuJe
1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
2020-06-13 01:56:36 +02:00
NiLuJe
1384b5e97d
A few footer tweaks (allow setting height through UI) (#6257)
* * Refresh the footer instantly when changing the prefix, separator, or
  formatting.
* Allow setting the container height (formerly
  DMINIBAR_CONTAINER_HEIGHT)
* Allow setting the container bottom padding (formerly 1 flex pixel)
* Refactor ReaderFooter:applyFooterMode
  Handle toggling the genFooterText function even in all at once mode
  Make sure the layout is properly reset when changing visibility state,
  to avoid inconsistencies with complex layouts.
2020-06-11 18:49:51 +02:00
Frans de Jonge
23862fd0eb
[[doc] Add documentation to optmath (#6258)
See <https://github.com/koreader/koreader/pull/6255#discussion_r438648691>.
2020-06-11 17:05:50 +02:00
Martín Fernández
2f831bebc7
android: replace default footer margins by values that work with rounded corner devices (#6260)
That's it: replace "static 10px" margins by a value that takes device DPI into account and works with rounded corner devices.

Fixes #6157
2020-06-11 16:44:24 +02:00
NiLuJe
e3f978be2c
Allow automatically marking the book as read on end of doc (#6256)
Keep showing the "mark as" option/button, though, because that one is a
toggle, it doesn't enforce the "read" status.
2020-06-11 11:37:14 +02:00
smartscripts-nl
23ab5750c3
Fix missing glyphs Ï and Ö in keyboard popup (#6254)
Fixes #6221.
2020-06-10 22:37:44 +02:00
Martín Fdez
3e3ddbfc4b desktop: don't show which results on console 2020-06-09 17:08:48 +02:00
Martín Fernández
d87b09d11c
handle newlines in exported pdf highlights (#6247) 2020-06-09 17:07:51 +02:00
poire-z
c1be488a11 Keyboard: better isolation of FR/ES/TR from EN base
dofile() wasn't enough to copy en_keyboard, as the references
to key popups would still be shared, and hacks to them (as
done by the FR keyboard) would be active on the EN keyboard.
Also, for the FR Keyboard:
- bring M key popup too when moving it to 2nd row.
- keep original ',' and '.' as on EN keyboard.
- add ';' instead of ',' as the added key, and let it have
  some key popup too, with keys helpful when CSS editing.
2020-06-09 01:01:16 +02:00
poire-z
9af693f84c ReaderUI:setLastDirForFileBrowser(): remove trailing /
Plugins may provide that dir with or without a trailing /.
Not having a trailing / is expected by File browser to
avoid duplicate paths.
2020-06-09 01:01:16 +02:00
poire-z
886b3063e7
Style tweaks: adds "Book-specific tweak" menu item (#6244)
Allows editing a CSS snippet to be applied to this
book only, without the need to create and edit
a User style tweak.
Allows copying any other tweak CSS by just taping
on it (and pasting into this with Hold).
Limit User style tweaks nb of items per menu page
to 6 (like we try to do for other tweaks menus).
2020-06-08 20:47:31 +02:00
NiLuJe
2b5b069863
Remove a dodgy scheduleIn (#6241)
It was causing a double-refresh on orientation change via ConfigDialog

I could only reproduce it on Kindle, for some strange reason (slower?).
2020-06-08 16:36:26 +02:00
NiLuJe
64825eccd2
Update bundled fonts (#6242)
* Update bundled fonts

* Minor FreeFont update
* Noto Sans CJK downgrade to fix a number of issues w/ the git version
* Initial import of Noto Naskh Arabic

* Replace Noto Sans Arabic UI by Noto Naskh Arabic in the CRe fallback
list
2020-06-08 16:36:06 +02:00
NiLuJe
9c4e246038
Ensure feature-parity in ScreenSaver handling on Kindle (#6240)
* Ensure feature-parity in ScreenSaver handling on Kindle

We were missing the fancy extra white flash and landscape handling that
most every other eInk device gets ;).

Fix #5724

* Minor SO tweaks

The "swipe to unlock" ad screen was possibly managing to seep through on
slow devices.

* Less convoluted and more consistent logic

Thanks, @yparitcher ;).
2020-06-07 23:35:43 +02:00
sladflob
9e9f3b419d
[feat] Allow message to be overlaid on other screensavers (#6238) 2020-06-06 19:23:16 +02:00
poire-z
5536ce996a CRE: use same marks in top and bottom progress bars
Feed to crengine the same ticks (build from the TOC
entries) that we use in the bottom status bar.
(crengine otherwise builds a tick for each DocFragment,
which most often is really different than what's seen
in the bottom bar.)
2020-06-05 20:13:59 +02:00
poire-z
3e71e4985e bump crengine: support for pseudo elements ::before/after
Includes:
- GIF decoding: avoid crash on some images
- Top progress bar: avoid re-computing when not needed
- Top progress bar: allow external filling of marks
- CSS/Text: properly inherit and handle text-align-last
- getRenderedWidths(): fix handling of text-indent
- Reorder some flags to make the sets clearer
- CSS: support more white-space named values
- Text: fix standalone BR not making an empty line (rework)
- CSS: support for pseudo elements ::before & ::after
- CSS: content: open-quote support via TextLangMan
- CSS/Text selection: adds a few "-cr-hint:" tweaks
cre.cpp: adds setHeaderProgressMarks()

Added 2 style tweaks to disable pseudo elements
::before/after and common ligatures.
2020-06-05 20:13:59 +02:00
poire-z
a753f332de
Footer: skip tap lock when needed (#6225)
7d139263 was preventing some features to work,
so skip it in some cases:
When toggling between top & bottom status bar (a tap
is simulated to show the bottom bar).
When in flipping mode (jumps to page at tap position).
When toggling via menu (shown only when zero tap zone).
2020-06-04 15:56:37 +02:00
Frans de Jonge
4a65cc666b
[UX] Implement hasFewKeys prototype (#6195)
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices.

In the reader, the right is repurposed to open the menu. Left in turn closes it.

The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back.

References <https://github.com/koreader/koreader/issues/4029>.
2020-06-04 13:26:18 +02:00
Martín Fernández
879f8a7624
[Desktop] Fix missing glyphs by packaging freefonts again (#6218)
Also disable battery completely from defaults/option in desktop linux as it always return 0%
2020-06-01 08:07:42 +02:00
poire-z
b4113769e3
SkimToWidget: fix next/prev bookmark not updating it (#6216) 2020-06-01 07:13:58 +02:00
NiLuJe
95567d8af8
Disable the RTC alarm on shutdown (#6211)
* Disable the RTC alarm on shutdown

* Nice typo.

* Bump base

https://github.com/koreader/koreader-base/pull/1103
https://github.com/koreader/koreader-base/pull/1105
https://github.com/koreader/koreader-base/pull/1106
2020-05-31 23:51:21 +02:00
poire-z
fc6c786f84
Footer: fix items possibly missing (#6212)
Iterating a k/v table as an array would have us stopped
on the first disabled MODE (frontlight, battery... on
some devices).
Rework that initial setup, and make it correctly handle
added or removed MODEs when using the ordered items
saved in the user settings.
2020-05-30 22:10:32 +02:00
poire-z
03140f505c Wikipedia EPUBs: keep links in bold text bold 2020-05-29 15:07:14 +02:00
poire-z
17c686628c History: fix possible issues when saving and loading
Internal self.hist being an array, iterating it with 'pairs'
could have some strange effects. Best to use 'ipairs'.
2020-05-29 15:07:14 +02:00
poire-z
c65c33d75f
Statistics: some fixes, reordering and rewording (#6194)
- Fix wrong values for books opened (or first opened)
  from April 14th to May 20th: highlights and notes
  possibly being NULL was preventing nb of pages and
  last_open from being fetched.
- Re-order current book and all books stat items to some
  hopefully more sensible order.
- Some rewording for clarity.

KeyValuePage:
- Have value_overflow_align="right" only align right
  when value overflows 1/2 screen width, but not
  when only key overflows that.
- Show truncated text also on Tap when there is no
  callback.
2020-05-29 14:22:27 +02:00
Frans de Jonge
0fb9113078
[feat] Add Device:hasFewKeys() (#6193)
This will allow to behave subtly different in certain instances.
Cf. <https://github.com/koreader/koreader/issues/4029>.
2020-05-26 17:43:44 +02:00
Frans de Jonge
528e993eb3
[PocketBook] Add PocketBook 613 Basic definition (#6192)
Cf. <https://github.com/koreader/koreader/issues/4029>.
2020-05-26 17:07:41 +02:00
poire-z
177551918f
bump_crengine: various fixes, tweaks and cleanups (#6188)
Includes:
- Don't reset invisible BR to display: inline
- ldomTextCollector: handle inline-block/table as inline
- Avoid re-rendering on font hinting mode change
- List markers: fix positionning when floats involved
- GIF decoding: avoid uneeded abort on LZW table overflow
- Adds getUnknownEntities(), can help with debugging
- Don't check stylesheet hashes when loading from cache
- Hardcoded elements and attributes list: cleanup
- Full rendering: 2 small optimisations
- Strut confinning: deal with images earlier
- lvtextfm: some cleanup and reordering
cre.cpp:
- fix getPageFromXPointer() and getPosFromXPointer()
  to not fail on invisible nodes and work on the next
  visible node (so links whose target is display:none
  can work).

Add support for 2 settings one can set manually
in reader.settings.reader.lua:
["cre_background_color"] = "0xccffcc",
["cre_background_image"] = "/path/to/bg_paper.jpg",
2020-05-25 22:39:59 +02:00
poire-z
16e42116ee
[fix] GestureDetector: prevent hold timers overlap (#6186)
Prevent the Tap>Hold setTimeout'ed function to trigger
on another later Tap.
Fix a Tap quickly following a Swipe (which triggers this
Tap>Hold timer) from becoming a Hold.
2020-05-25 17:17:10 +02:00
Frank LENORMAND
23cbabd539
[PocketBook] Refine 515 model attributes (#6184)
References <#6168>.
2020-05-25 12:23:43 +02:00
Frank LENORMAND
0b0548fade
[PocketBook] Map d-pad key events (#6183)
References <#6168>.
2020-05-25 11:58:01 +02:00
Frans de Jonge
eb92a95fa0
[PocketBook] Add 515 and PB616W definition stubs (#6182)
Might need further tweaks. References <https://github.com/koreader/koreader/issues/6168>.
2020-05-24 15:58:43 +02:00
Martín Fernández
3a4b5d3cab
desktop: add support for 3rd party dictionary apps (#6167) 2020-05-22 17:38:16 +02:00
poire-z
39345704ec
Statistics: fix number of highlights (#6173)
This number might have been leaking from a previously opened
book, and can be innacurate.
Reset it from the number of highlights stored in settings.
Note that the number of "Notes" shown does not mean much.
2020-05-20 21:40:49 +02:00
Martín Fdez
607dbf0808 clean PB device definition 2020-05-20 13:11:00 +02:00
mwoz123
0e2b430796
Fix/exit dir (#6163) 2020-05-19 18:21:58 +02:00
Martín Fernández
5704f63bfc
fix openLink on linux (#6161) 2020-05-18 15:36:00 +02:00
Martín Fernández
58a6b01d03
add eudic dictionary support (#6154) 2020-05-15 16:24:17 +02:00
poire-z
1e244d0358 [UX] Add fine tune for Word Spacing
Using DoubleSpinWidget.
Also keep SpinWidgets open on Apply.
Added little trick: if widget has been moved, close
bottom config menu on next Apply to show more of
the book.
2020-05-09 23:29:49 +02:00
poire-z
e5206922c6 [UX] Normalize SpinWidget and DoubleSpinWidget
- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
  when appropriate: when the value may have an immediate
  visual effect, so one can tweak it without having to
  go thru menus to re-open it again).
2020-05-09 23:29:49 +02:00
poire-z
d69a992e1d Font test sample: tweak footnote links
Make them external links so they don't trigger a "link is
invalid" popup and we can use swipe left/right to navigate
pages (and jump to latest bookmark/go back for comparing).
2020-05-09 23:29:49 +02:00
poire-z
8991540462
Reorganize bottom menu config panels (#6131)
Mostly for the PDF bottom menu.
- Reorganize by topic, trying to limit the number
  of widgets per panel to 4.
- Re-order some toggles from low to high ('off' then 'on').
- Show font size as number instead of a list of "Aa".
- PDF: add more font size values, and increase usable
  contrast values.
- Add help_text to most PDF toggle titles.
- CRE line spacing: increase fine tuning min and max.
Also avoid zoom advice messages on book load.
2020-05-07 20:24:12 +02:00
poire-z
46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
2020-05-06 21:11:34 +02:00
Martín Fdez
48727a984b android: add a toggle to force haptic feedback in spite of system settings 2020-05-06 11:40:32 +02:00
Roman Artiukhin
9588b51f24 Correct name for GoldenDict Pro dictionary 2020-05-06 11:39:52 +02:00
poire-z
e074b603e0 Adds Word Expansion: use of letter spacing for justification
Bump crengine:
- Text: fix occasional BiDi bad word splitting
- Font: fix HB fallback measurement/drawing mismatches
- Font: do not add letter spacing on diacritics
- Text: tunable use of letter spacing for justification
- Text: dont adjust space after initial quotation mark/dash (rework)
- Text: fix possible bad widths after collapsed spaces

xtext.cpp: pick crengine fix with HB fallback
measurement/drawing mismatches

Adds "Word Expansion" to bottom Font size menu, and moved
"Word Spacing" there too, to balance the panels' heights
to 4 items.
2020-05-05 19:06:28 +02:00
poire-z
429f4bf1ae
Enable Highlight action on single word selection (#6114)
Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
2020-05-05 18:56:30 +02:00
Robert
3f874f0d1f
[Gesture] Add progress sync gesture (#6103) 2020-05-05 18:51:02 +02:00
Robert
c2a0cc836d
[Gesture] Add go to first and last page (#6096) 2020-05-05 18:50:16 +02:00
yparitcher
0edfc4e150
ReaderStatus: close file before deleting (#6108) 2020-05-05 18:12:58 +02:00
mwoz123
ce3bf473da
Add move to archive plugin (#6101) 2020-05-02 23:02:36 +02:00
poire-z
1a91893576
Allow toggling use of additional fallback fonts (#6095) 2020-04-28 23:57:10 +02:00
Robert
7d139263d8
Option to prevent tap on status bar (#6083)
See: #5969
2020-04-26 10:35:48 +02:00
poire-z
6a98b2dce9
Text widgets, crengine: fix wrong vertical positioning (#6093)
Noticable with nastaliq arabic fonts.
bump crengine: fix wrong usage of Harfbuzz y_offset
Same in TextWidget and TextBoxWidget
2020-04-25 23:30:49 +02:00
poire-z
7d83a0c967
bump crengine: multiple fallback fonts (#6090)
Includes:
- Simplify libunibreak includes
- Text: fix read/write outside array bounds
- lvtextfm: dont adjust space after initial quotation mark/dash (rework)
- Fonts: allow providing and using multiple fallback fonts

Users can set their prefered fallback font, which will be completed
with a few of our shipped fonts for maximum coverage.
2020-04-25 20:20:41 +02:00
Robert
72c9ec2aa0
Add support for physical button for page crop (#6091)
See: #2003
In page crop:
physical press button = OK
physical back button = Cancel
2020-04-25 09:03:19 +02:00
Frans de Jonge
aa4bcd8c22
Screenshot: use month number instead of name (#6062)
Fixes #6055.
2020-04-22 09:07:48 +02:00
poire-z
6dc8bbcc49
Adds ReaderTypography (replaces ReaderHyphenation) (#6072)
Replace Hyphenation menu with Typography menu.
This works mostly like before:
- typography/hyphenation is chosen according to the book
  metadata language,
- one can set a default or a fallback language,
- hyphenation is now just a subset of typography, and
  can be disabled while still setting a language and
  enabling the other features,
- the typography language enables newly added features
  to crengine: per-language line breaking rules and
  per-language Harfbuzz glyph selection.
2020-04-21 21:30:16 +02:00
poire-z
6336927cb7
bump crengine: text typography by language (#6069)
Includes:
- Fix a few clang-tidy warnings
- Add support for <img src="data:image/png;base64,...>
- XML parsing: add more HTML5 named entities, optimize search
- Text: fix standalone BR not making an empty line
- Fix BR with "display: block" not making an empty line
- Fix hyphens from soft-hyphens not part of highlighted segments
- Use libunibreak for line breaking
- Adds TextLangMan for text typography by language

Tweak ReaderHyphenation to work with the new TextLangMan
(even if it will be replaced soon by ReaderTypography).
2020-04-19 13:53:01 +02:00
mwoz123
0b52fe9771
Wallabag remove from history setting (#6048)
Solves: #5045
2020-04-15 12:50:13 +02:00
Martín Fdez
f756a6aaa7 stardict path override 2020-04-14 20:39:08 +02:00
poire-z
abdaf6e18c
Non-Touch: fix hang on bottom config menu navigation (#6047) 2020-04-14 12:20:11 +02:00
Martín Fdez
8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
2020-04-13 19:24:28 +02:00
NiLuJe
2ae796eb2a
[Kindle] Be more thorough when toggling WiFi (#6039)
Fix #6019
2020-04-11 21:03:42 +02:00
poire-z
635f784dfd [UX] Gestures: add action "Statistics calendar view"
Also flush current stats when showing calendar view.
2020-04-10 22:52:57 +02:00
poire-z
41aad475ce File browser: sane fallback when home_dir invalid or missing 2020-04-10 22:52:57 +02:00
dfhall
04ca12bb7f
Fix remarkable pen input (#6031)
fixes #6030
2020-04-08 08:06:23 +02:00
Frans de Jonge
2945a2fb79
Add EPUB3 extension to MuPDF document (#6013)
Loads fine, see 026140f809 (commitcomment-38122799)
2020-03-29 14:38:07 +02:00
poire-z
026140f809 Adds ReaderPageMap, to optionally show source pages numbers
bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.

Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
  the GoTo and SkimTo widgets, and to use the source page
  number in the standard bookmark and highlight initial text.
2020-03-27 18:36:48 +01:00
poire-z
1cb3be324a TextBoxWidget: fix infinite loop when very small width 2020-03-27 18:36:48 +01:00
poire-z
b5867c3ead BookInfo: add File date, handle zip sub-suffix (.fb2.zip) 2020-03-27 18:36:48 +01:00
NiLuJe
0b898624ac
[Kindle] More accurate on/off FL detection/toggle (#5989)
* Kindle FL shenanigans

Either fix #5986, or break a whole crapload of weird corner-cases.
Possibly the insane AutoFrontLight checks.

* Make fl step 0 usable on devices where 0 doesn't turn the light off.

By fudging an extra step on our own side.

* Also, add some debug logging around wmctrl to try to figure out what's
happening there...
2020-03-26 04:56:34 +01:00
poire-z
8e68dc11db
Highlights: turn page when start or end crosses pages (#5984)
More generally: switch to the page that contains the highlight
edge that we are currently moving.
2020-03-20 21:58:58 +01:00
Sergey Avseyev
7a0fe89ab7
Add DJVU MIME type to OPDS browser (#5982) 2020-03-20 09:18:16 +01:00
yparitcher
08359ee1b6
[UX] Next/Previous Bookmark Gestures (#5968)
Fixes #5965
2020-03-16 16:52:09 +01:00
NiLuJe
4a5a2eb708
Unbreak nightmode on Cervantes (#5966)
* Unbreak nightmode on Cervantes

Regression after https://github.com/koreader/koreader-base/pull/1047 (I
thought it was already implemented).

Fix #5963

* make luacheck happy
2020-03-16 01:05:17 +01:00
poire-z
8d8b8cd0f7 FB2 footnotes: some more tweaks
- Add some style tweaks to allow displaying FB2 end notes
  in-page too - and to allow showing them without a smaller
  font size.
- Show footnote number in bold in popup footnotes.
2020-03-15 19:19:47 +01:00
mergen3107
73f1b1aad6
[UX] More compact dictionary download window (#5960)
Dictionary download window: combine the first two titles to save space and fit 3x complete dictionary selections on one page (Kindle PW3)

Closes #5955
2020-03-15 11:40:24 +01:00
NiLuJe
098c1a7844
[fix] Don't break OPDS parsing on HR tags (#5949)
Apply the same crappy workaround as for BR.

Fix #5948
2020-03-14 21:17:42 +01:00
NiLuJe
bb0c01757d
Blacklist a few Amazon Ember styles to get the main ones to behave. (#5951)
Fix #5950
2020-03-14 11:14:23 +01:00
mergen3107
7d51fa2b5d
[UX] Update Russian keyboard layout (#5957)
Closes #5953.
2020-03-14 11:13:46 +01:00
Frans de Jonge
c2aac0f71e
[fix] DocumentRegistry: only add provider once (#5947)
Fixes <https://github.com/koreader/koreader/issues/5946>.
2020-03-13 21:29:13 +01:00
Jon
d65f2c8367
Add additional MIME types to OPDS Browser (#5940)
added a few new mime types to the OPDS browser as a temporary workaround for #5478
2020-03-13 12:18:46 +01:00
Frans de Jonge
ad0a7ed3a5
[fix] Support proper local links (#5945)
Only one style was supported.

Fixes <https://github.com/koreader/koreader/issues/5941>.

See <https://github.com/koreader/koreader/issues/5941#issuecomment-598633973> for discussion.
2020-03-13 12:13:15 +01:00
poire-z
c1f19e943a
Make xpointers migration ConfirmBox non-dismissable (#5931)
Because dismissing it by tapping outside would have
"not for this book" selected, which is the least
welcome action.
2020-03-08 20:22:12 +01:00
clarkspark
1d58eb8b6c
Correct Frontlight status on suspend when screensaver mode is 'Leave … (#5928)
Also use a var in place of a long function name
2020-03-08 08:46:46 +01:00
poire-z
8502a96a6a
PathChooser: fetch 'show_hidden' setting on each use (#5923) 2020-03-06 21:10:01 +01:00
poire-z
72f2cef472
Style tweaks: enable EPUB/FB2 in-page footnotes by default (#5908)
Set these 2 tweaks as default global tweaks for new users
(and existing users that have not set any global defaults).
One can disable them by long-press on each of them.
Only per-specs EPUB and FB2 footnotes (other in-page footnotes
tweaks may trigger on non-footnote content on some books, so
let enabling them be a user decision).
2020-02-28 23:06:58 +01:00
poire-z
8a3d4a1d25
TOC: validate and fix misordered page numbers (#5907)
Our code expects (rightfully) the TOC items to be ordered
and to have increasing page numbers, but we may occasionally
not get that from the engines (usually, because of bugs or
duplicated IDs in the document).
Check for that and fix page numbers (possibly making them
wrong) to have a working TOC.
2020-02-28 22:56:12 +01:00
poire-z
85a06ff995 Bookmarks: fix dogear not shown when highlights on same page
Depending on the random ordering of bookmarks and highlights
on a same page, the binary seach could not notice that a
bookmark exists for this page.
Solve this by putting bookmark before highlights on a same
page in the list, and skip them when searching.
2020-02-27 23:59:02 +01:00
poire-z
a5232594d9 FB2 footnotes: handle them just as other footnotes
- FB2 footnotes are no more rendered in-page by default
- In-page rendering can be enable by the added Style tweak
- FB2 footnotes can also show in footnote popup (with
  some added not-so-nice CSS so MuPDF can render them
  as crengine)
2020-02-27 21:22:28 +01:00
poire-z
fa6fed8569 cre: setFontFace(): increase bias given to the main font
Solve the issue when a font without bold and italic variants
is used as the default font (e.g. FreeSerif), and the style
tweak "Ignore publisher font-family" is used (which uses
a trick to cancel any font-family by requesting a font
named "NoSuchFont"):
When text is italic or bold, any of the registered fonts
which have a real italic or bold variant would win over our
default font, as the best substitute to NoSuchFont-Italic.
This gives our default font a bit more bias so it can
win in its scoring against the other fonts, and be rendered
as fake italic or fake bold - which will ensure consistent
font and line height.
(A bit hacky, but no alternative solution found.)
2020-02-27 21:22:28 +01:00
poire-z
182dc60e00
[i18n] allow translation of time (12/24-hours formats) (#5898)
Discussion around https://github.com/koreader/koreader/issues/5359#issuecomment-590593945
2020-02-26 08:34:42 +01:00
Martín Fernández
5d103a41f8
Avoid writting highlights into read-only PDFs (#5889) 2020-02-25 21:26:19 +01:00
poire-z
5a4f5b4d59 bump crengine, migrate books to normalized xpointers
Enable new rendering feature COMPLETE_INCOMPLETE_TABLES
on all enhanced rendering mode, but have it disabled for
earlier cre_dom_version.
Also increase default_cre_storage_size_factor from 20 to 40.
2020-02-24 23:36:13 +01:00
poire-z
7d7781b768 ConfirmBox: avoid overflowing screen height when long text
Just like what's been done previously for InfoMessage.
Also tweak 'other_buttons' option (not yet used anywhere)
to allow multiple rows of such other buttons.
2020-02-24 23:36:13 +01:00
poire-z
74efb24b9d Style tweaks: force List items bullet/decimal style 2020-02-24 23:36:13 +01:00
Lukáš Kucharczyk
ab744e1945
Add support for PocketBook InkPad X (#5890)
Closes #5887.
2020-02-22 09:09:18 +01:00
Rena Kunisaki
fd05842686
Add "message at top of screen" screensaver (#5739)
Adds a screensaver mode which is just a line of text at the top of the screen. Purpose is to be minimally obstructive while still displaying something to indicate the device is asleep.
2020-02-22 09:07:28 +01:00
yparitcher
7b1ae4e486
continuous: do not limit visible area to page area (#5885)
in scroll_mode allow visible area to be larger than one page

allows proper scrolling om tall aspect ratios. Fixes #5876
2020-02-20 23:00:32 +01:00
poire-z
611c423727
TextBoxWidget: handle tabs and tabstops (#5870)
Don't display a tofu glyph when meeting a tab (none of
our fonts have a glyph for it).
New parameter: TextBoxWidget.tabstop_nb_space_width,
that defaults to 8, to ensure tabstops in the usual
left aligmnent (or right when para is RTL).
2020-02-18 13:24:10 +01:00