Commit Graph

3314 Commits (master)

Author SHA1 Message Date
hius07 0ceb88a9a3
Fulltext search: all entries in entire document (#11313) 4 months ago
NiLuJe 0f194d88b9 OTAManager: Slightly less cryptic error on connectivity issues
(On either end).

Re: #11258
4 months ago
NiLuJe 871ebb0573 Screensaver: nil guard lastfile in cover mode
`hasSidecarFile` assumes you're feeding it a string.
Plus, that check was super funky anyway.

Fix #11336
4 months ago
sonix-github 87915de32b
Fix missing diacritics on first row of Slovak keyboard layout (#11343) 4 months ago
NiLuJe c97d20cd24
Chore: Make sure we always pass a rect to `fb:refreshFull` (#11307)
* UIManager: Init a full Geom on region-less refreshes in _refresh
* Never call refreshFull with no arguments
  I got rid of the low-level nil guards, because UIManager itself guarantees that it can never happen
* Bump base (https://github.com/koreader/koreader-base/pull/1718) (fix #11303)
* Kindle: Re-enable HW dithering on the Scribe
  Now that the underlying issue is fixed in base ;).
4 months ago
zwim 2c33fc6576
Reader: Do less work on same-orientation non-gyro rotations (#11297)
Namely, don't recompute layouts, as they do not change.
(The gyro codepaths were already doing something similar.)

* Keep ConfigDialog, FileManagerMenu & ReaderMenu open on rotation.
  (In practice, only ConfigDialog is affected, as *Menu doesn't handle the rotation event.)
* Plugged an instance leak in the aforementioned Menu classes.
* Unify behavior & code with the gyro codepaths.
4 months ago
hius07 ea9ef6781c
CoverBrowser: adjustable mosaic grid (#11232) 4 months ago
hius07 4ddc0f2ef8
FileChooser: fixes (#11300) 4 months ago
NiLuJe 9826615f06
i18n: Don't use Lua unicode escapes (#11330)
Something in the gettext/weblate pipeline doesn't like it...

These are real unicode codepoints, not custom nerdfont ones, so just
render the actual glyph instead of escaping it.

Fix #11328

Cf. #10845.
4 months ago
NiLuJe cc52c022dc Notification: Take three, take the guesswork away by making every
specific mask visible
4 months ago
NiLuJe 3131475e39 Notification: refactor settings
Simplify the code, because the bit trickery was fairly nasty to follow.
KISS: flip one value at a time, either in or out.

Actually allow flipping *all* of the things via the UI, to help track
what the hell is actually happening when you touch a button.

Make some of 'em radio to make it clear when flipping one might affect
the other(s).

Brought on by https://www.mobileread.com/forums/showthread.php?t=358166
4 months ago
hius07 7a421ea3ab
Fix "Open next file" (#11272) 4 months ago
hius07 042a529fab
File manager: fix height of menu widget (#11251) 4 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.
4 months ago
hius07 bf59f53e18
Folder shortcuts: speed up (#11221) 4 months ago
NiLuJe bc01394f8f SortWidget: Abbreviate the pagination text
Helps avoid truncation, given the way the widget is currently built.
Closes #11222
4 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 4 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
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
hius07 498193c26d
InputText: Delete all and fix Select (#11182) 5 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).
5 months ago
Monirzadeh 6527d7f1ab
Fix English-Persian dictionary link (#11165)
Spaces should be encoded.
5 months ago
Monirzadeh fbd012b928
Add English to Persian dictionary (#11160) 5 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.
5 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 ;).
5 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.
5 months ago
hius07 d99c70b5e1
ReaderHighlight: adjustable highlight dialog position (#11116) 5 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.
5 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
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 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
hius07 4391267dfa menu_keyboard_layout: add setting to disable swipes 6 months ago
hius07 414e74f626 virtualkeyboard: add setting to disable swipes 6 months ago
hius07 b70f866656
DocSettings (again) (#11020)
Cleaning and optimizing Docsettings code.
6 months ago
Frans de Jonge 9274a3febd
[lang] Minor string fixes (calibre should be lowercase, remove stray newline) (#11030)
Follow-up to #10945.
6 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
François Gannaz 11083022b0
Minor code quality improvements (#10905) 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
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 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
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.
7 months ago
hius07 0c5240074c
screen_rotation_menu_table: deduplicate (#10954) 7 months ago
hius07 cafe565ade
screensaver_menu: radio buttons (#10931) 7 months ago
hius07 ed5c1cef20
ButtonTable: remove unused (#10926) 7 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.
7 months ago
hius07 684fc22ffc
TextViewer: font size (#10911) 7 months ago
Wim de With 1773b62ce8
Check for Noto Emoji font in UI fallback fonts (#10908) 7 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 cc82ead981
copt deduplicate: font settings (#10885) 8 months ago
hius07 7d626456a3
copt deduplicate: render_dpi, margins, rotation_mode (#10880) 8 months ago
hius07 f46f341b9b
Reset settings/cover/metadata separately (#10866) 8 months ago
hius07 a767ad44db
PDF contrast: incorrect set by a gesture (#10798) 8 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)
8 months ago
hius07 ed2ea6803f
Custom metadata (#10861) 8 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 �.
8 months ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
8 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.
8 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.
8 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.
8 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).
8 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 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 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
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
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) 9 months ago
NiLuJe 724db0b924
Statistics: Close the DB handle in the vacuum OTM block (#10775)
Followup to #10749
9 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).
9 months ago
poire-z 626864f856 [chore] replace utf8 bytes with Unicode escape sequence 9 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.
9 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.
9 months ago
ichnilatis-gr 583ae40e46
Greek keyboard: update to the new keyboard layout (#10734) 9 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
9 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.
9 months ago