64 Commits

Author SHA1 Message Date
hius07
3c8a312c9e Calibre search: do not use stale list (#14585) 2025-11-09 08:08:28 +02:00
David
92effcf9fb Replace checkboxes with radio buttons where appropriate (#14431) 2025-10-14 22:53:47 +02:00
Benoit Pierre
51db00155c calibre: handle a missing inbox folder (#14293)
Prompt the user again if the inbox folder has been configured but is missing (or not a directory).
2025-09-09 08:08:44 +02:00
Volterxien
de789615ac Add the ability to launch read timer with a gesture (#14061)
Closes #14014.
2025-07-18 12:12:41 +02:00
hius07
29bbc84de2 Touchmenu: fix menu refreshing on check (#13996) 2025-07-01 21:43:51 +03:00
Emre
72573fb393 [Calibre] React to SEND_BOOK_METADATA opcode (#13920)
Fixes #12922.
2025-06-17 12:27:11 +02:00
Benoit Pierre
a53c1aae59 calibre: increase no-activity timeout (#13846)
Calibre does not send the expected regular "NOOP" pings during
its "Analyzing books on the device…" phase, and that operation
can take a long time (75s for 4500 books on a recent machine).
2025-05-27 22:32:20 +02:00
Benoit Pierre
68a9a8d1ee calibre: fix setting inbox from menu (#13805)
Regression from #13704.
2025-05-16 20:55:57 +02:00
Benoit Pierre
8fef5c1766 calibre: rework connection setup
Faster and with better UI:

- roughly halve a successful connection setup
- drop manual & temporary TCP connection before the real ZMQ one:
  - it slows down the total connection time
  - it's actually counted by calibre as a failed connection attempt:
    after 5 consecutive failures from the same IP, calibre ignore
    further connections, with no feedback to the user, except an
    error trace, until the wireless server is restarted
- avoid unconditional 1s delay before checking for authentication failure
- "searching" & "connecting" (cancellable) dialogs
- stop connection on quit / restart
2025-05-05 18:18:28 +02:00
Frans de Jonge
45f77455a9 [plugin] calibre: fix a nil concatenation typo (#13484) 2025-04-07 21:15:38 +02:00
Martín Fernández
b7b1717ed4 calibre: add timeout to connection message (#13513)
Fixes #13478
2025-04-06 09:28:52 +02:00
hius07
9b8dbf3e83 Status strings translation context (#13459) 2025-03-26 17:01:39 +02:00
Martín Fernández
a1ac782a2f calibre.koplugin: show message when attempting to connect via dispatcher (#13237)
closes #13193

Using an InfoMessage instead of a notification because another infomessage will follow with success/error.
2025-02-12 19:18:37 +01:00
hius07
42de1fb96e Collections: filter by book status (#13099) 2025-01-25 10:49:35 +02:00
hius07
17504993ae CoverBrowser info_cache: move to core (#13018) 2025-01-18 10:08:18 +02:00
Martín Fernández
47ab7685aa calibre: remove json chooser UI leftover (#12715)
After #12714
2024-11-06 16:18:12 +01:00
Martín Fernández
d10a52e88a calibre: always use custom fast parser (#12714)
Fixes #12610
2024-11-06 15:00:19 +01:00
NiLuJe
0a5dcf885d Calibre Metadata: Flag array & objects as such in the "safe" parser 2024-06-09 19:28:21 +02:00
NiLuJe
8d80acf720 Calibre Metadata: Make sure self.books is always flagged as a JSON array
Ditto for self.driveinfo
2024-06-09 19:28:21 +02:00
NiLuJe
1ca443195b Calibre Metadata: Don't lose rapidjson object/array tagging in slim 2024-06-09 19:28:21 +02:00
Martín Fernández
79c13bee0c Calibre: Metadata parser improvements (#11922)
* Added a safe pure-Lua SAX JSON parser (via LunaJSON).
* Updated RapidJSON.
* Also implemented a calibre-specific SAX parser in Lua-RapidJSON, and use it by default instead of the full RapidJSON one.
* Raised the file-size threshold to switch between the fast & safe parsers to 50MB.
* Added an UI option to switch between the three parsers.
2024-06-06 01:06:46 +02:00
Nico Hirsch
3e04184638 calibre: add wireless connectionstart/stop actions (#11806)
* Register start stop connection actions

* Match code order

* Title to lowercase
2024-05-13 00:16:17 +02:00
NiLuJe
a736a3ebe0 Calibre: Add reading status to the metadata search popups (#10842)
We're getting old, remembering whether you've actually read stuff is hard ;).
2023-08-26 16:13:59 +02:00
hius07
4f23a6fafa Custom book covers (#10329) 2023-05-03 15:43:05 +03:00
Frans de Jonge
4e78b081f9 [i18n] Calibre plugin: improve clarity for translators (#10172)
The path list will start with \n already, but an extra newline
won't hurt and this string is really weird (i.e., people will
naturally put a space or a newline in front of it).
2023-03-05 21:09:07 +01:00
NiLuJe
8e9fc9953f Calibre: Allow authors/title metadata browse/searches (#10113)
c.f., https://www.mobileread.com/forums/showthread.php?t=352142

This adds dedicated "browse by" buttons for authors & tags, and adds series & tags to the search settings for the meta "Search books" button.
2023-02-15 00:40:40 +01:00
NiLuJe
7863a7ad70 Misc: Natural sorting refactor (#10023)
* Move natural sorting algo to a dedicated sort module to avoid code duplication
* Use a slightly more accurate algorithm, and speed it up by caching intermediary strings
* Calibre: Use natural sorting in metadata search (fix #10009)
2023-01-16 19:36:22 +01:00
NiLuJe
f6421abab0 Calibre: Log errors on wireless connection failures (#9914)
Also, get rid of the weird and clunky `failed_connect_callback` thingy, because it makes no sense?

Re: #9908
2022-12-17 22:37:23 +01:00
Martín Fernández
ee94a575f1 calibre: fix attempt to index path_entry (#9837)
Fixes #9836
2022-11-27 12:35:18 +01:00
Martín Fernández
8b8d79275c calibre metadata: prevent duplicates (#9725)
Fixes #9722
2022-11-01 19:21:00 +01: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
Martín Fernández
49c02790f6 fix: attempt to call local start_time (number) (#9086)
Follow up https://github.com/koreader/koreader/pull/8999
2022-05-09 08:27:58 +02:00
zwim
9b9cfe29a4 [feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2022-05-05 21:00:22 +02:00
Emir Taletovic
f8eca5fa03 Calibre plugin - Series/Tag browser updated to show back button. (#8869)
* Calibre plugin - Series/Tag browser updated to show back button.

* Handling page number

* Few updates to search logic:
- Moved "find books" option from CalibreSearch:find(option)
into CalibreSearch:browse(option) function. This way all search options
are handled in one place only.

- Menu is created only once and it is in CalibreSearch:browse(option)
function. This is where it is also invoked with UIManager:show(w).
Switching between different menu content (tags/series/books) is
done using CalibreSearch:switchResults function which will internally
call Menu:switchItemTable. Previously menu was being instantiated
in 2 places depending on are we searching books or series/tags

- Return arrow navigation: Border around Menu is gone to give space
for back arrow. Navigation seems to be working fine so far but will
give it some time to test in case I find any other bugs
2022-03-16 21:45:47 +01:00
Frans de Jonge
7235433b92 [i18n] Add context for calibre configuration type (#8909)
`Manual` could mean several things, most notably some kind of documentation and something you do by hand.

The added context is partially to aid translators and partially to preclude potential collisions in the future.

Cf. <https://github.com/koreader/koreader-translations/pull/138>.
2022-03-16 16:18:18 +01:00
Emir Taletovic
3e78847c46 Calibre plugin - Fixed hang when book has series but series index is nil (#8870) 2022-03-11 19:40:02 +01:00
Philip Chan
107156c0a8 [feat] Non-touch improvements (#8859)
FocusManager: fix round x use y layout
FocusManager: add tab and shift tab focus navigation support
FocusManager: handle Press key by default
FocusManager: make sure selected in instance level
FocusManager: add hold event support
FocusManager: Half move instead of edge move
FocusManager: add keymap override support
FocusManager: refocusWidget will delegate to parent FocusManager
Focusmanager: refocusWidget can execute on next tick
inputtext: can move out of focus on back
inputtext: fix cannot exit for non-touch device
inputtext: fix cannot input text with kindle dx physical keyboard
fontlightwidget: add non-touch support
datetimewidget: add non-touch support
datetimewidget: fix set date failed in kindle DX, fix datetimewidget month range to 1~23 by default
datetimewidget: make hour max value to 23
multiinputdialog: add non-touch support
checkbox: focusable and focus style
virtualkeyboard: no need to press two back to unfocus inputtext
virtualkeyboard: collect FocusManager event key names to let VirtualKeyboard disable them
openwithdialog: add non-touch support
inputdialog: can close via back button
enable all InputDialog and MultiInputDialog can be close by back
keyboardlayoutdialog: non-touch support
readertoc: non touch device can expand/collapse in toc
bookstatuswidget: non touch support
keyvaluepage: non-touch support
calendarview: non-touch support
2022-03-04 21:20:00 +01:00
hius07
5c39c19a73 [chore] Remove leftover: cface (#8659)
Ancient menu widget had it.

Not used anymore.
2022-01-12 13:32:03 +01:00
hius07
859327dea5 Input dialogs: keep size in rotation (#8223) 2021-09-17 19:36:57 +02:00
yparitcher
f5dc7b4539 Dispatcher: Revamp sections and item order 2021-09-13 10:56:06 -04:00
Martín Fdez
a63c22b6fb calibre: gui to choose default extension 2021-09-01 21:03:24 +02:00
NiLuJe
7cb480c0fc Calibre: Invalidate the Search cache after a Wireless session
xref: https://www.mobileread.com/forums/showthread.php?t=338810
2021-05-05 20:37:33 +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
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
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
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
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
Glen Sawyer
75661abd59 Calibre - pull files from device (#7492)
Add a proper implementation of `GET_BOOK_FILE_SEGMENT`, so calibre is now able to pull files from the device.
2021-04-10 20:07:24 +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