Commit Graph

8281 Commits (de6f2e84a38c071aee0e24e3836f2c47950cf20d)
 

Author SHA1 Message Date
NiLuJe de6f2e84a3
FileManager/ReaderUI: Clarify the current instance accessor (#7658)
* FileManager/ReaderUI: Clarify the current instance accessor

Make it clearer that we actually store it in a *module/class* member, not an *instance* member.

Also, warn if there's a close/open mismatch.
3 years ago
Martín Fernández 939fcf7f0e
android: avoid downloading the APK again if there's one download in progress + fix signature error (#7657) 3 years ago
Martín Fernández 247166b3df
android: keep bundled version in a dedicated text file (#7649) 3 years ago
Hzj_jie 1a08f2cb69
Plugins: adds PluginMenuInserter helper (#7419)
Allows user-plugins to register themselves
into "More tools" menu.
3 years ago
zwim d082f795e6
Dispatcher: some formatting cleanup, rewording and re-ordering 3 years ago
NiLuJe 1dd300d822 Bump base
https://github.com/koreader/koreader-base/pull/1368
3 years ago
NiLuJe 1ffbd8760d KOPTInterface: Minor optimization when hashing the configurable status
Use a table & table.concat instead of individual concats.
And then use that same table for every hash-related operation.

(Nothing else uses the configurable hash function, otherwise I'd have
limited the table shenanigans to the function itself).
3 years ago
NiLuJe 48c474e245 Device: Add some more logging in onPowerEvent
Could possibly help shed some light on potential SleepCover races...
re #7633
3 years ago
NiLuJe 2635593890 Cache: Some more tweaks after #7624
* Allow doing away with CacheItem
  Now that we have working FFI finalizers on BBs, it's mostly useless overhead.
  We only keep it for DocCache, because it's slightly larger, and memory pressure might put us in a do or die situation where waiting for the GC might mean an OOM kill.
* Expose's LRU slot-only mode
  And use it for CatalogCache, which doesn't care about storage space
* Make GlyphCache slots only (storage space is insignificant here, it was
  always going to be evicted by running out of slots).
* More informative warning when we chop the cache in half
3 years ago
NiLuJe 05806abeaa CreDocument Call Cache: Minor modernization tweaks
* Neuter timekeeping when statistics are disabled
  Saves a few syscalls ;).
* Port to ffi/lru
  Only a tiny bit of it actually requires any sort of LRU logic, so it's fairly painless.
* Release the cache on close
* Use string.buffer to serialize function arguments
  Ought to be faster than the custom approach ;).
  (Still requires wrapping them in a table, though).
  It's much less human-readable, but then again, this doesn't need to be :).
3 years ago
NiLuJe ed0aa1ed11 ReaderUI: Ensure we flash when opening a document
Regression since #7624
3 years ago
Frans de Jonge 310151fac9
Fix typo (#7655)
Follow-up to #7632.
3 years ago
Martín Fernández d303fdf694
android: Prompt for install updates when they're downloaded (#7632) 3 years ago
hius07 3d713dc34c
Dictionary: disable 'Clean history' when the history is empty (#7636) 3 years ago
hius07 c129354ca3
Wikipedia: disable 'Clean history' when the history is empty (#7637) 3 years ago
hius07 170629c921
[plugin] Text editor: new 'Clean text editor history' etc. (#7635) 3 years ago
mergen3107 2c1cae64b6
Remove notification on font change (#7589)
Should reduce refreshes competition and avoid glitches.
3 years ago
zwim 46a2d9c145
Dispatcher: Make font size actions consistent with ConfigDialog's NumberPicker (#7626) 3 years ago
Kevin Reuning 1cefd27946
DropboxAPI: Handle pagination (#7621)
Fix #7600 

Co-authored-by: NiLuJe <ninuje@gmail.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
3 years ago
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.
3 years ago
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..
3 years ago
NiLuJe a9977b3453 Bump base
https://github.com/koreader/koreader-base/pull/1365
https://github.com/koreader/koreader-base/pull/1366
https://github.com/koreader/koreader-base/pull/1364
3 years ago
NiLuJe 7cb480c0fc Calibre: Invalidate the Search cache after a Wireless session
xref: https://www.mobileread.com/forums/showthread.php?t=338810
3 years ago
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.
3 years ago
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.
3 years ago
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.
3 years ago
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.
3 years ago
NiLuJe 47cc7bb1a6 AutoTurn: Get rid of the weird settings_id hack, and use sane
schedule/unschedule pairs, like AutoSuspend.
3 years ago
NiLuJe 03d85bbf99 Terminal: Read settings at instantiation time, not loading time 3 years ago
NiLuJe b0cc940776 AutoSuspend: Unbreak scheduling & settings across instances
Plugins are loaded *once*, but torn-down/instantiated multiple times,
and sometimes in the reverse order.

As such, if we use a public function member as the scheduled task, we're
always pointing to the same function, and going from FM to RD
effectively *un*schedules it.

Instead, use an instance-specific closure, so that each instance
schedules & unschedules don't affect each other.

In the same vein, settings ought to be read at instantiation, not at
loading, otherwise, changing a setting in the FM, then switching to the
reader will not pick up the changes.
3 years ago
zwim 0d6be41c75
Better strings (#7611) 3 years ago
NiLuJe 7ed97c8714 Tests: Make the timeouts more lenient during OPDS tests
Helps prevent spurious failures when stuff is slow.
3 years ago
NiLuJe c9ba30a870 Unbreak FileManager test after #7582 3 years ago
NiLuJe b24ecf35d4 CreOptions: Display weight classes names, in addition to their raw value. 3 years ago
NiLuJe 56d7a2d86b CreOptions: Minor wording tweak after #7616
c.f., https://github.com/koreader/koreader/pull/7616#discussion_r622732969
3 years ago
NiLuJe ba0c18ccd4 Startup: Instantiate FileManagerHistory properly
Ensures rotation doesn't crash, and actually rotates the FM, too.

Fix #7617
3 years ago
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.
3 years ago
NiLuJe 22da527ff5
Kindle: Enable AutoSuspend plugin (#7612)
Kindles are not flagged canPowerOff, although that's technically not
entirely warranted, but sorta makes sense.

The Plugin already handles that sanely, and will only expose/honor the
suspend timer.
3 years ago
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.
3 years ago
hius07 3cb9508185
Filemanager: enhance file operations dialogs (#7582) 3 years ago
hius07 3845424808
Gestures menu optimization (#7609) 3 years ago
hius07 86126d042f
Dispatcher: add "Toggle status bar" action (#7606) 3 years ago
hius07 9d9667c226
Status bar: do not hide alone empty indicators (#7602) 3 years ago
zwim fafc0bc678
Missed translatable (#7603) 3 years ago
zwim c8d5330631
Typo (#7601) 3 years ago
NiLuJe da4aec223c CloudStorage (FTP): Unbreak after #7597 3 years ago
NiLuJe 807b9079a4 Bump base
https://github.com/koreader/koreader-base/pull/1361
3 years ago
Andy Bao ea6576d2b6
CloudStorage (FTP): Do not buffer entire download in memory (#7597) 3 years ago
NiLuJe 5d312d85a0
Bump base (#7596)
https://github.com/koreader/koreader-base/pull/1360

(Fix #7593)
3 years ago
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.
3 years ago