2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

9321 Commits

Author SHA1 Message Date
NiLuJe
390c875c80 Fix: key_events cannot be nil anymore since #9586 2022-10-25 01:47:01 +02:00
NiLuJe
d2ac2ca6e7 Cleanup: Remove unused onAnyKeyPressed handlers
And simplify the few we do catch by using aliases instead of duplicated
functions;).
2022-10-25 01:47:01 +02:00
NiLuJe
78381c3afa ScreenSaverWidget: Actually enable the onAnyKeyPressed handler
Which allows us to exit the screensaver on, well, any key press ;o).
2022-10-25 01:47:01 +02:00
NiLuJe
854cbe9f94 Kobo: Unbreak frontlight toggle for some specific values
Because of floating point computery math stuff.

Regression since #9609
c.f., https://github.com/koreader/koreader/pull/9609#issuecomment-1288187080
2022-10-25 01:47:01 +02:00
Martín Fdez
ee35257f99 update metadata & translations 2022-10-23 10:26:20 +02:00
Martín Fdez
17246f0534 fix update-metadata script 2022-10-23 10:26:20 +02:00
Frans de Jonge
6139aab167
Update translations for 2022.10 (#9670) 2022-10-23 09:26:04 +02:00
poire-z
3dbcccb1a8
TextViewer: correct keyboard layout after long-press on Find (#9668) 2022-10-23 09:21:11 +02:00
hius07
e3fd612518
ConfigDialog: fix a bug with default values (#9666) 2022-10-22 07:28:43 -04:00
hius07
60a16c7e00
configdialog: fix bug with default values (#9662) 2022-10-21 14:33:07 -04:00
weijiuqiao
bb03cf7310
Chinese keyboard: fix harmless typo (#9633) 2022-10-20 21:15:54 +02:00
Benoit Pierre
1d6f4acad0
CoverBrowser: fix some button callback overrides (#9647)
Broken since b0eb0ce0: the custom callbacks for the "Reset settings"
& "Book information" buttons are not being called anymore because
patching those is done to early (before instead of after creating
the new modified dialog).
2022-10-20 20:53:50 +02:00
weijiuqiao
effddbc1ee
zh_keyboard: make number pad symbol mode (#9654)
This PR makes zh_keyboard's number pad symbol mode instead of shift mode, so that numbers are shown when the keyboard is called expecting numeral input.
2022-10-20 19:37:22 +02:00
sonix-github
ac79da05f4
[plugin] AutoStandby: Make "Update" string translatable (#9655) 2022-10-20 19:35:09 +02:00
bigdale123
cda419dd7a
OPDS-PS: Fix hardcoded namespace in count (#9650)
Turns out the namespace is dynamic, so, just look for ':count' and hope there won't be any conflicts ;).
2022-10-20 16:45:05 +02:00
zwim
dbafcb0311
UnitTests: Nits and misspellings (#9629) 2022-10-18 15:56:57 +02:00
NiLuJe
23c410344b
UIManager: Minor code cleanup (#9641)
* Remove a check made redundant by #9617
* Bump base (https://github.com/koreader/koreader-base/pull/1538)
2022-10-16 01:43:47 +02:00
NiLuJe
741562e84c
Cleanup: Use Lua's native setvbuf wrapper instead of reinventing the wheel (#9636)
Sidenote for the crazy win32 people out there: it doesn't has a concept
of line-buffering, so native win32 should use "no" here, but I'm
*hoping* MinGW transparently handles this nonsense.
2022-10-14 18:44:36 +02:00
NiLuJe
d9eb6e9717
Kobo: Always use open/write/close for sysfs writes (#9635)
Also simplifies a few UIManager log messages (re: https://github.com/koreader/koreader-base/pull/1537)
2022-10-14 01:50:03 +02:00
hius07
2a354912f4
buttondialogtitle: align upper borders (#9631) 2022-10-13 07:12:53 -04:00
sp4ke
f3620b6d1f
Exporter plugin: allow adding book md5 checksum when exporting highlights (#9610)
This allows interoperability between different readers who want to
import highlights on different devices/file systems. All that is
needed then to import highlights is to match the local books and
their path based on the checksum.
2022-10-12 23:50:44 +02:00
weijiuqiao
7fc803ffee
Vocabulary builder: supports review in reverse order (#9605) 2022-10-12 23:45:29 +02:00
weijiuqiao
ae8156ff9e Vietnamese keyboard: TELEX method backed by generic_ime 2022-10-12 23:41:48 +02:00
weijiuqiao
6a5a13dfc8 Generic keyboard IME bump: supports auto seperation when code is unique 2022-10-12 23:41:48 +02:00
yparitcher
e424fcf5de
Dispatcher: Fix subtle bug with modified items being added twice to the sort index (#9628)
Discovered by @poire-z in https://github.com/koreader/koreader/pull/9531#issuecomment-1274839234
2022-10-12 23:17:10 +02:00
NiLuJe
da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2022-10-12 19:59:48 +02:00
weijiuqiao
8508689cea
[feat] Add Thai keyboard (#9620)
This PR adds support for a Thai keyboard. Layout mostly copied from my phone, with difference in diacritics placements: phone has only one key for all of them, while here we have a couple more. Swipe in different directions needed for inputing them.
2022-10-12 11:25:43 +02:00
hius07
a728e3b5fa
ReaderStatus: save status summary (#9619) 2022-10-10 17:52:47 -04:00
zwim
4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +02:00
zwim
a24548ed3f
UIManager: Optimize binary insert (#9600)
* Optimiz
2022-10-10 22:17:50 +02:00
NiLuJe
68dcc4f36c
Bump base (#9618)
* Bump base (https://github.com/koreader/koreader-base/pull/1534)
* And some fixups following #9617
2022-10-10 20:25:18 +02:00
NiLuJe
6ac7a0cd40
UIManager: Fix handling of toast widgets in sendEvent (#9617)
The ultimate goal is for toast widgets (i.e., Notification when flagged as such) to:
  * Not stop event propagation
  * Close themselves when the event was emitted by user input.

Instead of doing event filtering in UIManager, we simply overload the onGesture & onKey* handlers in Notification to do just that, and just make sure UIManager will *send* those events to toasts, but without affecting the usual semantics of top widget selection and event propagation (which is as simple as just calling handleEvent on them unchecked ;p).

Thanks to @poire-z for the brainstorming in https://github.com/koreader/koreader/issues/9594 ;).

This also happens to fix a bug in which we might have looped on the top widget twice, because of an array vs. hash mishap ;).
2022-10-10 18:55:29 +02:00
NiLuJe
ed96b15a3f
util: Add a set of binary searches implementation (#9614) 2022-10-10 15:16:16 +02:00
NiLuJe
c9ff0071e3
DocSettings: Fix candidates sorting (#9607)
The candidates array had a very very very high chance of being sparse, which effectively broke the logic.
It was mostly harmless since said logic is only here for a long and varied history of backwards compatibility ;).
2022-10-09 19:32:35 +02:00
NiLuJe
718b136c9a Bump base
https://github.com/koreader/koreader-base/pull/1532
https://github.com/koreader/koreader-base/pull/1531
2022-10-09 05:30:28 +02:00
NiLuJe
2e1b40c997 ScreenSaver: When adding an overlay message to a top message, position
it *below* the top message, instead of *over* ;).
2022-10-09 05:30:28 +02:00
NiLuJe
5e6b783d27 ScreenSaver: Never inhibit the event message (reboot/poweroff), unless
specifically requested.

Using a custom message would effectively prevent the event message from
showing up, which is... bad.

(In fact, I'm half of the mind to get rid of the option to hide the
event messages, because it's a goddamned terrible idea).
2022-10-09 05:30:28 +02:00
NiLuJe
a62f076e56 DictQuickLookup: The window_list array needs to be a static class member
Also, make sure references are actually dropped,
no matter how the widget is closed, by relying on onCloseWidget ;).

Enable the "long-press-on-close" trick on the actual Close button,
too, instead of only on the title bar's cross.

Fix: https://github.com/koreader/koreader/pull/9586#issuecomment-1272332275
2022-10-09 05:30:28 +02:00
NiLuJe
93ae341823
UIManager: Don't lose track of the original rotation on reboot/poweroff (#9606)
And, actually, stop enforcing Portrait; Screensaver already handles
rotation as necessary depending on the exact screensaver mode.

Fix https://www.mobileread.com/forums/showthread.php?t=349522
2022-10-07 22:53:10 +02:00
NiLuJe
c0dffe2012
Kobo: Add a debug option to turn the charging LED on PM entry failure (#9601)
This should be fairly unintrusive, but still noticeable enough without having to watch the battery gauge like a hawk, or resort to actual monitoring via kernel logs and/or usb meter and/or multimeter...
2022-10-07 17:33:57 +02:00
NiLuJe
7e209139d5
Resync w/ base (#9604) 2022-10-07 01:31:41 +02:00
NiLuJe
958b0a7c99 You're doing it wrong, inputtext_spec... 2022-10-06 19:28:26 +02:00
NiLuJe
eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2022-10-06 19:28:26 +02:00
NiLuJe
b1bcafa833 Persist: unbreak serialize for serpent 2022-10-06 19:28:26 +02:00
NiLuJe
39e0f84959 LuaDefaults: Simplify defaults.lua loading
Forget about the crazy filemanagersetdefaults shenanigans:
the previous code just did require("defaults"), so, $PWD it is ;).
2022-10-06 19:28:26 +02:00
yparitcher
a916a5e8a2 Dispatcher: QuickMenu: Fix footgun
Fixes: #9594
2022-10-05 22:49:00 -04:00
NiLuJe
ad22942108 LuaDefaults: Look for defaults.lua in $PWD first
As DataDir may not exist yet.

Fix #9593
2022-10-06 03:07:42 +02:00
NiLuJe
6cb8297362 Deal with macOS's libc shenanigans
Fix #9595
2022-10-06 03:07:42 +02:00
NiLuJe
5c24470ea9
Logger: Use serpent instead of dump (#9588)
* Persist: support serpent, and use by default over dump (as we assume consistency > readability in Persist).
* Logger/Dbg: Use serpent instead of dump to dump tables (it's slightly more compact, honors __tostring, and will tag tables with their ref, which can come in handy when debugging).
* Dbg: Don't duplicate Logger's log function, just use it directly.
* Fontlist/ConfigDialog: Use serpent for the debug dump.
* Call `os.setlocale(C, "numeric")` on startup instead of peppering it around dump calls. It's process-wide, so it didn't make much sense.
* Trapper: Use LuaJIT's serde facilities instead of dump. They're more reliable in the face of funky input, much faster, and in this case, the data never makes it to human eyes, so a human-readable format didn't gain us anything.
2022-10-06 02:21:03 +02:00
NiLuJe
fadee1f5dc
Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00