Commit Graph

3314 Commits (master)

Author SHA1 Message Date
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
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.
9 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
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 b33971b92d
OPDS fixes (#10657) 10 months ago
hius07 86f4b3c18d
QuickMenu: anchor to gesture position 3 (#10646) 10 months ago
Martín Fernández 5336e2f11d
[ota]: deprecation check & notice (#10639) 10 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.
10 months ago
hius07 dee1c902ec
ReaderUI: minor optimization (#10634) 10 months ago
hius07 eb299c300d
FileChooser: Sort by date (#10627) 10 months ago
NiLuJe 08dd97384c
KOSync: Clarify settings, plus refactor & fixes to make "auto-sync" more reliable (#10605)
Fix: #10539, and for context #6489, #6733, #6534

Reorganize and reword most of the settings to make it clear what actually ties into auto sync, and what doesn't. (Specifically, what happens when a pull attempts to sync forward or backward has nothing to do with auto sync, it applies in all cases; while the periodic sync *does* require auto sync).

The main point of contention, though, is that auto sync will now *always* attempt to setup network connectivity (i.e., on resume/suspend/close). Periodic sync will *not* though (the intent being that, if you use periodic sync, you're relying on the activity check to actually keep wifi on at all times)).

Since this may lead to a large amount of nagging about wifi toggles on devices w/ NetworkManager support, it is now *disabled* by default on those devices. (And given that it wouldn't have worked because of the lack of connectivity, that doesn't really make any practical difference ;p).

Additionally, given the fact that there's no way to make this behavior viable if the "before wifi" action is left at its default of "prompt", this feature now *requires* that to be set to "turn_on" (on devices where it can, of course); attempting to toggle it on will warn about that if necessary.
This change is retroactive (OTM).

Includes an assortment of fixes and cleanups, including migrating to the new LuaSettings API, which is why there's no longer a smattering of superfluous flushes.
10 months ago
yparitcher 1f62091b73
HtmlboxWidget: pairs->ipairs (#10574)
thanks @poire-z
Closes: #10565
11 months ago
hius07 46933035c5
Open with: images (#10561) 11 months ago
poire-z 18cd6b79d8
BookMap: fix help text wording (#10544)
See https://github.com/koreader/koreader/pull/10530#discussion_r1217635869.
11 months ago
poire-z 04425b74fc BookMap: add "Overview" mode
Add a restricted but convenient mode showing BookMap like
in initial view, while still allowing chapter levels to be
tweaked. This allows getting back to this view with another
gesture to see the overall progress in the book, while
still having the normal BookMap in flat mode acting as
an alternative ToC.
Available as an action to associate to a gesture, and
with long-press on the "Book map" menu item.
11 months ago
poire-z b7078caf29 BookMap: add option "10-page markers"
Allows hairy-boxes amateurs to get small markers (under
the baseline) every 10 pages (with -/+ to get small or
medium markers, with optionally smaller ones every 5 pages).
11 months ago
poire-z 5f4cd9df00 BookMap: add option "Page browser on tap"
Enabled by default, to get the current behaviour.
Disabling it allows people with small fingers to jump
directly to that page in Reader.
11 months ago
poire-z ac159928dd BookMap: nicer alignment of the vertical page number
Align page numbers (the vertical ones, on the left of
a BookMapRow) on the baseline of the BookMapRow, where
page slots rise from.
Also tweak the page number spike below the baseline used
in PageBrowser.
11 months ago
poire-z fa68c1e488 PageBrowser: smaller margins if no thumbnail page numbers
Also fix possibly unbalanced left and right margins.
11 months ago
hius07 38bb4a1983
QuickMenu: scrollable (#10528) 11 months ago
hius07 a8244ddd23
FileChooser: fix legacy "Files and folders mixed" collate setting (#10514)
Closes #10509.
11 months ago
NiLuJe 17d5934712
Notification: NOP conflicting event handlers from our base class (#10471)
Notification is a toast, so it doesn't stop event popagation.
If we don't disable thoses handlers inside Notification, we get spurious
duplicate handlers being fired ;).

Fix #10461
11 months ago
poire-z 011c168686
Wikipedia EPUBs: strip out invalid-XHTML <link> (#10462) 11 months ago
NiLuJe 7e98b9de4b
PM: Minor refactor to suspend/resume code flow (#10426)
Make sure we only send Suspend/Resume events when we *actually* suspend/resume. This is done via the Device `_beforeSuspend`/`_afterResume` methods, and those were called by the *input handlers*, not the PM logic; which means they would fire, while the PM logic could actually take a smarter decision and *not* do what the event just sent implied ;).

(i.e., sleep with a cover -> suspend + actual suspend, OK; but if you then resume with a button -> input assumes resume, but PM will actually suspend again!).

Existing design issue made more apparent by #9448 ;).

Also fixes/generalizes a few corner-cases related to screen_saver_lock handling (e.g., don't allow USBMS during a lock).

And deal with the fallout of the main change to the Kobo frontlight ramp behavior ;).
12 months ago
hius07 3dce41269d
Translator: translate current page (#10438) 12 months ago
NiLuJe b989a6ff15
NaturalLightWidget: Fallback to previous values instead of `nil` (#10425)
Happens in case the InputText field is emptied by the user.
The backend code makes rather strong assumptions that it'll *always* get a number of of it ;).

Fix #10352
12 months ago
NiLuJe 5c353c2289
OTM: Attempt to deal with wonky config states (#10429)
Such states (not quite sure how you could actively get in such a broken state to begin with, mind you)  could lead to an attempt to load an old fontlist cache in an incompatible format.

Re: #9771
12 months ago
poire-z fc81c7db24 DictQuickLookup: add button to show list of results
Add a left button to the title bar to show the list
of results as a popup.
Dictionary: tap or long-press on that button give
different view of the results.
Wikipedia: request 30 results instead of 20, so we
can show 15, 10 or 6 of them per page of that popup.
12 months ago
poire-z 8c8a032269 ButtonDialog: allow for step/page scrolling
With tall ButtonDialog with many rows, allows for a more
natural and readable scrolling without any truncated row
(like in Excel, we previously behave as web browsers).

ButtonTable:
- make the span and separator layout more explicite
- add some small horizontal padding when button text
  is centered
12 months ago
poire-z 7a95d11f07 ScrollableContainer: add support for step/grid scrolling
When the containee is row-based, this can ensure that when
scrolling with swipes, we get the a full row at top, and
that any truncated row at top or bottom is fully visible
after a swipe.
12 months ago
poire-z 0ee10e5049 Button: fix unstable height
The final height of a button could be different whether
a smaller font size or multiline end up being used.
Also fix 2-lines logical error making it less favored.
Also forward any lang property to the underlying text widgets.
12 months ago
poire-z 4fa7e718a2 TextBoxWidget:getFontSizeToFitHeight(): allow for more accuracy
By providing the font that will be used.
As it's more expensive, use only when really needed.
12 months ago
hius07 b4f453eb58
Page overlap: add "Horizontal line" marker (#10401) 12 months ago
hius07 2ba694d394
FileChooser: fix percent sorting (#10393) 12 months ago
yparitcher 1102c030fa
Kindle: toggle cover events
Allow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device

for those of use that stay in koreader, are caseless and have get spurious wakeups
1 year ago
hius07 4f23a6fafa
Custom book covers (#10329) 1 year ago
John Hackett 3f9820052d
Add esperanto-english dictionary (#10297) 1 year ago
hius07 9db74f1f01
ConfirmBox: add widgets (#10364) 1 year ago
hius07 a5320acf4f
koptoptions: fix default margin (#10376)
Regression from #10208.
Closes #10373.
1 year ago
zwim 00b3594d44
Kobo: Refactor frontlight toggle ramp behavior (#10305)
* Rewrite the loop mechanism to use scheduled tasks instead of a single blocking-ish subprocess.
* Change the actual logic to be more pleasing to the eye, especially on newer devices, as those *may* natively ramp on set; and fix a bad interaction with that behavior that could lead to no ramp at all on ramp down.
* Simplify Generic's Suspend handling to deal with the refresh ordering in a saner manner. The screensaver might be visible a tad longer than before this change before the frontlight actually ramps off.
1 year ago
zwim 662bd65a5f
Fix some screen refresh effects (#10306) 1 year ago
poire-z 04fba2205d PageBrowser: show page number alongside thumbnails
Add a top left menu item -/+ to show none, only on the
first thumbnail of a row, or on all thumbnails.
Also make the page slot separator longer in the bottom
ribbon before pages that start a thumbnails row.
Also show a little spike in the bottom ribbon below page
slots that get their page number displayed, to ease
figuring out the connection.
1 year ago
weijiuqiao cb9cbff10e
KeyValuePage: fix corner-case alignment bug (#10326)
Change algorithm to comparing all kv pairs.
Also ignore any pairs where the value is "" when computing
the alignment, since they usually are intended more as
a title and should not interfere.
1 year ago
NiLuJe 53e6cf563a
Deal with table.pack corner-cases properly (#10350)
c.f., https://github.com/koreader/koreader-base/pull/1603 for more
details.

Re: #9624
1 year ago
hius07 be7d6008d1
Reader: do not apply line spacing out of range (#10307)
* readercoptlistener: fix line spacing out of range

* readerkoptlistener: fix line spacing out of range

* creoptions: fix line spacing limit
1 year ago
zwim 4dbaca180a
PM: Optimize task queue handling around standby (#10203)
Instead of firing on(Enter|Leave)Standby Events, and having every other piece of code that might care about that handle re-scheduling their stuff themselves; simply make the standby implementation (i.e., AutoSuspend's) shift the whole task queue by the amount of time spent in standby to re-sync everything automatically.

(This is necessary in the first place because Linux, as the task queue ticks in CLOCK_MONOTONIC, which does *not* tick during suspend/standby; while we expect most of the tasks scheduled to actually reflect real world clock delays).
1 year ago
hius07 483a005cc2
File browser: show Folder Menu on long-press on Home icon (#10298) 1 year ago
hius07 b01e1c5918
Reader: do not apply font size out of range (#10295) 1 year ago
hius07 14de514ae8
filechooser: fix show files in bold (#10296) 1 year ago
poire-z 960671a16c PageBrowser: tweak scrolling behaviour at book start/end
Handle scroll by row or page a bit differently, so we dont
constrain and readjust the focus page when reaching book
start or end: when later scrolling in the other direction,
we'll find exactly the view as it was (this means that
we allow a single thumbnail in the view, but it's less
confusing this way).
1 year ago
poire-z 7c5c7bb9cf Calendar view's day view: thicker separator at 00:00
When using the new option "Daily timeline starts at",
make the separator line between 23:00 and 00:00 thicker.
Also tweak time picker to pick minutes by units of 10,
and remove max hour (06:00) limitation.
1 year ago
hius07 b98fee3dd0
filechooser: fix bug with "unreadable content" (#10283) 1 year ago
hius07 59a0139a60
File browser: add Folder Menu (#10275) 1 year ago
yparitcher bc5d354225
ReaderLink: allow a forward location stack (#10228)
this allows going back and forth from links (think of undo / redo)

when going back and no forward locations and when we are not on the same page as the last saved location, add the current location to the forward stack, helping if one goes back by mistake they can jump back to their current location

when going back and no forward locations and when we are not on the same page as the last saved location, add the current location to the forward stack, helping if one goes back by mistake they can jump back to thier current location
1 year ago
hius07 4d26650ad6
Filesearcher: add search in book metadata (#10198) 1 year ago
hius07 aedb713f82
Menu widget: cleanup (#10241) 1 year ago
poire-z fd0759e351 Book map, Page browser: add top left menu
Split original very long help text (which was very
slow to display) into 2 parts: About... and Available
gestures.
Also add -/+ buttons to change things (which can already
and more practically be done with swipes along the edges)
to give a bit of meat to these menus.
1 year ago
poire-z 8036ca0d56 MovableContainer: add support for anchoring initial position
When passing as 'anchor' a Geom object (ie. a widget dimen
or a ges.pos), or a function returning such an object,
a MovableContainer will be initially positionned near this
point/widget, instead of being centered on the screen.
Allow that for ButtonDialog and ButtonDialogTitle, so we
can make them behave as context menus (ie. for a titlebar
top left/right icons).
1 year ago
poire-z 25a7ca9a60 ButtonTable: allow shrinking unneeded width
If buttons and their text would fit in a smaller width,
reduce the whole ButtonTable width.
May be used for properly sized context menus with
ButtonDialog, with the width required depending on
the translations for a language.
1 year ago
poire-z a04244091f ButtonDialog/ButtonDialogTitle: consistent 'width' handling
Make these 2 widget behave similarly, and don't rely on
ButtonTable default width for their own default width.
ButtonDialogTitle: also properly size its title.
1 year ago
poire-z 7d62f639cc ButtonTable: allow buttons to request a fixed width
It is expected some button(s) in a row do not specify
such a width, so they get distributed the remaining
space from the ButtonTable specified width.
1 year ago
poire-z 02d6097dca Button: fix enableDisable when multilines
Also add support for a enabled_func() property, and
ensure its enable/disable state on each repaint.
1 year ago
poire-z e3156c7b25 FrontLightWidget: cleanup buttons layout
Properly compute Button and separator widths,
instead of using magic numbers (which lost their
magic over the years :)
Ensure buttons and progress widgets are properly
aligned on the sides.
Move the optional Warmth "Configure" button in the
middle of Warmth Min and Max.
Fix keyboard navigation layout, which was not working
on devices with Warmth.
1 year ago
poire-z f0122cf457 Button: handle 'width' as the final outer width
All our widgets are considering their provided 'width'
as the outer width, except Button which considered it
as some 'inner width', to which padding/border/margin
were added. Let's have them all consistent.
Some other widgets using Button had tweaks to account
for that odd behaviour: fix and simplify them.
Also fix Button layout when text is left aligned.
1 year ago
Frans de Jonge 1dfb766ff1
[i18n] Fix untranslated "Screensaver message" (#10217)
Reported in <https://www.mobileread.com/forums/showpost.php?p=4306749&postcount=107>.
1 year ago
poire-z 3006348585 PageBrowser: toggle page bookmark with long-press on thumbnail 1 year ago
poire-z 683452fd57 KOpt: switch page_margin to buttonprogress and fine tuning
Allow for larger margins (which may exhibit other issues
that were less noticable with small margins).
1 year ago
nairyo 65031ae14f
Dictionary lookup window: use from/to language to determine glyph form (#10184)
For example, to determine whether the Japanese or Chinese form should be shown.

* Dictionaries.lua - use iso3 codes everywhere
readerdictionary.lua - convert iso to bcp tag, to construct ifo_lang
isolanguage.lua - map from iso3 to full language name, map from iso3 to bcp language tag

* Make the full language names translatable

* Store ifo information from dictionaries.lua in downloaded dictionaries
1 year ago
poire-z eeb3c08457 View HTML: add CSS helpers with long-press
Move View html code from ReaderHighlight to a new
dedicated module.
Long-press on an element or its text in the HTML will
show a popup with a list of selectors related to this
element that can be copied to clipboard (to be pasted
in Find or in a Book style tweak).
2 addtional buttons in this popup allow seeing all the
CSS rulesets in all stylesheets that would be matched by
this element, which should make it easier understanding
the publisher stylesheets and using or creating style
tweaks.
1 year ago
poire-z 945a1cc76f TextViewer: add support for long-press on text
As done in DictQuickLookup (more event handlers are
needed to cohabitate well with MovableContainer).
By default, selected word or text is copied to clipboard.
Also provide indexes to any long-press callback, as we'll
need them for View HTML.
1 year ago
hius07 3640842bc2
BookStatusWidget: relocate status toggle buttons (#10179)
Same order as in the new file dialog status buttons.
1 year ago
hius07 d2ed7402da
FileChooser: fix sorting and getNextFile() issues (#10176)
- Fix sorting folders when collate is "type", "size", "percentage":
  folders are sorted by name now.
- Fix getting next file in folder when collate is "mixed files and
  folders": returned nil when next item was a folder.
1 year ago
zwim efd2df6f05
Version log and (limited) notifications log (#10178)
This PR will close #1257 and #3418.
1 year ago
NiLuJe 825d812f93
Button: don't dump the widget in a debug print (#10171)
Just display its ref.

Re: https://github.com/koreader/koreader/pull/7166#issuecomment-1445177124
1 year ago
hius07 38bd768d5e
DocSettings: Move book metadata to preferred location (#10149) 1 year ago
hius07 55f1b8c974
UX: a set of minor fixes (#10165)
- AutoFrontlight plugin: update checkmark on toggling
- KeepAlive plugin: update checkmark on toggling
- ReaderPageMap: font size menu entry
- ReaderStatus, common_settings_menu_table: book status "read" -> "finished"
1 year ago
hius07 5c9ba53353
History: update last book access time (#10156) 1 year ago
melyux 81c0bc396a
Duration format: Add spaces, remove lead zeros for Letters (#10141)
* Add thinspaces between d/h/m/s
* Remove lead zeros
* Make letter `d` for days translatable
* Make thinspace into hairspace when compact
* Adjust and add unit tests
1 year ago
poire-z b610facfdc
Partial rerendering: really avoid flash on reload (#10155)
Also restore input if ReaderUI crashed.
Also avoid refresh_count management when "Full refresh
rate" is set to "never".
1 year ago
NiLuJe 5330c24b77
Device: Handle network info data gathering ourselves (#10139)
i.e., we now query routes, interfaces, wireless extensions & ping ourselves, dropping the dependency on specific CLI tools altogether.
1 year ago
ichnilatis-gr 0f3aeb7628
Keyboard: some transpositions in el_popup for practical reasons (#10144) 1 year ago
NiLuJe e79f161516 Dictionaries: Update URL for pt_PT
Fix #10134 (sorta ;p)
1 year ago
hius07 d1081fa982
Docsettings: add centralized sdr storage (#10074)
Added an option to choose a new location to save document settings, highlights and bookmarks 
(koreader/docsettings folder).
1 year ago
NiLuJe c5d606a7f4
ProgressWidget: Add an optional marker on the initial position (#10114)
* Enable it on SkimToWidget
* Optional on ReaderFooter (toggle in the progress bar > style submenu)
1 year ago
poire-z 81f2aed086 ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments,
and a file size large enough to ensure a cache file is used.
The idea is simply, on any rendering setting change, to
skip the rerendering of the full book and to defer any
rerendering to the moment we draw a DocFragment, and
render only it.
So, on a setting change, only the fragment containing the
current page will be rerendered, and the new fragments we
may cross while turning pages.
When having done so, KOReader is in a degraded state (the
full page count is incorrect, the ToC is invalid...).
So, a full rerendering is needed, and one will happen
in the background, and when the user is idle, we reload
seamlessly and quickly from the cache file it has made.
ReaderFlipping will show some icons in the top left
corner to let it know at which steps in this procress
we are.
1 year ago
poire-z e4b97802a5 ImageWidget: account for alpha in the cache hash 1 year ago
poire-z 8d3cda532b MultiConfirmBox: allow changing icon 1 year ago
poire-z af1de5b6a3 TouchMenu: allow help_text on disabled menu items
Also don't propagate tap/hold on disabled menu items.
(When top and bottom menu displayed at the same time,
tap on a disabled top menu item could active some
bottom toggle change.)
1 year ago
hius07 db9cb542e4
FileChooser: optimize sorting functions (#10091) 1 year ago
melyux 8b99c50b2d
Duration format: add "Letters" format (1h30m10s) (#9924) 1 year ago
Melik 9e7e68beb6 Shorten status button names 1 year ago
NiLuJe 96850c23a0
NetworkMgr: Refine isConnected check (#10098)
Much easier to deal with thanks to the cleanup work done in #10062 ;).

* `carrier` is set to 1 as soon as the device is *administratively* up (in practice, as soon as we run `ifconfig up`). This is perfectly fine for `isWifiOn`, but absolutely not for `isConnected`, because we are not, actually, connected to *anything*, no attempt at associating has even been made at that point. Besides being semantically wrong, in practice, this will horribly break the connectivity check, because it expects that `isConnected` means we can talk to at least the LAN.
* Delving into the Linux docs reveals that `operstate` looks like a better candidate, as it reflects *operational status*; for Wi-Fi, that means associated and successfully authenticated. That's... closer, but still not it, because we still don't have an IP, so we technically can't talk to anything other than the AP.
* So, I've brought out the big guns (`getifaddrs`), and replicated a bit of code that I already use in the USBNetwork hack on Kindle, to detect whether we actually have an IP assigned. (Other approaches, like `/proc/net/route`, may not be entirely fool-proof, and/or get complicated when IPv6 enters the fray (which it does, on Kobo, Mk. 8+ devices are IPv6-enabled)).

TL;DR: Bunch of C via ffi, and `isConnected` now returns true only when the device is operationally up *and* we have an IP assigned.

Pulls in https://github.com/koreader/koreader-base/pull/1579 & https://github.com/koreader/lj-wpaclient/pull/10
1 year ago
hius07 03454a89d8
Screensaver: correct access to doc settings (#10105) 1 year ago
yparitcher d60c75e00d network: Allow auto_wifi_off on kindle & remarkable
They expose a network sysfs entry so we can track usage

Works for me on kindle, but i stop the amazon framework
1 year ago
yparitcher 0e53631f48 NetworkManager: isWifiOn isConnected consistent usage.
cervantes kindle kobo remarkable: use sysfs carrier file to determine connection state

cleanup hasWifiManager checks

gateway check: use ip if available

Fixes: #10087
Closes: #10092
1 year ago
NiLuJe 45a4aac3d3
Notification: Fence the *display* update in an attempt to avoid upsetting some boards... (#10083)
Re: https://github.com/koreader/koreader/issues/9806#issuecomment-1416827447

Depends on https://github.com/koreader/koreader-base/pull/1576

Includes assorted cosmetics tweaks related to duplicate `setDirty` calls when instantiating widgets that already have an `onShow` handler doing it. (I left widgets doing it in `update` instead of `init` alone, on the assumption that callers *may* be relying on that behavior when updating widgets at runtime. This might actually never matter, and it certainly didn't for ScreenSaverWidget, which is why I removed it from there ;p).
1 year ago
zwim 4e944dc918 patch management
Use texteditor if available

Auto disable if patches folder doesnt exist

And show a restart message after file edit

Sort menu entries in execution order

Warning sign for failing patches
1 year ago
zwim c5997a6246
[Document] Consistent menu entries in auto-save menu (#9995) 1 year ago