Commit Graph

5774 Commits (master)

Author SHA1 Message Date
hius07 b949d07f4f
filemanagerbookinfo: proper text_type of description (#11260) 5 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
5 months ago
hius07 042a529fab
File manager: fix height of menu widget (#11251) 5 months ago
hius07 5a4e70a19d
History, Collection: title bar in FM style (#11243)
These changes make the title bar in File manager, History and Collection windows of the same height.
The items and book covers thumbnail dimensions in Mosaic and Detailed list display modes are now equal, and up/down scaling of the thumbnails is not needed when switching between File manager, History and Collection.
5 months ago
hius07 bf59f53e18
Folder shortcuts: speed up (#11221) 5 months ago
NiLuJe 675f5a062f Dispatcher: Allow custom intensity/warmth gesture to be setup in gesture
distance mode, like the default edge swipe, and not only with a fixed
increment.

Document the behavior in a slightly less confusing way.
5 months ago
zwim c30c1ff11f DeviceListener: Rejig calculateGestureDelta algorithm
Get rid of the silly precomputed tables, and do More Maths(TM) instead!
Thanks to @zwim for the magic sauce ;).

Minor simplification of the API while I'm in there, and unify the warmth
computations, do everything in the native scale (much like what
effectively happens for intensity) to workaround the silly public API
being an unhelpful PITA, ensuring consistent & effective changes.
5 months ago
NiLuJe a2e0642998 Cervantes: Make sure the warmth scaling is accurate
For some mysterious reason, we init fl_warmth_max to 100 on Kobo &
Cervantes, despite this being the case on absolutely none of them.

TL;DR: We update it according to nl_max during init, but this was
missing on Cervantes.
5 months ago
NiLuJe bc01394f8f SortWidget: Abbreviate the pagination text
Helps avoid truncation, given the way the widget is currently built.
Closes #11222
5 months ago
NiLuJe ff58ac7a65 DeviceListener: Handle non-gesture warmth increment in the native scale
Re: #11220
Followup to #6468
5 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 5 months ago
hius07 f4a5a2b60a
TextViewer: add dialog to set font size and justify text (#11210) 5 months ago
poire-z fe02b83b6a
ImageViewer: menu to invert rotations and set auto rotation (#11206)
Add some menu items under Screen>Rotation to allow inverting
the default rotation of ImageViewer, and to auto-rotate for
best fit on launch, so landscape images are auto-rotated to
the preferred rotation.
5 months ago
hius07 aabd6d7a26
File browser, Collection: improve group actions (#11178)
Maintain correct records in History and Favorites when moving/deleting folders or group of files.
Optimize Collection module to minimize storage requests.
5 months ago
Frans de Jonge 13a521c398
AppImage: remove hasMultiTouch = no (#11212)
SDL supports multitouch since https://github.com/koreader/koreader-base/pull/1599
5 months ago
NiLuJe 18fff200ac GestureDetector: Be even *more* defensive with initial_tev records
Apparently, #11198 wasn't defensive enough...

Make those visible warnings, so we can see how much they actually happen
in the wild...

Closes #11209
5 months ago
Wim de With e7780c09f3 fixup! Process directory list items for mixed collation 5 months ago
Wim de With 128accafe3 fixup! Process directory list items for mixed collation 5 months ago
Wim de With 01642659d2 Process directory list items for mixed collation 5 months ago
Wim de With 98d92d37ab Refactor FileManager collation for easier patching 5 months ago
NiLuJe 3c63a5d8a8
GestureDetector: Switch buddy contacts to voidState in a safer manner (#11198)
Some platforms with horribly broken MT handling (hai, PB) will manage to
screw something up so bad that we end up with slots never running
through initialState on a contact down, so they never get an initial_tev
recorded.

Ensure we do that if necessary when switching a buddy to voidState to
avoid crashes throughout the code, which assumes everything is sane and
doesn't guard accesses to initial_tev

Re: #11196, #10950 & #11111
Closes: #11111
5 months ago
hugleo f990937f9f
Autocrop fix (#11194)
After some tests with the said document from https://github.com/koreader/koreader/issues/970 it seems like that the visual defect occurs for only semi-auto and manual crop modes.

I've removed auto-crop from the rule so fixes https://github.com/koreader/koreader/issues/4106 when using auto-crop.
5 months ago
hius07 498193c26d
InputText: Delete all and fix Select (#11182) 6 months ago
poire-z b361cec4ff ReaderStyleTweak: minor CSS suggestions popup fixes 6 months ago
hius07 b4424b4685
filemanagerhistory: fix non standard status (#11188) 6 months ago
NiLuJe 4a64e02c68
ScreenSaverLock: Hide the popup on suspend (#11174)
Fix #11164 and involves a drive-by fix:

Kindle: Send Suspend/Resume event regardless of the screen saver state

If we get the events, it means stuff happened, we can't just only honor
it in the most common workflows ;).

This effectively reverts a tiny bit of #10426 (I was sort of expecting
this to be problematic at the time, and I most likely hadn't tested it).
6 months ago
mergen3107 33c7f05158
Kindle scribe gyro and pen support (#11159)
* Kindle Scribe: add G-sensor and pen support, fix startup orientation

* Fixes #11144 and #11156
6 months ago
hius07 d3787eee64
filemanagershortcuts: fix menu (#11167) 6 months ago
Monirzadeh 6527d7f1ab
Fix English-Persian dictionary link (#11165)
Spaces should be encoded.
6 months ago
hius07 f6fb35fd98
QuickMenu: keep open on apply (#11135) 6 months ago
NiLuJe 82e7ebd6df
ReaderView: Flash when paging *away* from images, too (#11152)
Reword the `Always flash around pages with images` Menu/Dispatcher entry
accordingly.

Fix #11143
6 months ago
NiLuJe 9af3e95d9d Kindle: Fix a smattering of frontlight bugs
* afterResume had *two* different implementations, so the historical one
  that handled frontlight fixups no longer ran
  (regression since #10426)
* isFrontlightOn was completely broken, for a couple of reasons:
  * There was no is isFrontlightOnHW implementation, so when it ran, it
    mostly always thought the frontlight was on, because
    self.fl_intensity doesn't change on toggle off.
  * _decideFrontlightState was never called on Kindle,
    so isFrontlightOnHW was never really called, making isFrontlightOn
    completely useless. Call it in setIntensityHW's coda, as it ought to
    be. And properly document that.

Generic *was* calling _decideFrontlightState is setIntensity, but
*before* actually setting the frontlight, which makes no goddamn sense,
so get rid of that, too.

* Also fix frontlight toggle notifications (regression since #10305)

TL;DR: The PowerD API being a mess strikes again.
6 months ago
Monirzadeh fbd012b928
Add English to Persian dictionary (#11160) 6 months ago
NiLuJe bf03f40ef2
Dispatcher: Allow toggling USBMS (#11123)
It's right next to actual exit/restart actions, so it'll never ask for confirmation.
6 months ago
NiLuJe bba48fc1bf
Widgets: Unschedule timeouts on early close (#11126)
Affects Notification, InfoMessage & QRMessage

Includes a drive-by fix for Trapper interactions that have been broken for... a long while ;).
6 months ago
NiLuJe bc7ea8602e
UIManager: Don't block gestures for new widgets when input is disabled (#11122)
They'll be disabled again when the widget in question is dismissed.

This exposes a couple of semi-obvious but edge-casey footguns to the user, but a hardened implementation is way uglier. See PR for details.
6 months ago
hius07 d99c70b5e1
ReaderHighlight: adjustable highlight dialog position (#11116) 6 months ago
hius07 88d6613fed
Folder shortcuts: new markers, buttons (#11108)
Buttons to add/remove folder shortcut from Plus menu and from folder popup dialog.
A marker ("empty star") for folders with shortcuts.
6 months ago
hius07 da8e23c011
InputDialog: tap outside to close dialog if keyboard is hidden (#11094) 6 months ago
hius07 082ef9b545
FileChooser: fix reverse sorting of folders (#11093)
Do not apply "reverse sorting" to folders in sorting modes "type", "size", "percentage".
In that modes folders are sorted by name.
6 months ago
poire-z 894cb3190d
Page browser: show nightmode thumbnails when in nightmode (#11091)
Just prevent page thumbnails ImageWidgets to be nightmode
inverted, unlike all other ones which are expected to be
double inverted to get their original colors shown.
The same thumbnail can be used and cached in both day and
night modes, unless "nightmode_images" is enabled and have
crengine itself invert images, making thumbnails different.
6 months ago
hius07 4044c81a5a
History: update on deleting a folder (#11090) 6 months ago
Wim de With 17a4aa962f
Fix connection bug with non-ASCII SSIDs in wpa_supplicant (#11089)
* Bump base

includes:

koreader/koreader-base#1691
koreader/koreader-base#1692
koreader/koreader-base#1689
koreader/koreader-base#1690
koreader/koreader-base#1693

* Integrate decoding of SSIDs within wpa_supplicant

The UTF-8 decoding of SSIDs is specific to wpa_supplicant. In this
patch, we move all of this decoding logic to the wpa_supplicant module.
We expose the raw bytes of the SSID to the NetworkMgr code, and make
sure to always fix bad UTF-8 before we display the SSID to the user.

Within the wpa_supplicant module, we replace the call to the
wpa_passphrase binary to get the PSK with a direct function call to
OpenSSL. This allows us to calculate the PSK over any arbitrary bytes,
including UTF-8. In the same vein, we use the hex-encoded SSID to
communicate with wpa_supplicant when setting up the network to support
arbitrary bytes in the SSID.

Unfortunately, we also remove the tests, as there is no way to unit test
local functions.
6 months ago
hius07 d0d3cf78f9
History: search (#11084) 6 months ago
hius07 51f3115b90
Profiles: fix updating gestures (#11072) 6 months ago
ElimGarak1 2e2ca76a03
Add new PocketBook InkPad Color 3 (743K3) (#11079)
To add the new PocketBook InkPad Color 3 (743K3) with E Ink Kaleido™ 3 screen.
6 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.
6 months ago
NiLuJe 94a82087de
Device: Don't leave hasSeamlessWifiToggle enabled when hasWifiToggle is disabled (#11060)
Fix #11059
7 months ago
NiLuJe fee2b79829
Kindle: The KT5 requires the same input delving shenanigans as the PW5 (#11064) 7 months ago
hius07 4391267dfa menu_keyboard_layout: add setting to disable swipes 7 months ago
hius07 414e74f626 virtualkeyboard: add setting to disable swipes 7 months ago
hius07 b70f866656
DocSettings (again) (#11020)
Cleaning and optimizing Docsettings code.
7 months ago
NiLuJe d805a69446 Open input device outside of the readdir loop to workaround a bug in the
input backend
7 months ago
NiLuJe 84e942a326 Kindle: Auto-detect the input device on the PW5
Apparently, the by-path symlink went poof
7 months ago
NiLuJe 6e08809419
Kindle: Amend #11049 comments (#11051)
Turns out it's not really specific to the Signature Edition
7 months ago
hius07 6b892a65a3
ReaderHighlight: delete highlight in view note dialog (#11039) 7 months ago
NiLuJe 12bea3b14b
Kindle: Handle the PW5 SE properly (#11049)
Need to poke elsewhere for its Input device

Fix #11048
7 months ago
NiLuJe 2c5d618f6b
Kindle: Initial Scribe support (#11047)
Assuming Bellatrix3 boards are extremely similar to their Bellatrix brethren...

Fix #11045
7 months ago
hius07 39d54956ec
webdav: do not allow trailing slash in start folder (#11026) 7 months ago
Frans de Jonge 9274a3febd
[lang] Minor string fixes (calibre should be lowercase, remove stray newline) (#11030)
Follow-up to #10945.
7 months ago
hius07 3b2fc7a551
Reader: re-enable File search, Folder shortcuts (#11028) 7 months ago
hius07 c92d94af4d
writeToFile: centralize (#11012) 7 months ago
NiLuJe fed24ba28c UIManager: Always send PowerOff & Reboot events
They were only sent when said action was triggered manually.

Note that this is perfectly harmless, since, currently,
nothing actually responds to those events ;).
7 months ago
NiLuJe c47ce45fb8 WakeupMgr: Forward rtc_dev & dodgy_rtc to the backend 7 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.
7 months ago
hius07 6ccf19b99f
History: update on renaming/moving a folder (#10999) 7 months ago
hasezoey ee7a6455ce
Device:Android: always call "_decideFrontlightState" in "setIntensityHW" (#10737)
re https://github.com/koreader/koreader/pull/10731#discussion_r1271505121

This PR changes so that androids implementation of `setIntensityHW` always calls `_decideFrontlightState`
7 months ago
ElimGarak1 5b916cccff
Add new PocketBook PB-Basic Lux 4 (PB618) (#10987) 7 months ago
François Gannaz 11083022b0
Minor code quality improvements (#10905) 7 months ago
yparitcher 0e26d4499b
util.htmlEntitiesToUtf8: add some more semi common entities (#10979) 7 months ago
Benoit Pierre d4421130f8
otamanager: fix OTA model name for Android x86_64 (#10997) 7 months ago
hius07 e577c79d95
File search, FileChooser and others (#10994) 7 months ago
Ryan W West 27104ea011
Add hash-based document metadata storage option (#10945)
This option saves metadata sidecar (sdr) directories not next to the book or in koreader/docsettings/, but in koreader/hashdocsettings/ using the partial md5 hash of each documents, allowing users to move, rename, and copy their documents outside of KOReader without accidentally losing their highlights/notes/progress. Included are various warnings and info to users of the benefits and drawbacks of this non-default option.

Closes #10892.
7 months ago
hius07 517731dbbb
Finished books: freeze history timestamp and statistics (#10968) 7 months ago
poire-z ea3f8951a3 Add ReaderHandmade: support for custom TOC and hidden flows
Checkboxes under TOC>Settings> allow enabling Custom TOC
and Custom hidden flows (similar to "Hide non-linear fragments"
available with some EPUBs).
Handled by a new ReaderHandmade module.
Adding and removing TOC chapters is done in PageBrowser
with long-press on a page thumbnail, and for chapters also
in the popup dialog after selecting some text in a page.

ReaderToc: add a symbol in title when the TOC is the
alternative TOC or the custom TOC.
7 months ago
poire-z c51b0c7bb9 BookMap: add option Alternative theme
When enabled in BookMap, both BookMap and PageBrowser get:
- alternating gray background on chapter spans
- hatched background instead of uni-gray on hidden flows.
Also, with both normal look and this alternative theme,
show some hatched overlay on thumbnails part of hidden flows.

ReaderToc: for each TOC item, have it carry its sequence/number
in that level (we do this in validateAndFixToc() where we are
already iterating all the items).
7 months ago
poire-z 5406fdf2e0 BookMap/PageBrowser: update upper instance when leaving lower one
BookMap and PageBrowser instances can be stacked; when
toggling a bookmark in a lower PageBrowser and closing it,
make sure the bookmark is shown in the BookMap we get back to.
Also consider TOC and hidden flows as a thing that can be
edited and needs refreshing, so we're ready for next commits
about custom TOC and custom hidden flows.
Also update Reader footer when closing the last BookMap
or PageBrowser.
7 months ago
poire-z 2b75ef108e PageBrowser: allow tap/hold on thumbnail before it is loaded
There was no real reason for having to wait.
Also avoid possible crash when a background generated
thumbnail would be displayed after other things happened.
7 months ago
poire-z 1c128f1089 PageBrowser: taller vertical marks for thumbnail rows in viewfinder
Instead of small markers below the baseline, use
translucent vertical lines over most of the ribbon's
height to mark thumbnail rows, so we can more easily
relate chapter spans to thumbnail rows.
7 months ago
poire-z fb6bc0391f PageBrowser: add option to preload next/prev page thumbnails 7 months ago
poire-z bbf923c7a8 BookMap/PageBrowser: allow mousewheel scrolling
Also fix SDL to use sendEvent() instead of broadcastEvent(),
so such BookMap scrolling doesn't also scroll pages in the
book below.
7 months ago
poire-z 35f16f87a4 ReaderThumbnail: fix slow thumbnails when in scroll mode
If originally with two-columns in page mode, and switching
to scroll mode, thumbnails generation would be slow as
the document would be rerendered for each thumbnail.
7 months ago
poire-z 5ec736ae96 ReaderToc: rework getChapterPageCount/Left/Done()
Rework the way they are computed, fixing issues with hidden
flows when they don't coincide with chapter starts.
7 months ago
poire-z e6ac74c1df ReaderPaging: use document:getNext/PrevPage()
instead of doing arithmetic (ie. new_page=cur_page+1).
This makes it ready to work with custom hidden flows
where these document:getNextPage()/getPrevPage() will
be overloaded to skip pages in hidden flows.

Also fix some odd issues (page truncated or with parts
duplicated) with scrolling/page turning when at start
or end of the document.
7 months ago
poire-z 52c45ef6db InputDialog: add param to setInputText() to set cursor pos
When not provided, the cursor stays at its initial position,
which might not be the best if replacing the whole content,
where we would prefer to have it at start or end.
7 months ago
poire-z da424486ef FrameContainer: allow for hatched background or overlay
Bump base for BlitBuffer:hatchRect().
base bump also includes:
- Update to HarfBuzz 8.2.1
- tests and ci updates
7 months ago
NiLuJe 2ff60ce04f
Kobo: Deal with some more frontlight edge cases on devices with the AW99703 PWM controller (#10971)
Namely, skip ramping when going to/from <= 2% frontlight, otherwise we just eat the delay for no good reason (1%), or it just stutters and looks bad (2%).

Fix #10970
7 months ago
François Gannaz 128302873d
New menu option and filemanager filter to hide finished books #7158 (#10895)
* New menu option and filemanager filter to hide finished books #7158

The default behavior is to display the finished books (no change on
upgrade). For consistency with the two similar options, it represented
by a checkbox "Show hidden books" that is checked by default.

The implementation is straightforward, meaning that, when the option is
unchecked, each file will require a call to `filemanagerutil.getStatus`
that checks its status.

For clarity, the code uses the "finished books" expression because the
condition is relevant to the *book* metadata, while the other settings
are about *file* attributes.
8 months ago
Benoit Pierre 5b5b4d9ebc
readerhighlight: fix OCRed text dictionary lookups (#10967)
Cf. #10966.
8 months ago
hius07 0ac258fcb7
Coverbrowser: event for cache refreshing (#10956) 8 months ago
hius07 0c5240074c
screen_rotation_menu_table: deduplicate (#10954) 8 months ago
hius07 40e2a838ae
Status: setting status of current book in History and Collections (#10946) 8 months ago
hrdl 4875f63f09
sdl: ensure dialogs are displayed after window change events (#10929)
Fix #10927

Co-authored-by: NiLuJe <ninuje@gmail.com>
8 months ago
ElimGarak1 ed885a79b2
[PocketBook] Add PB-Verse_(PB629) and PB-Verse Pro_(PB634) (#10938)
Closes #10913.
8 months ago
NiLuJe e5535a3a3a
ReaderRolling: Guard against races between scheduled tasks and CloseDocument (#10934)
Fix #10932

---------

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
8 months ago
hius07 cafe565ade
screensaver_menu: radio buttons (#10931) 8 months ago
hius07 9f39614e8a
Custom metadata: fixes 2 (#10919) 8 months ago
NiLuJe 55ea10655f
Revert "Kobo: Disable HW inversion on MTK (#10841)" (#10928)
This reverts commit e7e0d2edb6.

Whatever's actually going on with nightmode, this isn't it.
This was independently confirmed to behave as expected,
and the issue that prompted this was *not* fixed by this commit.
8 months ago
hius07 ed5c1cef20
ButtonTable: remove unused (#10926) 8 months 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.
8 months ago
hius07 684fc22ffc
TextViewer: font size (#10911) 8 months ago
NiLuJe 2b13cd7dcb
Device: Make sure `input_no_key_repeat` survives a suspend/resume cycle (#10904)
I somehow assumed the repeat state snapshot used for restore was taken *after* disabling repeat, but obviously not ;o).

Fix #10902
8 months ago
Wim de With 1773b62ce8
Check for Noto Emoji font in UI fallback fonts (#10908) 8 months ago
hius07 be125af949
Actions for Go to first/last bookmark (#10899) 8 months ago
hius07 3f677a7fdd
copt/kopt options: deduplicate some defaults (#10893) 8 months ago
hius07 108d87742a
Custom metadata: fixes (#10889) 8 months ago
hius07 cc82ead981
copt deduplicate: font settings (#10885) 8 months ago
hius07 6efcf96b75
copt deduplicate: font_size, visible_pages (#10882) 8 months ago
hius07 7d626456a3
copt deduplicate: render_dpi, margins, rotation_mode (#10880) 8 months ago
hius07 73378cd9d7
copt deduplicate: line_spacing (#10768) 8 months ago
hius07 5e74f29fba
copt deduplicate: embedded_css, embedded_fonts (#10876) 8 months ago
hius07 e4ba8c7909
Custom metadata: event (#10869) 8 months ago
NiLuJe ba5c7df0db DocSettings: Minor cleanup following #10861
Allows me to fix an old pet-peeve of mine re: the terrible variable
names used in there ;o).
8 months ago
hius07 f46f341b9b
Reset settings/cover/metadata separately (#10866) 9 months ago
hius07 912ae156f7
copt deduplicate: smooth_scaling, nightmode_images (#10801)
Main discussion in #10763.
9 months ago
hius07 a767ad44db
PDF contrast: incorrect set by a gesture (#10798) 9 months 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)
9 months ago
NiLuJe 4d620d9fd2
Device: Try harder to properly setup the charging LED on plug/unplug (#10855)
By debouncing the call and delaying it some more.
9 months 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).
9 months ago
hius07 ed2ea6803f
Custom metadata (#10861) 9 months ago
Wim de With 599a3034ca
NetworkManager: Decode SSID to UTF-8 (#10864)
wpa_supplicant returns all non-ASCII SSIDs as raw bytes in the form
\x0a. We interpret these bytes as UTF-8, and make sure that all invalid
characters are replaced with a �.
9 months ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
9 months ago
poire-z 9d5d5d4a30
InputText/InputDialog: fix keyboard issue (#10850)
Fix issue introduced by 976aaf5f: with full screen
text editor and hiding the keyboard, a tap in the
text area would show a new keyboard hiding the
buttons allowing to save/close the text editor,
getting us stuck there.
9 months 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 ;).
9 months ago
Frans de Jonge ea433d78dd
[i18n] Revert Unicode escape sequence to utf-8 bytes for translation (#10845)
Cf. <https://github.com/koreader/koreader/discussions/10774#discussioncomment-6618167>, reverts #10769 for direct use in translations.
9 months ago
NiLuJe e7e0d2edb6
Kobo: Disable HW inversion on MTK (#10841)
Apparently, that doesn't quite work...

Followup to #10719
9 months 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.
9 months ago
NiLuJe 21de1a832e Main: Move the G_reader_settings flush to Device:exit
I don't trust PB's input.closeAll not to be doing something wonky that
would trip an early abort.
9 months ago
NiLuJe d1bbdb5dad PocketBook: Run Generic:exit *last*
Makes more sense this way.

Re: #10828

Also clarify the UIManager "no dialogs left" message, and drop the
return value, as it's meaningless, we just want to break & return.
9 months ago
hius07 33467098dd
filemanager: minor tweaks (#10821) 9 months ago
NiLuJe 910b67d35b NetworkListener: Only disable Wi-Fi on suspend on hasWifiManager platforms
Assume the host system does things right otherwise.
Should be sane on Kindle
On PocketBook, who knows, but assuming the device actually suspends,
that should effectively kill our keepalive
Irrelevant for Android, as we skipped it because the wifi toggling
methods are interactive.
9 months ago
NiLuJe d52e0a0dfe NetworkManager: Always flip wifi_was_on when interactively tearing down Wi-Fi
Fix #10823

(For reference, we *enable* wifi_was_on no matter *how* wifi is enabled,
but we only toggle it off when it's killed by a *direct* user interaction,
the intent being that if *something* non-interactive enabled wifi,
you'll probably silently need it on resume too).
9 months ago
NiLuJe 7e628958b6 Misc: review pass for #10803 9 months ago
NiLuJe 6d47b3241c NetworkManager: Fully tear down WiFi on aborted connection attempts
The proper connectivity check did it, now every early or not so early
abort do.
9 months ago
NiLuJe 5146358605 NetworkManager: Allow backends to report connection failures early
As early as turnOnWifi.
Implement it on hasWifiManager platforms, preventing useless
connectivity checks to run when they're obviously never going to work
because you're out of range of your AP.

Also implemented a flag to notify the backend if the connection attempt
was interactive or not.
Right now, interactive is extremely restricted, it basically means the
menu checkmark, or a gesture.
The intent being that for stuff like the beforeWifiAction framework, we
don't want the backend to spawn extra UI.
Specifically, for hasWifiManager platforms, we no longer spawn the AP
scan list on failure unless the caller was interactive.

TL;DR: beforeWifiAction is now much less obnoxious when you're obviously
not able to connect.
9 months ago
NiLuJe bc235b3d19 NetworkManager: Make goOnlineToRun abort on tap (anywhere)
Assuming it's past the blocking portion of this endeavor, if any.

Fix #10807
9 months ago
NiLuJe a15fc0e9a5 Revert "Test: Fiw readerhighlight test"
This reverts commit c23c422f62.
9 months ago
NiLuJe ae7e2f14aa Test: Fiw readerhighlight test
With actual ReaderUI teardowns, and fix the overlapping highlight
handling, so we can drop the nocov flags
9 months ago
NiLuJe 55534fcec2 ReaderView: Keep the terrible readerhilight_spec test happy
This thing is a horrible mess.
9 months ago
NiLuJe 0686ee594c ReaderView: Make sure we unschedule the hinting task on actual teardown.
onCloseDocument is way too early, if another, later onCloseDocument
handler trips a ReaderUI repaint, a new task will be scheduled, and that
one will never be cancelled, resulting in it running post-teardown,
crashing horribly.

This was for instance very easy to trigger via KOSync.

Fix #10806
9 months ago
NiLuJe 976aaf5f53 InputText: Actually flip the is_keyboard_hidden flag properly
MultiInputDialog does a close -> show in the same callback,
so if we don't actually keep it in sync with the actual state, we lose
the keyboard and essentially softlock the UI, which is Very Bad(TM).

NOTE: InputDialog has its own keyboard_hidden flag, and it looks...
fairly nightmarish.
9 months ago
NiLuJe 7a5216a0a6 NetworkManager: Plug a logic hole in the beforeWifiAction logic
The *runWhenOnline wrappers may not pass a callback when connected but
not online yet, so we need nil guards all the way down ;).

Re: #10806
9 months ago
NiLuJe 22678ee5ff Misc: Review pass on the previous commits
* Unbreak the Device test
* Rename a few things
* Tweak a few comments
9 months ago
NiLuJe f44f92a864 Kobo: Run Generic:init dead last, like every other platform
This is semantically more correct, and should prevent platform-specific
weirdness if an ordering concern ever comes up (e.g., like it did for
the viewport stuff).
9 months ago
NiLuJe 71378b0b50 Startup: Move Device ctor/dtor shenanigans to the actual Device
constructors and destructors

No need to leak implementation details in there.
9 months ago
NiLuJe e9a84ca434 Reader: Move the "print exit code in a file" hack to the PB
implementation, where this mess belongs.

No other platform relies on this (because, spoiler alert, InkView \o/).
9 months ago
NiLuJe 4acf131071 ReaderActivityIndicator: Oh god, my eyes, they buuuuurn.
Make this a real boy, with a transient lipc handle.
And get rid of the insane 1s sleep on affected ReaderView paints,
because ouchy.

This is completely deprecated anyway, so this is entirely pointless,
and mainly to prevent implementation details from creeping into
reader.lua.
9 months ago
NiLuJe ac1358e0f0 Menu: Actually hide PlatformNav if !hasKeys
Returning {} just leads to a present but blank entry

(Also, nobody notice that the capcheck was wrong inside platnav anyway ;p).
9 months ago
NiLuJe f4aca567ef Kobo: Allow disabling key repeats
Re #10743

Note that this only makes faulty switches slightly less annoying: for a
stuck switch, instead of a string of page turns, you'll get a single
missed page turn on the tap that actually releases the stuck contact...
9 months ago
NiLuJe ddf6f3616c Menu: Amend the previous commit
Kindle animations are Reader only ;).
9 months ago
NiLuJe 6283674c47 Menu: Split off "Page Turns" submenu in two sections
The Kindle swipe animations & physical key inversion apply *everywhere*,
so we need this accessible in the FM, too.

Move it to Navigation, which is where it already was on !Touch devices.
9 months ago
NiLuJe 0db7509fe2
Kobo: Fix the input translation on the Elipsa 2E (#10802)
Apparently it mirrors on the Y axis. Or the panel vs. touch rotations are wonkier than expected or ...something.
9 months ago
hius07 0499b5109a
Profiles: fix New profile with current pdf document settings (#10778) 9 months ago
hius07 1544ca28af
FileManager: truncate left in selected files list (#10783)
Truncate the path to view the filename in full. Closes #10760.
9 months ago
poire-z cc391514b5 Translator: explicite wording above each section 9 months ago
poire-z e641c89eee View HTML & CSS: fix minor spacing issues 9 months ago
zwim ac143ca9d6
Add forgotten f:close() (#10796) 9 months ago
yparitcher f3fc2ac353 do not allow clipboard to be nil
we use it as text anyway and test if it is the empty string also.

this fixes a crash in viewhtml when holding a selector with an empty clipboard, we try to contcate getClipboardText which is nil (on !SDL & !Android)
9 months ago
zwim 2ba3353d8a
[AutoWarmth] use CheckButton for night mode toggle (#10762) 10 months ago
NiLuJe 724db0b924
Statistics: Close the DB handle in the vacuum OTM block (#10775)
Followup to #10749
10 months 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).
10 months ago
poire-z 626864f856 [chore] replace utf8 bytes with Unicode escape sequence 10 months ago
poire-z 7bff61150a util.prettifyCSS(): do better with more complex CSS 10 months ago
poire-z b03992c077 ViewHTML: fix content messed up when consecutive nbsp
Fix bug in replace_in_html() when consecutive
matches.
Also ensure content after leading indentation is not
wrapped on the next line.
10 months ago
poire-z 08e9c27a32 Wikipedia EPUBs: re-add ToC in content
The ToC is no longer in the HTML we get from the
Wikipedia API. So, add it ourselves.
Also, as we can't get anywhere the Wikipedia localized
string for "Contents" (ie. "Sommaire" in French), use
thick <HR> to mark the start and end of this ToC.
10 months ago
ichnilatis-gr 583ae40e46
Greek keyboard: update to the new keyboard layout (#10734) 10 months ago
NiLuJe 9c8e55b3e5
Kobo: Yet another attempt at working around the hangs on the latest NXP boards (#10771)
* Notification: Drop the fencing from #10083; it never actually helped, and had subtle side-effects we could do without.
* VirtualKeyBoard: Flash on close, otherwise, some of the fast refresh glitches may be burned into the working buffer until a flash. Making sure we flash ourselves prevent it from sticking around on the page ;).
* util: Move `writeToSysfs` to base (i.e., `ffi/util`), as we need it there (and it actually makes more sense there anyway ;p).
* Bump base for https://github.com/koreader/koreader-base/pull/1645, which is where the actual workaround (hopefully) lives.

Re #8414, #9806, #10558
10 months ago
NiLuJe 689d9e2976
Kobo: Initial Elipsa 2E support (#10719)
Untested, but mostly everything should be there ;p.

Bumps base for MTK support (https://github.com/koreader/koreader-base/pull/1642)
10 months ago
NiLuJe ef0bcbad3f
ReaderFooter: Don't reset the initial position marker like a cowboy (#10767)
Take a more tactful approach instead, should hopefully prevent issues like in https://github.com/koreader/koreader/pull/10114#issuecomment-1658913661
10 months ago
NiLuJe 9ceb07a4c6
Kobo: Unbreak Aura One support (#10758)
Regression since #10728, Fix #10757
10 months ago
hius07 b36ccc7249
QuickMenu: add long-press on profile (#10671) 10 months ago
poire-z 4fa278ff0b Wikipedia: handle images in changed Wikipedia HTML
The HTML we get from Wikipedia has recently changed,
which has caused images to not be detected and shown
in DictQuickLookup, and to be missing or ugly in
saved EPUBs. Update our code and CSS to display them
again.
10 months ago
poire-z eecdac930e View HTML: Show matched rules: ignore style & tweaks on long-press
On long-press on the "Show matched stylesheets rules"
buttons, ignore those from our epub.css/html5.css and
from styletweaks, which may make investigating a book
style simpler without their noise.
10 months ago
hius07 47dae6c5dd
Dictionary: fix Fuzzy search setting appearance (#10721) 10 months ago
hius07 a311de6d8e
readerview: do not read/save inapplicable doc_settings items (#10710) 10 months ago
NiLuJe 21949c5521 Kobo: Apply the AW99703 smooth ramp off fix to all affected devices
e.g., at least the Clara 2E features the same controller & driver,
but it is likely found on a few other models.
10 months ago
NiLuJe f5e871d4ed NetworkInfo: Never show the token index
Now that I've seen it in action on a device, it's mostly useless, and,
if anything, confusing, because it's not static.
10 months ago
hasezoey 618f065de4
DeviceListener:onToggleFrontlight: add notification of "unchanged" (#10727) 10 months ago
hasezoey b1109a729e
Android: call "_decideFrontlightState" to keep "is_fl_on" in sync (#10731) 10 months ago
hasezoey 14347f0c18
Android - lights: return to previous level on cancel (#10726) 10 months ago
NiLuJe 17bdd56e02 Never export LD_LIBRARY_PATH
It's been made redundant by the RPATH changes

The only platform that gets the dubious honor of actually needing an
LD_LIBRARY_PATH is PocketBook, because of InkView.

Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>

Bump base to pull in the aforementioned RPATH changes ;).

https://github.com/koreader/koreader-base/pull/1638
10 months ago
poire-z 8a240dd635
bump LunaSVG, crengine: add support for .docm (#10702)
Includes:
- bump LunaSVG: intermediate upstream bump, cleanup
- bump LunaSVG: minor upstream tweaks
crengine:
- DocX: add support for similar DocM format
- LVStyleSheet: fix LVCssDeclaration::getHash()
- CSS parsing: accept Unicode values for ID and classnames
- update for Harfbuzz 8, fix some compiler warning
Also fix input not restored when loading failed,
and KOReader not able to exit.
10 months ago
NiLuJe dacc3c2f72
NetworkManager: Bypass isOnline on !hasWifiToggle platforms (#10697)
Followup to #10669, fix #10694
10 months ago
Frans de Jonge 3bec20fc25
NetworkManager: improve clarity for chatty framework user-facing explanation (#10696)
See https://github.com/koreader/koreader/pull/10669/files#r1263385527
10 months ago
Glen Sawyer 73c4f09a88
FileChooser: re-add file sort by "last date read" (#10682)
Revert bits from eb299c30.
10 months ago
poire-z d0e705a582
Font list menu: allow sorting by more recently set (#10662)
- Add a toggle in Font settings> allowing showing font
  ordered by most recently selected (long-press on
  it allows clearing this history).
- Keep in G_reader_settings a list of known fonts, so
  we can notice newly added user fonts, and put them
  at the start of the most recently selected. Show
  these new fonts with a symbol in the menu.
- TouchMenu: allows for a flag to trigger menu
  refresh when going up.
10 months ago
Christian Kilb 6d7dccda13
[PocketBook]Add support for InkPad Color 2 (#10685)
Co-authored-by: Christian Kilb <christian.kilb@gmail.com>
10 months ago
hius07 e1ed3a71c5
Style tweaks: notification on toggling style tweak with a gesture (#10674) 10 months ago
NiLuJe d57325aaf6
NetworkManager: Enable "before wifi" action support on every hasWifiToggle platform (#10669)
* Enable before_wifi_action & after_wifi_action on hasWifiToggle platforms (which is basically all of 'em except naked SDL).
* Decouple restoreWifiAsync from hasWifiManger, because we can do that on other platforms (namely, Kindle. Probably PB, too, but WiFi is already a mess there, and I can't test it).
* Implement restoreWifiAsync on Kindle.
* Properly flag rM as hasWifiManager & hasFastWifiStatusQuery, because it is actually both of those (it uses our wpa_supplicant backend).
* Update the KOSync checks to take these changes into account, to properly disable auto_sync if necessary.
* Really made the Network* event signaling consistent. For realz this time.
* In an effort to make the whole beforeWifiAction framework somewhat usable there, we now assume connectivity is always available on !hasWifiToggle platforms...
10 months ago
hius07 b1c90260e4
DropBox: unify error messages (#10666) 10 months ago
hius07 b33971b92d
OPDS fixes (#10657) 10 months ago
NiLuJe 4194244951
GestureDetector: Make two_finger pans & swipes report the same sort of data than their standard brethren (#10649)
Namely, that swipes report the gesture's *starting* coordinates as `pos` (for hit-detection purposes), while pans (and basically everything else) use the *lift* coordinates (as well as provide a relative vector).

In each case, we now also provide a separate `start_pos`/`end_pos`, in case handlers need finer-grained data (e.g., anchoring UI elements to a swipe's lift coordinates).
10 months ago
hius07 86f4b3c18d
QuickMenu: anchor to gesture position 3 (#10646) 10 months ago
ElimGarak1 4b475bee04
Recognize PocketBook InkPad 4 with new firmware (PB743G)/(PB743g) (#10655)
Extended addition of PocketBook InkPad 4 with firmware later U743g.6.8.885 (PB743G) because its device ID was corrected from PB743g to PB743G by firmware U743g.6.8.1719.
10 months ago
Martín Fernández 5336e2f11d
[ota]: deprecation check & notice (#10639) 11 months ago
Benoit Pierre 346d8eb83e
Decrease fonts memory use (#10618)
Instead of opening the same font multiple times for each different
size (multiple face instances), share one face instance and create
multiple size instances.
11 months ago
Alistair Francis fc89b1affa
Remarkable: support the mainline touchscreen (#10585) 11 months ago
poire-z a4720b44cd Text search: various Kopt search fixes
- Properly parse input text for words (the previous
  code wasn't working with Greek letters)
- With multiple words search, don't allow "substring
  matching" for words in the middle
- Remove support for Lua pattens, so to get proper
  substring matching (as we have with cre text search)
11 months ago
poire-z dffc2404ca Text search: normalize input text
So that Unicode NFC normalization can combine diacritics
entered via our keyboard with their base into their
canonical form (we can expect books text to be normalized).
11 months ago
hius07 6decb71521
ReaderPaging: do not store zeroes in page_positions (#10602)
Page_position value depends on the view mode parameters, but we can assume that zero is a frequent case.
11 months ago