Commit Graph

1174 Commits (master)

Author SHA1 Message Date
Piotrek Marciniak 9b1a21ef82
Export highlights: empty annotations as nil instead of empty string (#11912)
Fixes Readwise exports
4 months ago
SomeGuy eb63cf655f
CoverBrowser: update MosaicMenu FocusManager grid view to 2D (#11906)
This PR [and #11884] are for #11834.
4 months ago
hius07 c6e6d72cf3
Collections: add collection mark to books (#11868) 4 months ago
NiLuJe 4d9c6523ad
Input: Some more followups to the input device auto-detection stuff (#11855)
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...

This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
4 months ago
nairyo 126c01e1b5
Replace tweak_buttons_func with an event instead (#11777)
Also see https://github.com/Ajatt-Tools/anki.koplugin/issues/22
4 months ago
NiLuJe fd5260f2ce
Support auto-detection of input devices via fbink_input (#11807)
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
4 months ago
Nico Hirsch 3e04184638
calibre: add wireless connectionstart/stop actions (#11806)
* Register start stop connection actions

* Match code order

* Title to lowercase
4 months ago
peicuiping a7e34673e6
chore: remove repetitive words (#11785) 5 months ago
hius07 c47d3b3177
Menu widget: cleanup (#11759) 5 months ago
zwim bf58723af1
[CoverImage] Honor rotation after opening of a book (#11752)
If rotation changes, create a new cache entry and use that if necessary.

Fixes #11713.
5 months ago
SomeGuy e51b71f463
[Gestures.plugin] Clarify some rotation gesture strings (#11753) 5 months ago
poire-z 03d16270d9 Statistics: handle correctly page change when reading paused
As currently we only handle ReadingPaused/Resumed on suspend
and resume, no page change should happen while paused, so
there is no current issue to fix. But let's get ready for
other use cases (which may be brought in by user patches,
ie. pausing while the SkimWidget is displayed, and obviously
triggers page changes).
5 months ago
poire-z 1c9a6509a2 HttpInspector: allow browsing global variables 5 months ago
hius07 d82815952e
Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
5 months ago
hius07 6b0d97bf22
Multiple collections (#11693) 5 months ago
Max Ignatenko 87c85bf94d
NewsDownloader: use <content:encoded> from RSS item, if available (#11694)
This makes it work much nicer for feeds that provide the full content in the feed itself.
5 months ago
Max Ignatenko b872191dc9
Stop touching night mode when control_nightmode == false (#11685)
This is a regression introduced in #10762
5 months ago
hius07 c8c4e0301a
covermenu: fix file dialog (#11576) 6 months ago
Frans de Jonge 20813cab53
Wallabag: properly deal with mimetype actually being content-type (#11532)
A typo snuck in #11492, which should've read `not type(article.mimetype) == "string" or type(article.mimetype) == "string" and not article.mimetype:find("^text/html")`. But in most cases the behavior would've been identically broken because of the same underlying issue: Wallabag mimetype is actually HTTP content-type.

Fixes #11528.

Also introduces a new setting associated with the behavior in case people have different preferences.
6 months ago
hius07 66afeebe85
CoverBrowser: show cached cover of deleted file in history (#11523) 7 months ago
Frans de Jonge 3e7ab199e7
Wallabag: match `text/html` mimetype as starting with rather than exactly (#11492)
Previously unnoticed or changed Wallabag behavior can provide a mimetype of for example `text/html; utf-8`, which wouldn't be an exact match to `text/html`.

Fixes #11481.
7 months ago
weijiuqiao 5939c82bcf
VocabBuilder.koplugin: support batch operations in book filtering (#11475)
Added support
1. Select only this book
2. Select all books
3. Select all books on this page
4. Deselect all books on this page 

when filtering.

Ref. #11471
7 months ago
hius07 5d4747c593
FileManager: less lfs calls (#11452)
Use item info provided by FileChooser.
Also fix showing PathChooser with invalid path,
and fix issue when opening non-supported files.
7 months ago
poire-z fb39fe93ed Fix docs CI failing after previous commit 7 months ago
poire-z 0506ffe289
HttpInspector: new plugin for developers to inspect KOReader (#11457)
Can be used to inspect the state of the objects in
a running KOReader.
It can also be used to execute actions (like the ones
available to associate to a gesture) with HTTP requests
from a remote computer/devices/gadgets.
The TCP server side is provided either with a new
ZeroMQ StreamMessageQueueServer (thanks bneo99),
or with a LuaSocket based SimpleTCPServer.
Minor UIManager tweak to avoid uneeded inputevent
when such a ZeroMQ module is running.
7 months ago
hius07 50fcc04725
CoverBrowser: do not call lfs on every item (#11449) 8 months ago
hius07 b8090c641c
Minimize DocSettings:open() calls (#11437) 8 months ago
hius07 d94b819eb1
CoverBrowser: use bookinfo cache in Classic mode (#11404)
Getting bookinfo from the cache db is much faster than opening a book, let's use it in Classic mode too.

With fallback if no metadata available.
8 months ago
hius07 b832d43d98
CoverBrowser: fix classic mode update cache (#11398) 8 months ago
hius07 f246b3d19c
Text editor: refresh path on saving file (#11396)
File size was changed.
8 months ago
NiLuJe 75ffc3bb76 Terminal: Better yet, disable it properly on prereq failure 8 months ago
NiLuJe a906838123 Terminal: Clearer error message on prereq failures
Pluginloader uses pcall, so, throw with an actual error message

Re: #11394
8 months ago
NiLuJe 90ae4acca6 Chore: Review FrameContainer constructors for shared dimen objects
Nothing else seems problematic, this is mostly just cosmetic sanitization
around Geom objects.
8 months ago
NiLuJe 65e22ceafc Widgets: Fix a bunch of regressions after the FrameContainer change in #11364
FrameContainer now preserves its self.dimen, which means it cannot be
shared with another widget or container that might also modify it during
painting ;).

Fix #11370
Fix https://github.com/koreader/koreader/pull/11364#issuecomment-1894454657
Fix #11379
8 months ago
hius07 e0ed04a1a1
CoverBrowser: fix cover cache check #2 (#11380) 8 months ago
hius07 43831236ce
CoverBrowser: doc_settings cache improvement (#11360) 8 months ago
hius07 234a68d80b
CoverBrowser: fix cover cache check (#11356) 8 months ago
hius07 ea9ef6781c
CoverBrowser: adjustable mosaic grid (#11232) 8 months ago
lbesnard 5a3f73766c
Exporter: memos, replace space with underscore for # tag creation (#11107)
Creating tags on memos looked like "#This is a book title" meaning only "#This" would become a Tag. Replacing spaces with underscore to be more usable so that the following tag would be created "#This_is_a_book_title"
9 months ago
Tomáš Janoušek ccbfbabb25
Fix "Move current book to archive" (#11321)
updateItemByPath has recently been replaced with updateItem in both
readhistory and readcollection.

Fixes: aabd6d7a26 ("File browser, Collection: improve group actions (#11178)")
Fixes: https://github.com/koreader/koreader/issues/11320
9 months ago
mergen3107 57cbde5901
[plugin] Add folder check in move-to-archive (#11262) 9 months ago
NiLuJe ac5d662eb4
Statistics: Also skip hidden flows stuff in continuous mode (#11284)
Followup to #11279
9 months ago
greatyingzi c12b4f2e14
Statistics: fix a crash in continuous mode opening statistics page (#11279) 9 months ago
mergen3107 9ba66ac382
Exporter - fix android shares (#11259) 9 months ago
NiLuJe 33b54f5574
Kindle: Add a hasLightSensor devcap, and use it in the AutoFrontlight plugin (#11255)
Add the Scribe to the list while we're there
9 months ago
NiLuJe 9ab866598a ReaderProgress: Ensure a sane dimen
Otherwise, depending on the DPI, the size computation might not cover
the full-screen, leaving gaps to what was behind the widget.

Fix #11177
9 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 9 months ago
mergen3107 0d2f8fbb3f
Terminal Emulator: Fix former_buffer crash (#11230)
Closes #11229
9 months ago
hius07 f4a5a2b60a
TextViewer: add dialog to set font size and justify text (#11210) 9 months ago
hius07 dce12de09d
Profiles: fix update actions in gestures (#11175) 10 months ago
hius07 f6fb35fd98
QuickMenu: keep open on apply (#11135) 10 months ago
NiLuJe 2554aee7a3 Gestures: Make the edge swipe zones configurable
As "global defaults" (i.e., "advanced settings" in the UI).

These were the only zones not available there, for some reason (probably
they were new and we try to avoid adding new defaults).

Fix #11142
10 months ago
Ben Bell f92c0eae3b
Exporter: fix XMNote export, add author field (#11134)
Optimize #11087 :

1. In `isReadyToExport`, check if the ip is set. If not, then the user cannot enable xmnote export.
2. Add author field in highlights.
10 months ago
WangKe dea94026f1
Exporter: add XMNote export (#11087) 10 months ago
hius07 ed46dca886
MoveToArchive: fix DocSettings:updateLocation() call (#11103)
Closes #11101.
10 months ago
hius07 51f3115b90
Profiles: fix updating gestures (#11072) 11 months ago
hius07 68aa209a6c
Open with... improvement (#11056)
Allows associating filetypes with non-document providers (like ImageViewer or TextViewer) to "open" (view) these files by a tap in file browser.
11 months ago
zwim 58cb1ff42b
[AutoWarmth] Fix sanity checks with disabled schedule entries (#11062) 11 months ago
Frans de Jonge 9e82761c45
[lang] Exporter: minor stylistic changes to Memos capitalization and dialog titles (#11032) 11 months ago
Frans de Jonge edf9798bb7
[lang] Exporter: add translator's note about Flomo (#11031) 11 months ago
hius07 2ed2c2c23d
md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
11 months ago
hius07 e9051353a2
Vocabbuilder: fix docless title (#11008)
Closes #11006.
11 months ago
夏鲁豫 ff6ee69753
Exporter: fix memos export, add flomo export (#10988) 12 months ago
hius07 e577c79d95
File search, FileChooser and others (#10994) 12 months ago
NiLuJe 16e96969c5
TimeSync: Double-check that ntpd is busybox (#10992)
Kindle ships another implementation, with incompatible syntax...

Regression since #10935
Thanks to @yparitcher ;).
12 months ago
NiLuJe d039aa5f3a Statistics: Minor style-nit followup to #10968
Too late to avoid the whitespace diff churn, unfortunately ;).
12 months ago
hius07 517731dbbb
Finished books: freeze history timestamp and statistics (#10968) 12 months ago
hius07 0ac258fcb7
Coverbrowser: event for cache refreshing (#10956) 12 months ago
Benoit Pierre 08555ad68b coverbrowser: make showing some metadata fields optional 12 months ago
Benoit Pierre e8bc28db33 coverbrowser: minor simplification
Add a `toggleSetting` helper.
12 months ago
Benoit Pierre 7d3456edc1
[plugin] CoverBrowser: improve title & authors layout (#10942)
- handle possible height overflow
- now that labels don't overflow, increase the minimum font size
12 months ago
NiLuJe 741302445b
TimeSync: Probe for root & ntpd/ntpdate dynamically (#10935)
And, on Kindle, make sure we update the native UI's time, too.

Fix #10932
1 year ago
NiLuJe 34ba2fab30
NetworkMgr: Handle non-blocking turnOnWifi implementations better (#10863)
* Device: Add a `hasSeamlessWifiToggle` devcap to complement `hasWifiToggle`, to denote platforms where we can toggle WiFi without losing focus, as this has obvious UX impacts, and less obvious technical impacts on some of the NetworkMgr innards...
* Android: Mark as `!hasSeamlessWifiToggle`, as it requires losing focus to the system settings. Moreover, `turnOnWifi` returns *immediately* and we *still* run in the background during that time, for extra spiciness...
* NetworkMgr: Ensure only *one* call to `turnOnWifi` will actually go on when stuff gets re-scheduled by the `beforeWifiAction` framework.
* NetworkMgr: Ensure the `beforeWifiAction` framework will not re-schedule the same thing *ad vitam aeternam* if a previous connection attempt is still ongoing. (i.e., previously, on Android, if you backed out of the system settings, you entered the Benny Hill dimension, as NetworkMgr would keep throwing you back into the system settings ;p). This has a few implications on callbacks requested by subsequent connection attempts, though. Generally, we'll try to honor *explicitly interactive* callbacks, but `beforeWifiAction` stuff will be dropped (only the original cb is preserved). That's what prevents the aforementioned infinite loop, as the `beforeWifiAction` framework was based on the assumption that `turnOnWifi` somewhat guaranteed `isConnected` to be true on return, something which is only actually true on `hasWifiManager` platforms.
* NetworkMgr: In `prompt` mode, the above implies that the prompt will not even be shown for concurrent attempts, as it's otherwise extremely confusing (KOSync on Android being a prime example, as it has a pair of Suspend/Resume handlers, so the initial attempt trips those two because of the focus switch >_<").
* NetworkMgr: Don't attempt to kill wifi when aborting a connection attempt on `!hasSeamlessWifiToggle` (because, again, it'll break UX, and also because it might run at very awkward times (e.g., I managed to go back to KOReader *between* a FM/Reader switch at one point, which promptly caused `UIManager` to exit because there was nothing to show ;p).
* NetworkMgr: Don't drop the connectivity callback when `beforeWifiAction` is set to prompt and the target happens to use a connectivity check in its `turnOnWifi` implementation (e.g., on Kindle).
* Android: Add an `"ignore"` `beforeWifiAction` mode, that'll do nothing but schedule the connectivity check with its callback (with the intent being the system will eventually enable wifi on its own Soon(TM)). If you're already online, the callback will run immediately, obviously. If you followed the early discussions on this PR, this closely matches what happens on `!hasWifiToggle` platforms (as flagging Android that way was one of the possible approaches here).
* NetworkMgr: Bail out early in `goOnlineToRun` if `beforeWifiAction` isn't `"turn_on"`. Prompt cannot work there, and while ignore technically could, it would serve very little purpose given its intended use case.
* KOSync: Neuter the Resume/Suspend handlers early on `CloseDocument`, as this is how focus switches are handled on Android, and if `beforeWifiAction` is `turn_on` and you were offline at the time, we'd trip them because of the swap to system settings to enable wifi.
* KOSync: Allow `auto_sync` to be enabled regardless of the `beforeWifiAction` mode on `!hasSeamlessWifiToggle` platforms. Prompt is still a terrible idea, but given that `goOnlineToRun` now aborts early if the mode is not supported, it's less of a problem.
1 year ago
hius07 684fc22ffc
TextViewer: font size (#10911) 1 year ago
poire-z f78a8c5315
Custom metadata: update Statistics db on metadata change (#10894) 1 year ago
hius07 108d87742a
Custom metadata: fixes (#10889) 1 year ago
hius07 6efcf96b75
copt deduplicate: font_size, visible_pages (#10882) 1 year ago
hius07 7d626456a3
copt deduplicate: render_dpi, margins, rotation_mode (#10880) 1 year ago
hius07 73378cd9d7
copt deduplicate: line_spacing (#10768) 1 year ago
hius07 e4ba8c7909
Custom metadata: event (#10869) 1 year ago
hius07 cbcf03b1af
Exporter: custom metadata (#10874) 1 year ago
hius07 912ae156f7
copt deduplicate: smooth_scaling, nightmode_images (#10801)
Main discussion in #10763.
1 year ago
NiLuJe 4cc620b702
VirtualKeyboard: Revamp visibility handling (#10852)
Move as much of the state tracking as possible inside VirtualKeyboard itself.
InputDialog unfortunately needs an internal tracking of this state because it needs to know about it *before* the VK is shown, so we have to keep a bit of duplication in there, although we do try much harder to keep everything in sync (at least at function call edges), and to keep the damage contained to, essentially, the toggle button's handler.

(Followup to #10803 & #10850)
1 year ago
zwim bedd422669
AutoSuspend: Handle a few corner-cases better (#10797)
* Enforce a minimal standby timer for the first standby after a resume.
* On Kobo, sleep a bit before standby.

This aims to alleviate race conditions causing visible refresh glitches on sunxi, especially when using an extremely low standby timer (i.e., below the defaults).
1 year ago
hius07 ed2ea6803f
Custom metadata (#10861) 1 year ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
1 year ago
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 ;).
1 year ago
NiLuJe 6fa8e1d2fd
KOSync: Set sane socket timeouts properly (#10835)
An attempt was made in the original code, but the whole thing was designed in the hope of actually switching to turbo, so it was super janky without it.
Anyway, we now actually have a sane way to set socket timeouts, so, use that, and set them very tight for now.

This is fairly critical right now, because the server is down, and the default timeouts are ~30s. That happens to be *above* the debounce threshold, so you can't even hope for that to help you. Meaning, right now, you get a 2 * 30s block on resume with auto sync. That's... Very Not Good(TM).

That becomes a single 2s one after this.
1 year ago
hius07 f4f5af5f2d
Exporter: fix order for Readwise (#10824)
Exported highlights are good sorted by position, page numbers could be wrong.
Closes #10817.

For reference: https://readwise.io/api_deets
1 year ago
hius07 0499b5109a
Profiles: fix New profile with current pdf document settings (#10778) 1 year ago
melyux 493a60faef
Exporter: Replace newlines with commas in HTML, Readwise (#10788)
Resolves #10755.
1 year ago
NiLuJe 38aa74ec7c
KOSync: Only nag about "Action when Wi-Fi is off" when toggling (#10785)
auto-sync *on*

Fix #10784
1 year ago
zwim 2ba3353d8a
[AutoWarmth] use CheckButton for night mode toggle (#10762) 1 year ago
weijiuqiao 416237e526
Statistics: Attempt to prevent rampant replication of null id_books (#10749)
And add an OTM block to do a cleanup pass on existing DBs (which might take a while if you're severely affected, because we've seen reports of DBs north of 2GB).
1 year ago
poire-z 626864f856 [chore] replace utf8 bytes with Unicode escape sequence 1 year ago
hius07 7164bc2bd9
Exporter: fixes (#10765) 1 year ago
hius07 b36ccc7249
QuickMenu: add long-press on profile (#10671) 1 year ago
clach04 500eadf895
[plugin] Wallabag: strip trailing slashes from server URL (#10715)
Fixes #9187.
1 year ago
hasezoey d087710140
Autowarmth: Change strings "set" / "unset" to "turn on" / "turn off" where appropriate (#10733) 1 year ago
hius07 3e43a21cf2
ArchiveViewer: view files (#10683) 1 year ago