2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

441 Commits

Author SHA1 Message Date
NiLuJe
5499d85cbc
Allow running shell scripts from the FileManager/Favorites (#5804)
* Allow running Shell/Python scripts from the FM

* Show an InfoMessage before/after running the script

Since we're blocking the UI ;).

* Allow running scripts from the favorites menu, too.
2020-02-03 20:08:18 +01:00
NiLuJe
f44b031702
Make Inverted Portrait a first-class citizen (#5783)
* Don't store stale screen/rotation modes in book's settings!

Gyro events *may* entirely bypass the local copy...
In any case, using a local copy was essentially asking for trouble...

Actually fix #5772

(because the issue was indeed that a Gyro swap from Portrait to Inverted
Portrait wasn't stored properly).

* Allow showing ScreenSavers in Inverted Portrait.

That works just fine, and won't lead to the confusing situation where a
lefty might pick up the device as a righty because the ScreenSaver
happens to be shown that way, only to have it rotate back to its lefty
orientation on wakeup...
2020-01-23 20:08:51 +01:00
Martín Fernández
5ef329c19c android: share text (#5745) 2020-01-05 12:56:01 +01:00
Martín Fernández
419b42cf2c
android: call EPD test from within KOReader (#5737)
* android: call EPD test from within KOReader

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2020-01-04 20:53:49 +01:00
poire-z
0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
2020-01-04 01:34:46 +01:00
Martín Fernández
25e80358dc android: import files from Storage Access Framework 2020-01-02 01:28:20 +01:00
Martín Fernández
f9a820d682 android: unbreak KO on scoped storage devices 2019-12-12 21:17:03 +01:00
Martín Fernández
72e5574ca7 android: allow overrides on 3rd party dictionary list 2019-12-07 17:22:00 +01:00
Martín Fernández
f1f75c5cb0 android: touchscreen toggle option (#5564) 2019-11-06 00:52:44 +01:00
Martín Fernández
87334801ea android: fix ko paths when primary storage is a SD card 2019-10-14 09:11:58 +02:00
NiLuJe
9f4ba77fab [Kobo] Always set the warmth on the KA1 (#5468)
It might be possible to instead only set the white led, but I don't
have the hardware to test that theory, se, eh.

Fix #5465 (probably.)
2019-10-11 20:37:18 +02:00
Martín Fernández
b75fec4971 tweak timeouts, add haptic feedback support
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2019-10-08 18:22:56 +02:00
Frans de Jonge
f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
2019-09-29 15:42:05 +02:00
NiLuJe
abc86323fc [Kobo/Cervantes] Always use setBrightness to set the brightness (#5429)
sysfs_light handles every case sanely already, no need to be cute ;).

This prevents always setting the warmth when setting the FL on NL
devices with a mixer, because, besides being useless, it's also slow
(lua does mmap'ed io, so every handle requires an fstat + mmap).

It was subtly affecting the fluidity of the toggle ramp, and much less
subtly wreaking havoc on #5373 ;).

KA1 owners might want to investigate keeping the fds around one way or
another, like we do for the fl ioctl, to alleviate the overhead of doing
that for not one but three or four fds...
I won't be doing that, since I lack the hardware to test it, and FL+NL
stuff is pain.

* Do the same on Cervantes

* Bump base to pickup related ioctl tweaks
2019-09-26 23:59:31 +02:00
NiLuJe
e7cfc65780 [Kobo] Unbreak the FL ramp-up/down (#5421)
I got my wires crossed.

It's fast on Mk. 5, slow on Mk. 7.
So, slow it down on Mk. 5 so we actually get a ramp and not a jump.
2019-09-24 20:27:28 +02:00
NiLuJe
f96cfe940b
Use the proper LED driver on the Libra (#5416)
So that we can actually set the warmth ;)
2019-09-23 18:06:57 +02:00
NiLuJe
bcceb94603
Hotfix the startup orientation on the Kobo Libra (#5409) 2019-09-22 02:22:22 +02:00
NiLuJe
1c2c471c5f
[Kobo/Cervantes] Prefer using the ioctl over sysfs when setting the FL. (#5407)
* Prefer using the ioctl over sysfs when setting the FL.
It's much lower latency (re #5373).

We can do so on NL devices with a mixer.
2019-09-22 02:11:18 +02:00
tobiasarndt
a2f605ba38 [fix] added PocketBook InkPad 3 Pro to device.lua (#5398) 2019-09-18 15:21:04 +02:00
Frans de Jonge
672d29fbcc [fix] WakeupMgr: pass through task epoch for proximity check 2019-09-14 16:27:54 +02:00
Frans de Jonge
0c290be055 WakeupMgr: add log when scheduling wakeup 2019-09-14 16:27:54 +02:00
Frans de Jonge
3836184f9d [Kobo] Always write scheduled wakeup info to log 2019-09-14 16:27:54 +02:00
NiLuJe
4363576066 Support the Kobo Libra
(Hopefully?).
2019-09-12 14:27:05 +02:00
Frans de Jonge
e257c4e45e
[feat, Kobo] Autoshutdown (#5335)
The methods used here will likely work on most embedded devices, which is why I put them in their own WakeupMgr interface/scheduler module, separate from Kobo.

See https://www.mobileread.com/forums/showthread.php?p=3886403#post3886403 for more context.

Fixes #3806.
2019-09-12 14:15:08 +02:00
Frans de Jonge
0dad707e2e
[fix, Kobo] Don't crash trying to sync frontlight with Nickel. (#5361)
When reasonably possible, the program should only crash in debug mode.

Adds a couple of extra unit tests to prevent regressions and adds docs.

Fixes <https://github.com/koreader/koreader/issues/5356>.
2019-09-11 18:11:24 +02:00
Martín Fernández
20ebb55703 [Cervantes] Disable wifi before returning to QT, improved sysfs read (#5326) 2019-09-06 15:56:16 +02:00
Frans de Jonge
7019ff15bd
[chore] Drop SDL 1.2 (#5324)
Depends on https://github.com/koreader/koreader-base/pull/963.

Also includes Initial import of <linux/rtc.h> related stuff https://github.com/koreader/koreader-base/pull/965
2019-09-05 23:30:13 +02:00
Robert
ae50569055 Frontlight - Add checkbox use system settings (#5307)
See: https://github.com/koreader/koreader/issues/5205#issuecomment-526935357

Devices with `hasLightLevelFallback = true` (for now Android) has extra checkbutton `Use system settings`. Default unchecked.
2019-09-04 20:52:24 +02:00
Frans de Jonge
1b17ce8ba0
[fix, Kobo] Save frontlight state on shutdown after suspend (#5305)
Fixes <https://github.com/koreader/koreader/issues/5292>.
2019-09-01 21:25:32 +02:00
Frans de Jonge
cfa73be940
[feat, Kobo] Implement shutdown from suspend (#5280)
This allows to shutdown straight from suspend just like Nickel.

Fixes <https://github.com/koreader/koreader/issues/2431>.
2019-08-29 22:02:08 +02:00
Frans de Jonge
be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
2019-08-26 15:49:50 +02:00
Frans de Jonge
9cd8e4a53a [chore] Work around weird LDoc bug
Using two `@fixme` tags directly following each other can result in a crash.

See <https://github.com/stevedonovan/LDoc/issues/314> for the upstream issue.
2019-08-25 11:44:43 +02:00
Frans de Jonge
59bb3ac8ea
[chore] Remove executable bit on device/input.lua (#5258)
I've got no idea why that might be there.
2019-08-25 11:43:56 +02:00
Frans de Jonge
a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
2019-08-23 19:53:53 +02:00
Martín Fernández
3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
2019-08-20 18:38:02 +02:00
Martín Fernández
3161673d70 fix #5228 2019-08-20 16:26:39 +02:00
vvasseur
c104724a58 PocketBook 626 new codename (#5215) 2019-08-16 22:59:36 +02:00
Martín Fernández
50ce8d47cd do not request write settings permission at launch 2019-08-15 15:28:28 +02:00
Robert
939538cc25 [UX] Add gesture - poweroff and restart device (#5202)
Also abstract canRestart, canReboot and CanPowerOff.
2019-08-15 14:49:15 +02:00
NiLuJe
10511220e5 Simplify isWifiOn on Kobo (#5211)
Don't fork for lsmod + grep, we can perfectly well parse /proc/modules
ourselves ;).

c.f., https://github.com/koreader/koreader/pull/5203#issuecomment-521277628
2019-08-14 20:50:03 +02:00
jetomit
20493eebc3 [fix, Kobo] Add missing parentheses (#5198)
Prevents a crash when the WIFI_MODULE environment variable is not
defined.
2019-08-12 16:06:55 +02:00
Martín Fernández
10456169e5
Android: ignore touchscreen by user request (using a hardware key) (#5164)
* android: ignore touchscreen by user request (using a hardware key)
2019-08-03 01:02:50 +02:00
NiLuJe
e2961097e7
Don't use WAL on devices where it's not supported (#5162)
(i.e., truly ancient kernels and weird FS).

In which case, we use TRUNCATE, which might be a tad less terrible than
DELETE on said weird crap FS.
2019-08-01 19:10:46 +02:00
Martín Fernández
91b2faae6a android: add an option to ignore volume keys or use them to turn pages 2019-08-01 19:05:23 +02:00
NiLuJe
53adb9d0e1
On (really old) Kindles, don't crash if there's no sysfs entry to read for battery capacity (#5161)
Parse gasgaucge-info's output instead.

Fix #5159
2019-08-01 18:45:30 +02:00
NiLuJe
e9eca55d90
Minor auto_restore_wifi tweaks (#5143)
* Try to make sure restoreWifiAsync eventually sends a NetworkConnected
event...

re: #5109

* Take a page from @shermp's book, and make sure wpa_supplicant managed to
connect to the AP before acquiring an IP.
Tear down WiFi modules in case of failure.
c.f., https://github.com/shermp/Kobo-UNCaGED/pull/21

* Don't let restore-wifi-async.sh enable WiFi behind our back when we're
killing it to start Nickel...

* Don't even call ping if there's no default gw
2019-07-31 01:00:51 +02:00
Robert
803a143764 [sdl] Add support arrow key for next/prev page (#5149)
Close: #4997 
This PR add support arrow key and mouse scroll wheel for next/previous page.

- Document in page mode:

PageDown, Arrow down, Arrow right - go to next page
PageUp, Arrow up, arrow left - go to prev page
Mouse scroll wheel down - go to next page
Mouse scroll wheel up - go to prev page

- Document in scroll mode:

PageDown, Arrow right - go to next page
PageUp, Arrow, arrow left - go to prev page
Arrow down - scroll document down
Arrow up - scroll document up
Mouse scroll wheel down - scroll document down
Mouse scroll wheel up - scroll document up
2019-07-28 13:57:03 +02:00
Martín Fernández
cd0f1acd7f android: add support for different screen timeout setups 2019-07-26 23:16:23 +02:00
Robert
1f6af80817 [feat] Make gesture intervals configurable (#5138)
Discussion: #4842
Close: #4842
2019-07-24 14:31:20 +02:00
NiLuJe
74518c79d1
Fix Kindle model detection in some corner-cases (#5125)
* Fix Kindle model detection in some corner-cases

We were (currently) unaffected because we don't support the K1.
Still, this should be slightly more robust.
2019-07-19 23:16:25 +02:00