Commit Graph

1111 Commits (master)

Author SHA1 Message Date
hius07 905d5610ba
OPDSbrowser: accept catalogs without header in response (#9829)
Such catalogs are not cached.
Closes #6088.
1 year ago
weijiuqiao 1c42641733
Calendar view: fancier day details with timeline (#9813) 1 year ago
melyux 78772fcbb1
BatteryStat: show current battery percentage (#9814) 1 year ago
hius07 5b889a0145
Reader style tweaks: register in Dispatcher manually (#9816)
Style tweaks can be applied with a gesture or added to a profile.
1 year ago
zwim 486d7071c7
[StatusBar] Allow status bars to be repainted if they are not covered (#9768) 1 year ago
weijiuqiao 81b2f22b04
ReaderStatistics: fix sync sql command (#9811)
Fixes sync sql command that uses left join instead of
inner join, which adds unnecessary comparisons and
might result in incorrect mapping between databases.
1 year ago
hius07 1b066cf1de
Exporter: fix orphan highlights (#9802) 1 year ago
weijiuqiao e8983d335d VocabBuilder: fix not updating book title in the more dialogue when the book title is changed but not reassigned. 1 year ago
NiLuJe 779a8e00de ExternalKeyboard: Harden the debugfs check
* Don't even attempt to run mount if we're not root (e.g., emu or PB)
* Deal with sane init systems that mount debugfs as debugfs and not none
  (e.g., Kindle).

Also, switch to debug logging for those errors, pluginloader is already
verbose enough.

Fix #9774
1 year ago
weijiuqiao 77e0ac57de
Vocabulary builder: make a word's book title changeable (#9776)
Adds the ability to re-assign which book a word belongs to
and change the name of an existing book. It can be used as
a way to regroup words and hide/show them by book.
1 year ago
weijiuqiao 5082289aad
Vocabulary builder: allow longer intervals (#9764) 1 year ago
Dylan Calvin c5cd87f09a
(OPDS) Progess Sync Support for Kavita & Various Refactor Fixes (#9750) 2 years ago
weijiuqiao 678d0c911c
Vocabulary builder: safer db migration (#9702)
Refactor db migration to allow restarting from
an intermediate stage.
2 years ago
zwim d6b67f42d8
[plugin, AutoWarmth] Add time offset for toggling frontlight off (#9755) 2 years ago
weijiuqiao 8500fdd519
Cloud-based sync for 2 plugins: reading statistics and vocabulary builder (#9709)
This commit adds cross-device sync ability for two plugins: reading statistics and vocabulary builder. It relies on user setting up a Cloud server (DropBox and WebDAV but not FTP though) and designating a path. Behind the curtains sqlite databases are being passed around and updated.

UI-wise, for the statistics plugin, two new menu items Synchronize now and Cloud sync to set it up (might not be the best wording) are added. As for vocabulary builder, a similar Cloud sync button is added to the menu and a shortcut icon button to Synchronize now is pinned at the bottom corner.

CloudStorage new features: WebDAV creating folders and uploading files. And a new widget-like sync server chooser. In the end I decided not to add automatic sync, as the SQL commands part seem a bit much.
2 years ago
NiLuJe 1ec6fb5fcf InputContainer/Dispatcher: Allow toggling touch input
This is made easier by the fact that only a single method in a single
widget actually handles Gesture, and that we barely ever overload it.
So, apply a bit of monkey-patching trickery to handle the magic :).

Fix #9695
2 years ago
NiLuJe ce02e92937 ExternalKeyboard: Map KEY_ESC to Back, to ease navigation 2 years ago
NiLuJe 6f29b48587 ExternalKeyboards: Drop the startup FM workaround
Unnecessary since 2db294d0b7,
as the delayed event takes care of our problem ;).
2 years ago
weijiuqiao 74eb001eca
Calendar view: adjust color palette to avoid pure black bars (#9739) 2 years ago
Roygbyte eb1e084d93
NewsDownloader: avoid some crashes (#9697)
Keep nil reference from being passed to UIManager.
2 years ago
Martín Fernández 9473c70dcc
exporter: prevent exporting documents when they're not open (#9753)
Fixes #9740

thanks to @hius07 for the hint!
2 years ago
zwim cd69382934
[plugin] AutoWarmth: fix frontlight toggle during day (#9735) 2 years ago
zwim 6717852825
AutoWarmth: add message on user change of night mode (#9715) 2 years ago
zwim 629304adce
AutoWarmth: Fix frontlight flash after resume and weird true midnight settings (#9730) 2 years ago
NiLuJe 4a355f789d ExternalKeyboard: Add a note about the special drivers sysfs knob
Just so that I don't forget about it entirely, as I haven't had to use
it so far...
2 years ago
NiLuJe 8e31bc8a68 ExternalKeyboard: Simplify the menu shenanigans
checked_func implies keep_menu_open anyway
2 years ago
NiLuJe d585cd5d86 ExternalKeyboard: Don't keep the menu open on toggle, the event cascade
may reinit stuff and close it anyway.
2 years ago
NiLuJe 2db294d0b7 ExternalKeyboard: Debounce the Connected/Disconnected events
Until we find a way to fine-tune the evdev device parsing, we'll often
have at least two devices per keyboard, but we only need a single event
;).
2 years ago
NiLuJe b28d52a124 ExternalKeyboard: Map KEY_COMPOSE to "Menu" 2 years ago
NiLuJe 5a939553fc ExternalKeyboard: Flip the hasKeys Device cap, too
This allows navigation to work as expected ;).
2 years ago
NiLuJe 53c0a65a5b ExternalKeyboard: Don't spam the "Keyboard connected" InfoMessage
Only show it for the first keyboard
2 years ago
NiLuJe 5b6d2ab66f ExternalKeyboard: Workaround bad interaction with coverbrowser when
enabled on startup
2 years ago
NiLuJe 02020176a9 ExternalKeyboard: Only disable OTG on exit
We currently did so on plugin destruction, which was a bit
overkill/annoying, as plugin instances are torn down on view
changes (i.e., when FileManager/ReaderUI are torn down) ;).
2 years ago
NiLuJe 9863a9c0bb ExternalKeyboard: Use the evdev number passed along by base to avoid sweeping the full list of input devices
This required some... creative thinking to avoid complexifying common
Input/UIManager codepaths ;p.
2 years ago
Martín Fernández 8b8d79275c
calibre metadata: prevent duplicates (#9725)
Fixes #9722
2 years ago
hius07 e1a52b5881
OPDSbrowser: fix uninitialized calibre (#9718) 2 years ago
NiLuJe f58d1c0449
Cleanup: Track color constant name change (#9716)
* Bump base

https://github.com/koreader/koreader-base/pull/1547
https://github.com/koreader/koreader-base/pull/1548
2 years ago
NiLuJe 4e233aafc0 AutoSuspend: Update the standby help message.
Tone it down for everyone, as it's been running smoothly for a while
now, but add a dedicated extra warning on buggy boards that it might
randomly implode.
2 years ago
NiLuJe b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

Also, tweak the key_events documentation to highlight the quirks of the
API, especially as far as array nesting is involved...

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2 years ago
Borys Lykah 9b2201a438
Initial hotpluggable keyboard handling (#9540)
* Added a new plugin external-keyboard. It listens to USB events. When keyboard is plugged in or plugged out, it updates device and input configuration accordingly.
* Added new fake events UsbDevicePlugIn and UsbDevicePlugOut that are emitted when a device is connected to a book reader that plays the role of USB host. The usage of the existing events UsbPlugIn and UsbPlugOut has not changed - they are used when a reader is connected to a host. The koreader-base has a related PR for those events.
* Did a small refactoring of initialization for the modules FocusManager and InputText. They check device keyboard capabilities on their when the module is first loaded and store it. Some of the initialization code has been extracted into functions, so that we can re-initialize them when keyboard is (dis)connected.
* Initial implementation centered around text input, and tested with USB keyboards on devices with OTG support.
* Said OTG shenanigans are so far supported on devices with debugfs & the chipidea driver, or sunxi devices.
2 years ago
hius07 c36a2929ac
OPDSbrowser refactoring (#9703)
Refactoring:
-removed duplicated code
-removed passing of username/password through all the modules
-logical order of the methods
-some optimizing and drying
-comments

New features:
-subcatalog link can be saved to the list of servers (eg: direct link to the catalog of books by an author)
-more book information can be fetched and shown (Book information)
-fixed access to the Standard library (by @KGKopli, closes #9372)
2 years ago
Dylan Calvin 07be320722
[plugin] OPDS: Add stream from page (#9681) 2 years ago
Martín Fernández 3530aef891
exporter.koplugin: send the right mimetype when sharing text. (#9194)
Add an option to send title too. Currently unused.
2 years ago
zwim dc2cc5cba2
AutoDim: close trapper widget explicitly (#9675) 2 years ago
poire-z 48eb02318d
Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)
When a gesture/profile was updating multiple cre settings,
each setting handler would emit UpdatePos which each would
force a re-rendering.
When this might be happening, postpone the rerendering
until all are set.
Needs some bit of refactoring to the events at play:
introduce "DocumentRerendered" event, and use it where
we used "UpdatePos" or "UpdateToc" to mean exactly that.
2 years ago
hius07 b8d9944a07
Profiles: optional registration in Dispatcher (#9623) 2 years ago
weijiuqiao 6bd7dfdf41
Vocabulary builder: add "Open..." to Dispatcher (#9634)
So it can be called from a gesture.
Also accommodate reset all in reversed order.
2 years ago
weijiuqiao edf7cc9a61
Vocabulary builder: support extracting context from pdfs (#9622)
Move getSelectedWordContext(), now document specific,
from ReaderHighlight into each document module.
2 years ago
NiLuJe d2ac2ca6e7 Cleanup: Remove unused onAnyKeyPressed handlers
And simplify the few we do catch by using aliases instead of duplicated
functions;).
2 years ago
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).
2 years ago
sonix-github ac79da05f4
[plugin] AutoStandby: Make "Update" string translatable (#9655) 2 years ago
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 ;).
2 years ago
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.
2 years ago
weijiuqiao 7fc803ffee
Vocabulary builder: supports review in reverse order (#9605) 2 years ago
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.
2 years ago
zwim 4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2 years ago
NiLuJe eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2 years ago
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.
2 years ago
yparitcher 8a754cd271 Dispatcher: Fixes, Sort & QuickMenu
Fix condition check, simplify getNameFromItem

Allow sorting Dispatcher items and displaying them as a QuickMenu
2 years ago
hius07 c5505879c3
ConfigDialog: fix bug in DoubleSpinWidget default values (#9580) 2 years ago
hius07 b0eb0ce0e1
FileManager: add Select button to the file long-press menu (#9571) 2 years ago
weijiuqiao 24edbe162f Vocabulary builder: support manually adding words to vocabulary builder 2 years ago
NiLuJe 9bf19d1bb3
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
  * A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
  * NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2 years ago
weijiuqiao 5d9f036331
Vocabulary builder: add Undo study status (#9528)
Adds button to undo last study operation (got it/forgot)
in more (...).
2 years ago
NiLuJe 62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2 years ago
hius07 b81a407690
Profiles: add QuickMenu (#9526) 2 years ago
NiLuJe 83a2965d6b
Misc: Unify error logging on network errors (#9523)
Making sure we get the relevant information in the logs, and that the UI feedback (if any), is meaningful and readable.
2 years ago
zwim 6cb352bc03
AutoWarmth: nit (#9525) 2 years ago
zwim 813bbe2ec9
AutoWarmth: add a choice to control warmth and/or night mode (#9504) 2 years ago
NiLuJe 8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2 years ago
Adam Goldsmith f2b9c5bdaf
NewsDownloader: Strip byte order mark from xml string before parsing (#9468)
Fixes #9467
2 years ago
zwim 615072c777
[AutoWarmth] optimisations and fixes to progressive warmth setting (#9442) 2 years ago
Alex Cabal 39b0ca2f36
Update Standard Ebooks OPDS URLs to new URL (#9371) 2 years ago
zwim d98fa04d13
[plugin] Fix crash in AutoWarmth (#9411)
Fixes the crash mentioned in https://github.com/koreader/koreader/issues/9409#issuecomment-1207484444?
2 years ago
poire-z d352579d06
BookMap: allow tap on ToC titles and outside page slots (#9400)
This helps jumping to page when ToC chapters are short
and the bookmap page rows narrow.
Also fix crash when invoking BookMap and PageBrowser
on a PicDocument (considered DocLess by Statistics).
2 years ago
weijiuqiao 30915546f0
vocabbuilder.koplugin: always show more button, add book filtering (#9393)
Always show more button instead of delete regardless of review count per #9383.
Adds book filtering per #9256 (from menu or by swiping up).
2 years ago
zwim ed34a3078e
AutoWarmth: fix stupid typo (#9382)
See https://github.com/koreader/koreader/pull/9337#issuecomment-1198008045
2 years ago
zwim 9d71333ade
AutoWarmth: add option to toggle/set frontlight on day/night (#9337) 2 years ago
hius07 460d42293a
PathChooser: add creating folder (#9354) 2 years ago
zwim 834dd9682a
AutoWarmth: update footer on menu actions (#9325) 2 years ago
zwim d522ebe15d
AutoDim: fix timing problems with standby (#9315)
Fix #9303.
2 years ago
zwim 0548eaa95b
CoverImage: fix translatable (#9301)
This PR fixes #9299
2 years ago
zwim 7d73a86a12
AutoWarmth: reduce schedulings for power saving (#9252) 2 years ago
zwim 05c586c4be
AutoWarmth: force setWarmth after resume (#9289) 2 years ago
NiLuJe c506d8b0ac
AutoSuspend: Some more fixes & cleanups (#9263)
* AutoSuspend: Use the canSuspend devcap check instead of reinventing the wheel.
* Device & UIManager: Cleanup canSuspend devcap check related stuff to avoid boilerplate code.
  (It also now defaults to no, and is explicitly set by device implementations where supported).
* AutoSuspend: Re-engage suspend/shutdown timers when fully charged.
  This restores the existing behavior pre #9036
  (c.f., https://github.com/koreader/koreader/pull/9258#issuecomment-1167672356)
* SDL: Unbreak the fake suspend behavior so that it actually works.
  Tweak the default screensaver message to remind users that Power is bound to F2.
  (Fix #9262)
* AutoSuspend: Re-engage suspend/shutdown timers on unplug.
  This matters on Kobo, because the unexpected wakeup guard might have stopped the suspend timer.
2 years ago
NiLuJe f0582dd37f
SystemStat: Show awake/suspend/standby breakdown in % (#9257)
Add an "awake" field in the process, and switch to `time` to prevent precision loss ;)
2 years ago
zwim 6d59ca2c6a
AutoStandby: Always reschedule properly (#9258)
If we attempted to switch to standby with an upcoming task in the near future (< 3), we would forget to re-schedule the standby timer.
2 years ago
Utsob Roy 6e647a6f4d
[plugin] Exporter getTitle Fix fix (#9255)
replaced getTitle with newer parseTitleFromPath

Fixes #9253
2 years ago
weijiuqiao 9980827145
Vocabulary builder: fix translatable string and minor UI issue (#9233) 2 years ago
zwim 6fdb83017b
[plugin] AutoDim: reschedule on every tap (#9243)
This is a maintenance PR.
With scheduling the next autodim_check on every tap, we can keep the device longer in standby mode. So we have more power savings.

The long story: The current version works like that:
Let's say I set the idle-time to 3 min and I need 2.5 min to read a page.
Start at 0 min (next scheduled check is at/in 3 min)
Read and tap to turn page after 2.5 min (next scheduled check is at 3 min - in 0.5 min)
At 3 min there is a scheduled_check (wakeup) -> reschedule check in 3 min.
Read and tap to turn page after 2.5 min (no wakeup)
Then after 1 min there is a wakeup -> reschedule.
---> So I get an additional wakeup on every second page.

This PR solves the problem: During normal reading I don't get any wakeup during reading. (The only drawback is, that one function is unscheduled/scheduled on every tap, but that is no big deal).
2 years ago
zwim 83453dfd8f
AutodDim: don't dim if frontlight is off (#9217) 2 years ago
Utsob Roy 74ca6fb317
Better meta parsing for exporter (#9220)
* Get title, author and number of pages from document's metadata
* Add exportable_title parsed from document's title, used in export file generation.
* JSON: export number of pages
2 years ago
NiLuJe a4f6693919 OPDSBrowser: Handle renderImageData failure in streamPages 2 years ago
weijiuqiao cafbf36bb2
Vocabulary builder: store word context, other tweaks and fixes (#9195)
Add a copy button and save word context (off by default), shown
via the three-dot menu of word entries.
Also some db refactoring and minor UI improvements:
- a dedicated book title table in order to shrink db size by storing
  references to title names instead of repeated actual strings,
- alignment of different forms of the "more" button and possible
 clipped words in translations.
- fix plugin name so it can be disabled
2 years ago
zwim def02846ec
AutoDim: Don't update footer if not necessary (#9192) 2 years ago
Martín Fernández 2213e6410f
[plugin] Exporter: fix crash on joplin when token is invalid (#9203)
https://github.com/koreader/koreader/issues/9197#issuecomment-1153129147
2 years ago
Wulf C. Krueger 0f238c3179
Auto frontlight plugin: Newer Oasis models are also supported (#9202)
On a Kindle Oasis 2 and 3 the plugin would be disabled due to not
checking for "KindleOasis2" and "KindleOasis3" respectively.
2 years ago
NiLuJe 2e681353d7 UIManager: Simplify setPMInputTimeout (from #9173)
This was originally designed for finer-grainbed control (specifically,
to correct by the amount of time spent in standby), but the final fix
only ever sets this to 0.

Simplify and rename (consumeInputEarlyAfterPM) to avoid useless computations.
2 years ago
NiLuJe dcb11c2542
Make luacheck >= 0.26 happy (#9174)
Re: https://github.com/koreader/koreader-base/pull/1487
2 years ago
zwim 5bcd3d0962
[plugin, Terminal] fix crash on clear screen (#9119)
This fixes https://github.com/koreader/koreader/issues/9108#issuecomment-1132243061

Tapping on clear screen during a running program like top, let's KOReader crash.
2 years ago
NiLuJe 73b2b38954
AutoSuspend: Make sure we send a LeaveStandby event ASAP (#9173)
Even in corner cases where we're woken up without user input (e.g., rtc alarm).

(Followup to #9124)
2 years ago
zwim d868da6977
[plugin, autosuspend] Clean up after #9055 (#9146) 2 years ago
Utsob Roy 6918d62bad
Pretty JSON export (#9165) 2 years ago
Utsob Roy aa4cc6da56
Exporter: fix remote error (#9167) 2 years ago
weijiuqiao 18db85ea0d
[plugin] Vocabulary builder bugfix and quick word deletion (#9168)
This PR fixes the bug #9162 caused by unsafe db operation and adds an edit mode for quick deletion of words requested at #9132 (comment)
2 years ago
Utsob Roy c71167fc6b
[plugin] Exporter: add info messages with status (#9166) 2 years ago
Utsob Roy 71c7a8a042
[Android] Highlights share (#9153) 2 years ago
weijiuqiao ee6197efff
[fix, plugin] Vocabulary builder: prevent resetting changes when reviewing backwards (#9161) 2 years ago
zwim 84c7e33606
AutoDim: Allow to dim the frontlight on idle (#9028) 2 years ago
zwim b26d3e9815
Autoturn: change to minutes and seconds (#9055)
fix #9051
and add some internal improvements (default values) to the datetimewidget.
2 years ago
weijiuqiao e1b137339c
[feat, plugin] Vocabulary builder (#9132)
Made the old dictionary lookup history into a flashcard-ish vocabulary builder.
2 years ago
Utsob Roy 6804b77251
Markdown export (#9076)
Enables users to export markdown locally with some configuration options to allow users to format the output to a certain extent.
2 years ago
NiLuJe ae5b2d68ca
AutoSuspend: Don't send LeaveStandby events from a zombie plugin instance (#9124)
Long story short: the LeaveStandby event is sent via `tickAfterNext`, so if we tear down the plugin right after calling it (in this case, that means that the very input event that wakes the device up from suspend is one that kills ReaderUI or FileManager), what's in UIManager's task queue isn't the actual function, but the anonymous nextTick wrapper constructed by `tickAfterNext` (c.f., 
https://github.com/koreader/koreader/issues/9112#issuecomment-1133999385).

Tweak `UIManager:tickAfterNext` to return a reference to said wrapper, so that we can store it and unschedule that one, too, in `AutoSuspend:onCloseWidget`.

Fix #9112 (many thanks to [@boredhominid](https://github.com/boredhominid) for his help in finding a repro for this ;)).
Re: #8638, as the extra debugging facilities (i.e., ebb81b9845) added during testing might help pinpoint the root issue for that one, too.

Also includes a minor simplification to `UIManager:_checkTasks`, and various other task queue related codepaths (e.g., `WakeupMgr`) ;).
2 years ago
Utsob Roy 46f09b9e6c
exporter.koplugin: use safe filename
fix #9130: files missing in some devices.
2 years ago
zwim 081bc6784f
[plugin, statistics] simplify ReaderProgress for better translations (#9113) 2 years ago
zwim d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2 years ago
zwim 13274d6212
datetimewidget: simpler usage, allows 2 to 6 numberpickers for date and time (#9070) 2 years ago
Martín Fernández 49c02790f6
fix: attempt to call local start_time (number) (#9086)
Follow up https://github.com/koreader/koreader/pull/8999
2 years ago
Utsob Roy bc0a55f093
Refactor exporter.koplugin (#8944)
Changed:
  - select multiple targets and export to them in a single click.
  - local targets (html, json and text) now are timestamped. Exporting booknotes on already exported documents will generate a new file with all the highlights present at export time. Previous files won't be deleted.

Fixed:
  - chapters are now correctly represented in html output.
  - json issues when exporting the whole history.
  - joplin and readwise crashes when they're unable to reach the server
  - joplin update notes mechanism.
  - joplin is able to recreate the notebook if the user deletes or renames its current one.
  - highlights of read-only documents are also added when exporting the whole history (affects mostly android, might affect desktop targets)

Co-authored-by: Utsob Roy <roy@utsob.me>
2 years ago
Philip Chan d6ff983243
Show TitleBar left and right buttons on non-touch devices (#9041)
Titlebar button navigation in menu, including ListMenu and MosaicMenu in FileManager, History, Favourites and Shortcuts.
Hide show password checkbox in non-touch devices
2 years ago
zwim 9b9cfe29a4
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2 years ago
NiLuJe 86c35ad066
A host of low power states related tweaks (#9036)
* Disable all non power management related input during suspend. (This prevents wonky touch events from being tripped when closing a sleep cover on an already-in-suspend device, among other things).
* Kobo: Use our WakeupMgr instance, not the class.
* WakupMgr: split `removeTask` in two: 
* `removeTask`, which *only* takes a queue index as input, and only removes a single task. Greatly simplifies the function (i.e., it's just a `table.remove`).
* `removeTasks`, which takes an epoch or a cb ref, and removes *every* task that matches.
* Both of these will also *always* re-schedule the next task (if any) on exit, since we can have multiple WakeupMgr tasks queued, but we can only have a single RTC wake alarm set ;).
* `wakeupAction` now takes a `proximity` argument, which it passes on to its `validateWakeupAlarmByProximity` call, allowing call sites to avoir having to duplicate that call themselves when they want to use a custom proximity window.
* `wakeupAction` now re-schedules the next task (if any) on exit.
* Simplify `Kobo:checkUnexpectedWakeup`, by removing the duplicate `WakerupMgr:validateWakeupAlarmByProximity` call, now that we can pass a proximity window to `WakeuoMgr:wakeupAction`.
* The various network activity timeouts are now halved when autostandby is enabled.
* Autostandby: get rid of the dummy deadline_guard task, as it's no longer necessary since #9009.
* UIManager: The previous change allows us to simplify `getNextTaskTimes` into a simpler `getNextTaskTime` variant, getting rid of a table & a loop.
* ReaderFooter & ReaderHeader: Make sure we only perform a single refresh when exiting standby.
* Kobo: Rewrite sysfs writes to use ANSI C via FFI instead of stdio via Lua, as it obscured some common error cases (e.g., EBUSY on /sys/power/state).
* Kobo: Simplify `suspend`, now that we have sane error handling in sysfs writes.
* Kobo.powerd: Change `isCharging` & `isAuxCharging` behavior to match the behavior of the NTX ioctl (i.e., Charging == Plugged-in). This has the added benefit of making the AutoSuspend checks behave sensibly in the "fully-charged but still plugged in" scenario (because being plugged in is enough to break PM on `!canPowerSaveWhileCharging` devices).
* AutoSuspend: Disable our `AllowStandby` handler when auto standby is disabled, so as to not interfere with other modules using `UIManager:allowStandby` (fix #9038).
* PowerD: Allow platforms to implement `isCharged`, indicating that the battery is full while still plugged in to a power source (battery icon becomes a power plug icon).
* Kobo.powerd: Implement `isCharged`, and kill charging LEDs once battery is full.
* Kindle.powerd: Implement `isCharged` on post-Wario devices. (`isCharging` is still true in that state, as it ought to).
2 years ago
Utsob Roy 4e517f4839
[plugin] Exporter: properly sort highlights when exporting (#9021)
Since the bookmarks table is sorted based on the bookmarks'
position in the book, it is possible to sort clippings in
the exporter plugin based on that.
2 years ago
NiLuJe 5ac9463c09
AutoSuspend: Unbreak cohabitation between standby & suspend (#9009)
* Make sure AutoStandby cohabitates nicely with AutoSuspend (regression since #8985), specifically:
* Disable standby during suspend.
* Ensure that leaving standby restores the scheduled suspend properly, with the appropriate remaining amount of time based on the last user input.
* Handle devices with an auxiliary battery better when scheduling suspend (assume it's only charging when the aux battery is charging, not the ereader's).
* Tweak debug logging to be able to remote debug corner-cases more easily without requiring code changes.
* Fix erroneous behavior when awoken from standby by something that doesn't trigger an InputEvent Event (e.g., rtc alarm, gyro, or random bullshit).
2 years ago
lennonhill 08d6fbc9db
[plugin] Wallabag: archive instead of deleting read articles by default (#9018)
Fix <https://github.com/koreader/koreader/issues/8936>.
2 years ago
Dylan Garrett 8c58541c59 Add auto_tags setting. Combine UI code for auto_tags and ignore_tags 2 years ago
Dylan Garrett 7d04370558 Initial work to allow auto tagging 2 years ago
lennonhill 4fe39d6d43
[plugin] Wallabag: add basic error handling and abort synchronisation on request error (#8950)
Fixes <https://github.com/koreader/koreader/issues/8949>.
2 years ago
NiLuJe 5bb22709f7
Terminal: Make sure devpts is mounted on Kobo (#8998)
* Terminal: Make sure devpts is mounted on Kobo

Fix #8986
2 years ago
NiLuJe 087b97457d
AutoSuspend: Handle standby scheduling in the same manner as suspend/shutdown (#8985)
Specifically, don't forcibly unschedule/schedule on every input event, instead, let the scheduled task figure out if the deadline came to pass or not ;).

c.f., https://github.com/koreader/koreader/pull/8970#issuecomment-1092775830

Besides getting rid of some overhead, this allows proper scheduling after a task that would have blocked for longer than the standby timeout.
2 years ago
NiLuJe 2c25181644
Terminal: Make the prerequisites check verbose (#8994)
So we actually have a chance of understanding why it fails to load ;).

(Also, properly require posix FFI stuff, in the unlikely event they aren't already in the main namespace).
2 years ago
NiLuJe 61cafab0e5
AutoSuspend: Avoid unbalanced prevent/allow Suspend calls (#8970)
This prevents crashing interactions with other prevent/allow callers when the feature is disabled.
2 years ago
zwim b845674bed
[plugin] String and formatting (#8980)
Easy the life of translators and fixes a stupid string typo.
2 years ago
zwim 158f4be724
Autosuspend: add autostandby (#8815)
Allows the device to go into standby (if available in `/sys/power/state`) to save power.
Adds an entry in the device menu to tune the timeout for standby.
(Shows total standby- and suspend-time in system statistics.)
2 years ago
Scarlett d53ee056cc
Revert NewsDownloader (#8953)
My volumize PR introduced too many issues. Revert to previous version of NewsDownloader until they can be resolved.

Fixes #8867 

Reintroduces  #8799, #6234
2 years ago
yparitcher c9bfb74d2a Book Shortcuts: allow recursively searching folders 2 years ago
Frans de Jonge eeefc657cb
[fix, plugin] Wallabag: avoid crash when setDownloadDirectory doesn't have a touchmenu_instance (#8933)
Fixes #8930.
2 years ago
NiLuJe 23cd7e24bb
Minor Lua I/O cleanups (#8921)
Mostly making sure we always explicitly close io handles.
2 years ago
Utsob Roy af7c8cade8
[feat, UX] CoverBrowser: add progressbar in Mosaic View (#8915) 2 years ago
Utsob Roy d266d320e2
[plugin] Exporter: optimized JSON export (#8904)
I've implemented a better JSON export format that removes redundant lists and objects and introduces the `entries` key containing all the entries.

It also add `drawer` values from highlight so that user can use this piece of metadata to generate desirable output.
2 years ago
Tesseract Cat d4bbd74208
Add OPDS PSE 1.0 support (#8919)
This PR adds support for the unofficial page streaming extension for OPDS. See: https://anansi-project.github.io/docs/opds-pse/specs/v1.0. This is useful for streaming comics from a remote server.

Addresses #7500.
2 years ago
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
2 years ago
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>.
2 years ago
NiLuJe 217a73f3c0
Initial Kindle PW5 support (#8856)
* Rejig frontlight warmth API to more closely match the existing API, and, hopefully, clarify some of its quirks, and reduce boilerplate and duplicate code in platform implementations.
* Tweak Kindle:setDateTime to prefer using the platform's custom script, as in interacts better with the stock UI. And make the fallbacks handle old busybox versions better.
* Add Kindle PW5 support ;).
* Add warmth support to the Kindle platform.
* Random TextBoxWidget cleanups: make sure we immediately free destroyed instances.
* FrontLightWidget: Refactor to make it slightly less obnoxious to grok and update; i.e., separate layout from update, and properly separate brightness from warmth handling. Move to simpler widgets instead of reinventing the wheel.
* TextBoxWidgets: Implement `setText` to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button).
* NaturalLightWidget: Make sure we pass a string to InputText
* InputText: Add debug guards to catch bad callers not passing strings ;).
2 years ago
hius07 7b4d6fd205
History: filter by book status (#8820) 2 years ago
Emir Taletovic 3e78847c46
Calibre plugin - Fixed hang when book has series but series index is nil (#8870) 2 years ago
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
2 years ago
zwim eef4dc1c0d
Terminal: fix regression from #8845 (#8848)
This should fix a regression introduced with #8845 with reopening a running shell.

Adds more checks and more verbose logging messages on failures.
2 years ago
zwim 1cd396f9c4
Teminal: fix crash when grantpt or unlockpt fail (#8845)
* Fix crash when grantpt or unlockpt fail
* Disable plugin if grantpt or unlockpt fail
2 years ago
Frans de Jonge 67445beea5
[plugin] Terminal: remove stray space at end of string (#8831) 2 years ago
contrun 57188311da
kosync: send progress as a string to the server (#8758)
Currently the progress sent to the server can be either a string or an int (depending on whetther the document has pages).

The following are both payload sent from koreader to the server.

```
{"percentage":0.005,"device":"device_name","device_id":"B78EA04ACC3A453DBA220D720C0BE102","document":"348e34463a44ba68659fc6fe814a6778","progress":3}
```
where document `348e34463a44ba68659fc6fe814a6778` is a pdf file.

```
{"percentage":1,"device":"device_name","device_id":"B78EA04ACC3A453DBA220D720C0BE102","document":"4eb484b229696cb39cd8fe5495aa1bbe","progress":"\/body\/DocFragment[30]\/body\/p\/img.0"}
```
where document `4eb484b229696cb39cd8fe5495aa1bbe` is an epub file.

This may add extra work to the backend server. A few commits were added to my personal fork of [kosyncsrv](https://github.com/yeeac/kosyncsrv) (a kosync backend server). kosyncsrv initially tries to decode progress as a string. It then failed on document with pages (in which, progress is just integer page number). I then change the field's type, only to [revert it later](8a642e31a0).

I believe it is more appropriate for us to fix the progress type to string.
2 years ago
Frans de Jonge 8ff8a05ff3
[plugin] Terminal: move stray newlines outside of translated string (#8830) 2 years ago
Frans de Jonge 4d6a789f6d
[plugin] Terminal: fix @translators comments (#8829) 2 years ago
Scarlett c3332f355f
NewsDownloader: add support for RDF feeds (#8822)
Fixes #8799.
2 years ago
hius07 8dbfead03d gestures: free long-press on FM home button 2 years ago
hius07 8bb08b503a
Cloud storage: enhance download dialog, fix Dropbox uploading (#8809)
(1) ButtonDialogTitle: new method setTitle()

(2) OPDSbrowser
-use setTitle() instead of open/close ButtonDialogTitle (no visual changes to the download dialog)
-reduce logger.info output to avoid flooding crash.log

(3) CloudStorage
-enhance download dialog (similar to OPDS), much optimized code of downloadFile
-fix a bug: cannot create new folder or upload files to the root of the Dropbox storage
2 years ago
hius07 c9fc9496aa
BookShortcuts: fix folders handling (#8795) 2 years ago
hius07 59f04ab018 ReaderProgress: insert TitleBar 2 years ago
hius07 77d3882eed CalendarView: remove close button! 2 years ago
hius07 605b09afbe CalendarView: remove unused CalendarTitle 2 years ago
Frans de Jonge c2812c7956
[plugin] Update capitalization style "Terminal Emulator" → "Terminal emulator" (#8759) 2 years ago
poire-z c627dfd63f ReaderStatistics: avoid self.kv leaking after close 2 years ago
poire-z 83172d62ae ReaderStatistics: reset stack/link on showing first widget
Reset self.kv stack/link on showing first widget.
This avoids return arrow to possibly show previously
displayed old and unrelated KeyValuePage.
Note: when closing a leaf KeyValuePage, the previous
one will leak as self.kv.
2 years ago
poire-z 67b17d0845 ReaderStatistics: allow reset statistics per period per book 2 years ago
poire-z f764a61b69 KeyValuePage: allow for more fancy callbacks
Add support for hold_callback.
Provides kv_page and kv_item to callbacks.
Allow for item removal and refresh.
2 years ago
poire-z 516c3d3225 ReaderStatistics: fix current page stats on close/suspend
Fixes current page statistics (duration) ignored when
document closed, or when suspending and resuming.
On suspend/resume, update the page start ts by the
time spent sleeping, so its duration will be the time
spent on it not sleeping.
2 years ago
poire-z 3a5dbe3420 ReaderStatistics: remove id_book parameter to insertDB()
As it should always just work on the current book.
Also remove uneeded getCalendarView().
2 years ago
zwim 8cff5f88b0
Teminal emulator: fix translatable, fix potential crash (#8756) 2 years ago
Martín Fernández f0197423ad
remove send2ebook plugin (#8747) 2 years ago
zwim b924f38dc0
Terminal emulator: fix elinks 'q' crash (#8749)
This fixes a crash in terminal emulator on exit of elinks.
see: https://github.com/koreader/koreader/pull/8636#issuecomment-1024956177
2 years ago
zwim 7220bdea4f
[fix, plugin] Terminal ldoc (#8742) 2 years ago
zwim f2557a7aa6
Terminal emulator: full rewrite, real vt52 emulator (#8636)
New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
2 years ago
Adrien Gallou 66afbf15f6
wallabag : fixes synchronization when "send review as tags" is checked (#8733)
In this PR https://github.com/koreader/koreader/pull/8637
It worked on my sev environnement, but when updating my device, there
were synchronization errors.

Apparently sometimes documents do not have a summary.
To avoid an error during the synchronisation this change adds checks
when getting tags for the document.
2 years ago
poire-z 95b35ec669 Allow any multiswipe to close some fullscreen widgets
For consistency with BookMap and PageBrowser widgets
where swipe south (the usual gesture to quick close)
can't be used for closing and we had to use any
multiswipe instead, allow any multiswipe to close
these other fullscreen widgets too:
Menu (ToC, Bookmarks), KeyValuePage, ImageViewer,
BookStatusWidget, ReaderProgress, CalendarView.
2 years ago
hius07 c9b4e43bf9 OPDSbrowser: bookinfo multiline title 2 years ago
poire-z 16e3b2f0ac Allow Backspace to work as back button 2 years ago
Scarlett 8a04dc9852
NewsDownloader: new option to allow EPUB volumization (#8263)
When this feature is enabled on a feed and that feed is
synced, all new feed entries will be collected into a new
single EPUB file. This is achieved by implementing a feed
history feature (downloaded feeds are added as M5D hashes
to a LuaSettings file), and by introducing additional
methods into epubdownloader.lua that allow for multiple
HTML documents to be added into single EPUB file.
2 years ago
yparitcher 295ef6b9f7
Battery Stat: for real (#8694)
Thanks @hius07
2 years ago
Martín Fernández 963970be8c
exporter plugin: fix history dir (#8685)
for platforms where history dir don't match installation path.

Fixes #8675
2 years ago
zwim b21dc4dcc6
Autosuspend: fix 'Disable' not disabling (#8684) 2 years ago
poire-z f21a12360a CoverBrowser: use translations for error messages 2 years ago
yparitcher 517dfa3549
Battery Stat: Fix remaining & per hour numbers (#8688)
regression from #8491
papered over in #8582
Fixes #8644 #8687

Root cause was util.secondsToClockDuration (called by duration) takes seconds and we were giving it hours as `Change per hour` needs hours
2 years ago
hius07 334a913b0e
OPDS catalog: add title Plus/Home button (#8660) 2 years ago
hius07 5c39c19a73
[chore] Remove leftover: cface (#8659)
Ancient menu widget had it.

Not used anymore.
2 years ago
hius07 1bfb49c6a5
PathChooser: add left Home button (#8646) 2 years ago
Adrien Gallou 1d40949699
[plugin] Wallabag: add option to send tags added in review (#8637) 2 years ago
hius07 55532b1397
Menu widget: insert TitileBar (#8639) 2 years ago
yparitcher 71172253b7 covermenu/listmenu: mandatory should not be nil
Caused by #8598
2 years ago
poire-z 5aeb5b9107 CalendarView: update to TitleBar widget 2 years ago
poire-z bc16b32395 Add Book map and Page browser features
- Book map: shows a map of content, including TOC,
  boomarks, read pages, non-linear flows...
- Page browser: shows thumbnails of pages.

- ReaderThumbnail: new Reader module that provides
  a service for generating thumbnails of book pages.
  It makes available these 2 new fullscreen widgets.
- ReaderBookmark, ReaderLink, Statistics: add methods
  to return new views of bookmarks, previous locations
  and read pages, that are needed by BookMapWidget.
- ReaderToc: compute TOC max_depth.
- ReaderBookmark, ReaderHighlight: send events on
  bookmark add/update/remove so thumbnails of the
  pages impacted can be trashed.
2 years ago
QJKX 71af6c9382
OPDS: add Standard Ebooks server (#8606)
Standard Ebooks is roughly a small subset of
Project Gutenberg with better formatting.
2 years ago
Dylan Garrett 19c13b8a32
[plugin] Exporter: ensure we're connected before sending highlights (#8604) 2 years ago
hius07 e65ff7b7c8
[plugin] DocSettingTweak: disable on NT devices (#8599)
In the same way as a31d944. Closes #8596.
2 years ago
hius07 4b5ea1197c
[plugin] Exporter: HTML template fix (#8592)
Changes in accordance with #8535:
-add html and body tags to support older embedded browsers
-bookmark note formatting: grey letters, indented, without title
(Massive changes are caused with the indentation along the tags).
2 years ago
hius07 c7715aa7d5
[fix] batterystat: change per hour (#8582) 2 years ago
Dylan Garrett bf3aef348a
[plugin] Exporter: handle newlines in HTML highlight export (#8551)
Based on some feedback from #8548 and #8535

This also sets the charset to UTF-8 to support more characters.
2 years ago
zwim befc0d9c83
[Coverimage, plugin] Clean up, typo (#8565)
SizeSpinner: "Set" is disabled if the value has not changed, so no need to check this in the callback function.

Corrected typo.

Optimized code.
2 years ago
Dylan Garrett 3cf3c97e87
[plugin] Exporter: add Readwise.io support (#8548)
This extends exporter.koplugin with support for [Readwise.io](https://readwise.io), a highlight/notes aggregation service.

[Readwise API documentation](https://readwise.io/api_deets)

This additionally improves the highlight exporter's ability to get the correct title and author of a document, by checking actual metadata instead of inferring from filename. It also includes a modification to the plugin's highlight parsing logic to separate the highlight contents in `.text` from the notes in `.note`. This change actually fixes an existing bug in the HTML export template note.tpl, which has been missing notes because of the lack of the `.note` field.
2 years ago
yparitcher e0424e644f cre is a global after engineInit() 2 years ago
hius07 1df6ab751b
ButtonDialogTitle: no bold font in the title by default (#8557) 2 years ago
hius07 a703b213f7
File manager: group operations (#8536)
Copy/Move/Delete for group of files.
"Select files" button in the filemanager Plus menu.
2 years ago
hius07 02ddd41b38
OPDS: rename a book before downloading (#8520) 2 years ago
zwim 4fd4861d09
Fix unused variable (#8518) 2 years ago
zwim e1f62e6098
[autowarmth, plugin] fix CI (#8513) 2 years ago
zwim c676aa6f0d
[autowarmth, plugin] use date time widget, optimize (#8502) 2 years ago
hius07 ad09411c3f
DoubleSpinWidget buttons move (#8490)
Move Default and extra buttons above Cancel/OK.
Default values shown in the default button.
Precisions can be set for both values separately.
Minor geometry fix for consistence with SpinWidget.
2 years ago
zwim ef4d88ccd6
Battery stats plugin: tidy up, single page (#8491)
KeyValuePage: add a 'single_page' option to force
showing all items on a single page.
2 years ago
hius07 c7a3c17ce0
Gesture intervals spinwidgets - do not show default value in info-text (#8488)
Default values are now shown in SpinWidget default button.
Optimized SpinWidget calls.
2 years ago
zwim b029a6a1ff
[autosuspend, plugin] Switch to datetimewidget and provide default values (#8480) 2 years ago
zwim e9ba854ff0
DeviceMenu: Colons and more information (#8435)
Add information to device menu entries
2 years ago
yparitcher 1b2b4da9e5
Multiswipe menu: return to item page when going up from submenu (#8474) 2 years ago
yparitcher 8207bdc3e3
BookShortcuts plugin: folder support (#8449)
Allow setting a folder as a book shortcut, with 2 options:
- open file browser: opens the FM in that folder
- last book: opens the most recently read book (via
  ReadHistory) in that folder
2 years ago
Dylan Garrett 26ec5bafe3
[plugin] Display OPDS download titles if available (#8441)
I've found that some OPDS catalogs have multiple downloads of the same filetype, but optimized or formatted in different ways. The Title of the download is much more descriptive in this case, so I thought it would be better to display the title if available.

The OPDS catalog at https://standardebooks.org/opds is a good example. Note how entries in https://standardebooks.org/opds/new-releases have three different epub downloads, titled "Recommended compatible epub", "Advanced epub", and "Kobo Kepub epub".
3 years ago
zwim 15778ac939
[plugin] Autowarmth: Fix sanity check for longitude (#8434)
This PR will fix https://www.mobileread.com/forums/showthread.php?t=342905
3 years ago
zwim eb4e958303
[Coverimage, plugin] Colons in menus; unlock sizespinner (#8430) 3 years ago
Frans de Jonge aa3fa5abfa
[fix, plugin] Gestures migration: check if setting exists instead of assuming it does (#8409)
Fixes <https://github.com/koreader/koreader/issues/8406>.
3 years ago
zwim 23a1ef2db2
[Autowarmth plugin] Optimisations; Documentation (#8397)
* Documentation; Improved accuracy
* Documentation update
* Remove todo tag for circleCI
* Cleanup
3 years ago
zwim 6aa0d802ec
[autowarmth, plugin] Bug if all scheduler entries are deleted (#8386) 3 years ago
zwim 54605d8313
[Autowarmth, plugin] Corner case for warmth setting; warmth on resume for KA1 (#8373) 3 years ago
Aleksa Sarai d0d2d0d1d6
*: luacheck fixes (#8368)
These weren't caught during the Japanese support plugin review.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
3 years ago
Frans de Jonge 59710ec67a
[chore] Fix todo and fixme tags (#8365)
Slightly overlooked in #8312.
3 years ago
Aleksa Sarai 3d4e54c7e6 plugins: add Japanese Support plugin
This plugin provides support for Japanese deinflection during lookup as
well as making long-hold word selection actually select whole words
properly. With this plugin, word lookups in Japanese text in KOReader
become much easier, and no longer requires users to use special
dictionaries that have synonym-based deinflection rules defined (which
were always fairly annoying to use).

The basic idea and deinflection data for this plugin come from
Yomichan (which is also a GPL-3.0+ project), but everything was
implemented specifically for KOReader.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
3 years ago
poire-z 37eb53f6e4
DocSettings/Purge .sdr: reword, don't purge other books (#8348)
Reword "Purge .sdr" to "Reset settings".
When purging, remove only the known document metadata
files, and not those for a document with the same name but
a different suffix.
3 years ago
zwim 09725e518a
Autowarmth: wording, move expert-mode menu entry down (#8350) 3 years ago
zwim 6492583e96
Autowarmth: wording, help_text, menu tweaks (#8338) 3 years ago
zwim 6b5cf63d07
Autowarmth: fix info text alignment issues (#8271) 3 years ago
zwim cde13360ae
Fix bug when leaving/entering FM/reader (#8295)
This should fix #8293
3 years ago
Galunid d4628666c9
Statistics: Read page duration limits: allow min=0s (#8273)
Allow for always counting page as read, regardless of time spent.
3 years ago
Frans de Jonge a21b5be64a
[chore] NewsDownloader: various minor string fixes (#8268)
Follow-up to <https://github.com/koreader/koreader/pull/8267>.
3 years ago
Frans de Jonge e865fb9114
[chore] NewsDownloader: remove stray space (#8267) 3 years ago
zwim 2dfbf56624
Autowarmth: Make Information in easy mode more beautiful (#8264) 3 years ago
zwim c8e55ec997
Autowarmth text formatting (#8262)
* Wordings; easier translation formatting

* use variable for tab_width (18)

* Add an indent parameter for formatting
3 years ago
zwim 9ed22df03f
DateTimeWidget: replaces DateWidget and TimeWidget (#8240)
Deduplicate code by combining DateWidget and TimeWidget.
ReadTimer plugin: some rewording.
3 years ago
zwim 20f7d14495
Plugin: Auto warmth and night mode (#8129)
("Auto nightmode" only on devices without warmth.)
3 years ago
hius07 1e47cd7e5f
SpinWidget: similar size in portrait and landscape (#8226) 3 years ago
NiLuJe 0c913b6043 BookInfoManager: Minor fixes & tweaks in `collectSubprocesses`
* Don't run multiple collectSubprocesses tasks in parallel.
  UIManager:scheduleIn doesn't return anything, using that as a boolean trap made no sense.

* Make the in-place removal of collected pids use a slightly more common idiom
  (table.remove in a reverse iteration of said array).
3 years ago
NiLuJe 48da545e32 Kobo/Elipsa: More fine-grained control over the amount of online CPU
cores

* Only keep a single core online most of the time.
* Device: Add an enableCPUCores method to allow controlling the amount of
  online CPU cores.
* Move the initial core onlining setup to Kobo:init, instead of the startup script.
* Enable two CPU cores while hinting new (e.g., cache miss) pages in PDF land.
* Enable two CPU cores while processing book metadata.
* Drive-by fix to isolate the DocCache pressure check to KoptInterface
  and actually apply it when it matters most (e.g., k2pdfopt stuff).
3 years ago
hius07 859327dea5
Input dialogs: keep size in rotation (#8223) 3 years ago
roygbyte a4763a613f
[chore] Newsdownloader: Fix more luacheck warnings (#8220) 3 years ago
roygbyte 0af6500c88
[chore] Newsdownloader: Fix warnings from luacheck (#8214)
* Fix warnings from luacheck

* Fix punctuation and casing in comments.
3 years ago
roygbyte b0ceab5b20
[plugin] NewsDownloader: fix XML, better error messages, change default feed, and more (#8145)
* Fix XML, introduce some better error messages, etc.

See roygbyte/newsdownloader.koplugin for more info

* Fix feed attribute saving snafu; Change menu labels; etc.

Also:
- Change default feed
- Change "remove" label to "delete"
- Hide menu after feed sync
3 years ago
yparitcher c40874d300 book shortcuts plugin 3 years ago
yparitcher 1f8574cf7e Dispatcher:removeAction()
Gestures: use sub_item_table_func to allow the menu to refresh on change
3 years ago
yparitcher f5dc7b4539 Dispatcher: Revamp sections and item order 3 years ago
roygbyte 024fd52781
Fix OPDS plugin bug wherein Arxiv PDF document acquisition URLs are not given a callback to download (#8210)
* Add comments to a few functions

* Fix bug associated with arxiv catalog.

See comments in genItemTableFromCatalog. Basically, though, the bug
was related to the checking of the acquisition urls. Arxiv only has
PDFs available to download, and the block wasn't catching these with
its existing logic. By adding another clause to look for PDF link
types, and fixing href values that were missing the PDF suffix, we can
successfully download PDFs from Arxiv.
3 years ago
NiLuJe 9a7450ea5f Statistics: Guard against ReaderView's state.page being nil
For... whatever reason? I can't really see that happening, but, oh,
well.

Screensaver already guards against it, so, who knows.

Fix #8201
3 years ago
hius07 ab4e27908b
Standardize: long-press/hold to long-press (#8185)
* Gestures: standardize hold to long-press

* Common settings menu: standardize hold to long-press

* Readerstyletweak: standardize hold to long-press

* Readersearch: standardize hold to long-press
3 years ago
Martín Fdez a63c22b6fb calibre: gui to choose default extension 3 years ago
yparitcher 3b6f521e26 Statistics: move dispatcher items to plugin 3 years ago
yparitcher eb949d6ebf Dispatcher: add Battery & System statistics 3 years ago