Commit Graph

453 Commits (master)

Author SHA1 Message Date
hugleo b026f84949
ReaderZooming: make auto-crop default be page content (#11438) 2 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
4 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
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.
5 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 b70f866656
DocSettings (again) (#11020)
Cleaning and optimizing Docsettings code.
6 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
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
Benoit Pierre 8f6fae81fa
tests: tag tests relying on a working internet access (#10939)
So they can easily be filtered-out when offline.
7 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
NiLuJe a15fc0e9a5 Revert "Test: Fiw readerhighlight test"
This reverts commit c23c422f62.
9 months ago
NiLuJe 66d2930e5e Revert "Tests: "Unbreak" some more tests"
This reverts commit f4dd0f92b2.
9 months ago
NiLuJe e63c613626 Tests: "Unbreak" some more tests
This is horrible and needs to burn in a fire.
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 22678ee5ff Misc: Review pass on the previous commits
* Unbreak the Device test
* Rename a few things
* Tweak a few comments
9 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
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
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)
10 months ago
Benoit Pierre f661726fef tests: fix listing tests with `busted --list` 10 months ago
Benoit Pierre fdd645af73 tests: minor cleanup 10 months ago
hius07 dee1c902ec
ReaderUI: minor optimization (#10634) 10 months ago
Benoit Pierre c95b17410b
tests: fix EPUB test (#10566)
Otherwise the test fail in my environment because of some user fonts.
11 months ago
Frans de Jonge f7d633cc3d
readerhighlight_spec: add #nocov to some highlight tests (#10559)
The problem stems from <https://github.com/koreader/koreader/pull/10492> but we need the translations to go through.
11 months ago
hius07 66b661b726
Update readerhighlight_spec.lua (#10515) 11 months ago
hius07 57f4ff2c68
ReaderHighlight: manage overlapped highlights (#10492) 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
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
kpopconnoisseur 0533ec46d8
kindle voyage: no framework: whispertouch button activation
kindle: "no framework" voyage page turn buttons
kindle: update device tests
1 year ago
yparitcher 64b0f5e7cf ReaderFooter: separate ToggleFooterMode from TapFooter
the footer can be toggled by gestures and menu, and should only be locked or skim in flipping mode when the footer is tapped

also allow toggling when only displaying the progress bar

rename to TapFooter to show it is not an event

Fixes: #10355
1 year ago
nairyo 983e083a0b
Center pdf manual zoom mode (#10246)
Center PDF content when its width is smaller than the screen

fix #9967
1 year ago
hius07 fe7b10f18d
Datastorage: do not create unnecessary folders (#10162) 1 year ago
hius07 38bd768d5e
DocSettings: Move book metadata to preferred location (#10149) 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
hius07 15605291c2
DocSettings: add support of centralized sdr storage (#10132) 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
melyux 8b99c50b2d
Duration format: add "Letters" format (1h30m10s) (#9924) 1 year ago
NiLuJe 144706654d Device: Drop unused device capabilities 1 year ago
NiLuJe 788ccac561
Input/Device: Refactor Gyro events handling (#9935)
* Get rid of the `canToggleGSensor` Device cap, it's now mandatory for `hasGSensor` devices. (This means Kindles can now toggle the gyro, fix #9136).
* This also means that `Device:toggleGSensor` is now implemented by `Generic`.
* Update the Screen & Gyro rotation constants to be clearer (c.f., https://github.com/koreader/koreader-base/pull/1568) (/!\ This might conceivably break some `rotation_map` user-patches).
* Input: Move the platform-specific gyro handling to Device implementations, and let Input only handle a single, custom protocol (`EV_MSC:MSC_GYRO`).
* Input: Refine the `rotation_map` disable method implemented in 43b021d37c. Instead of directly poking at the internal field, use a new method, `disableRotationMap` (/!\ Again, this might break some `rotation_map` user-patches).
* Input: Minor tweaks to event adjust hooks to make them more modular, allowing the Kobo implementation to build and use a single composite hook. API compatibility maintained with wrappers.
1 year ago
zwim 192a243b4d Add datetime.lua
Move date and time related functions from util.lua
(and the statistics plugin) to a new datetime.lua.
1 year ago
zwim 486d7071c7
[StatusBar] Allow status bars to be repainted if they are not covered (#9768) 1 year ago
NiLuJe c7f5bfb72a ScreenSaver: Handle Power button presses properly if the screensaver
lock is enabled

Fix #9744
1 year ago
zwim 07748b0999
[UIManager] Reverse order of _task_queue (#9706) 2 years ago
zwim 94d3d3b487
[timeval] RIP on All Saints Day (#9686) 2 years ago
NiLuJe b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

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

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2 years ago
hius07 c36a2929ac
OPDSbrowser refactoring (#9703)
Refactoring:
-removed duplicated code
-removed passing of username/password through all the modules
-logical order of the methods
-some optimizing and drying
-comments

New features:
-subcatalog link can be saved to the list of servers (eg: direct link to the catalog of books by an author)
-more book information can be fetched and shown (Book information)
-fixed access to the Standard library (by @KGKopli, closes #9372)
2 years ago
zwim 31b16ba3e1
UIManager: get rid of self._running and self._run_forever (#9669) 2 years ago
zwim 88add4ed6f
[spec] _task_queue has to be sorted! (#9694) 2 years ago
zwim db8e2a9403
[spec] Get rid of argc in the _task_queue (#9684)
argc was eliminated in #9624

Thanks to @hius07  https://github.com/koreader/koreader/pull/9680#issuecomment-1290440793

Plus a minor change in the scheduling test, so that the _task_queue is not filled only from one end.
2 years ago
hius07 4d4b04359c
ReadHistory: refactoring with binary search (#9603)
Get rid of indexing and sorting, reduce flushing.
2 years ago