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

796 Commits

Author SHA1 Message Date
zwim
d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2022-05-24 00:25:50 +02:00
zwim
13274d6212
datetimewidget: simpler usage, allows 2 to 6 numberpickers for date and time (#9070) 2022-05-23 20:32:59 +02:00
Martín Fernández
49c02790f6
fix: attempt to call local start_time (number) (#9086)
Follow up https://github.com/koreader/koreader/pull/8999
2022-05-09 08:27:58 +02:00
Utsob Roy
bc0a55f093
Refactor exporter.koplugin (#8944)
Changed:
  - select multiple targets and export to them in a single click.
  - local targets (html, json and text) now are timestamped. Exporting booknotes on already exported documents will generate a new file with all the highlights present at export time. Previous files won't be deleted.

Fixed:
  - chapters are now correctly represented in html output.
  - json issues when exporting the whole history.
  - joplin and readwise crashes when they're unable to reach the server
  - joplin update notes mechanism.
  - joplin is able to recreate the notebook if the user deletes or renames its current one.
  - highlights of read-only documents are also added when exporting the whole history (affects mostly android, might affect desktop targets)

Co-authored-by: Utsob Roy <roy@utsob.me>
2022-05-06 22:44:28 +02:00
Philip Chan
d6ff983243
Show TitleBar left and right buttons on non-touch devices (#9041)
Titlebar button navigation in menu, including ListMenu and MosaicMenu in FileManager, History, Favourites and Shortcuts.
Hide show password checkbox in non-touch devices
2022-05-06 10:44:25 +02:00
zwim
9b9cfe29a4
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2022-05-05 21:00:22 +02:00
NiLuJe
86c35ad066
A host of low power states related tweaks (#9036)
* Disable all non power management related input during suspend. (This prevents wonky touch events from being tripped when closing a sleep cover on an already-in-suspend device, among other things).
* Kobo: Use our WakeupMgr instance, not the class.
* WakupMgr: split `removeTask` in two: 
* `removeTask`, which *only* takes a queue index as input, and only removes a single task. Greatly simplifies the function (i.e., it's just a `table.remove`).
* `removeTasks`, which takes an epoch or a cb ref, and removes *every* task that matches.
* Both of these will also *always* re-schedule the next task (if any) on exit, since we can have multiple WakeupMgr tasks queued, but we can only have a single RTC wake alarm set ;).
* `wakeupAction` now takes a `proximity` argument, which it passes on to its `validateWakeupAlarmByProximity` call, allowing call sites to avoir having to duplicate that call themselves when they want to use a custom proximity window.
* `wakeupAction` now re-schedules the next task (if any) on exit.
* Simplify `Kobo:checkUnexpectedWakeup`, by removing the duplicate `WakerupMgr:validateWakeupAlarmByProximity` call, now that we can pass a proximity window to `WakeuoMgr:wakeupAction`.
* The various network activity timeouts are now halved when autostandby is enabled.
* Autostandby: get rid of the dummy deadline_guard task, as it's no longer necessary since #9009.
* UIManager: The previous change allows us to simplify `getNextTaskTimes` into a simpler `getNextTaskTime` variant, getting rid of a table & a loop.
* ReaderFooter & ReaderHeader: Make sure we only perform a single refresh when exiting standby.
* Kobo: Rewrite sysfs writes to use ANSI C via FFI instead of stdio via Lua, as it obscured some common error cases (e.g., EBUSY on /sys/power/state).
* Kobo: Simplify `suspend`, now that we have sane error handling in sysfs writes.
* Kobo.powerd: Change `isCharging` & `isAuxCharging` behavior to match the behavior of the NTX ioctl (i.e., Charging == Plugged-in). This has the added benefit of making the AutoSuspend checks behave sensibly in the "fully-charged but still plugged in" scenario (because being plugged in is enough to break PM on `!canPowerSaveWhileCharging` devices).
* AutoSuspend: Disable our `AllowStandby` handler when auto standby is disabled, so as to not interfere with other modules using `UIManager:allowStandby` (fix #9038).
* PowerD: Allow platforms to implement `isCharged`, indicating that the battery is full while still plugged in to a power source (battery icon becomes a power plug icon).
* Kobo.powerd: Implement `isCharged`, and kill charging LEDs once battery is full.
* Kindle.powerd: Implement `isCharged` on post-Wario devices. (`isCharging` is still true in that state, as it ought to).
2022-05-01 23:41:08 +02:00
Utsob Roy
4e517f4839
[plugin] Exporter: properly sort highlights when exporting (#9021)
Since the bookmarks table is sorted based on the bookmarks'
position in the book, it is possible to sort clippings in
the exporter plugin based on that.
2022-04-22 20:13:36 +02:00
NiLuJe
5ac9463c09
AutoSuspend: Unbreak cohabitation between standby & suspend (#9009)
* Make sure AutoStandby cohabitates nicely with AutoSuspend (regression since #8985), specifically:
* Disable standby during suspend.
* Ensure that leaving standby restores the scheduled suspend properly, with the appropriate remaining amount of time based on the last user input.
* Handle devices with an auxiliary battery better when scheduling suspend (assume it's only charging when the aux battery is charging, not the ereader's).
* Tweak debug logging to be able to remote debug corner-cases more easily without requiring code changes.
* Fix erroneous behavior when awoken from standby by something that doesn't trigger an InputEvent Event (e.g., rtc alarm, gyro, or random bullshit).
2022-04-22 18:59:48 +02:00
lennonhill
08d6fbc9db
[plugin] Wallabag: archive instead of deleting read articles by default (#9018)
Fix <https://github.com/koreader/koreader/issues/8936>.
2022-04-19 17:39:47 +02:00
Dylan Garrett
8c58541c59 Add auto_tags setting. Combine UI code for auto_tags and ignore_tags 2022-04-18 15:46:12 +02:00
Dylan Garrett
7d04370558 Initial work to allow auto tagging 2022-04-18 15:46:12 +02:00
lennonhill
4fe39d6d43
[plugin] Wallabag: add basic error handling and abort synchronisation on request error (#8950)
Fixes <https://github.com/koreader/koreader/issues/8949>.
2022-04-15 19:25:58 +02:00
NiLuJe
5bb22709f7
Terminal: Make sure devpts is mounted on Kobo (#8998)
* Terminal: Make sure devpts is mounted on Kobo

Fix #8986
2022-04-13 00:21:36 +02:00
NiLuJe
087b97457d
AutoSuspend: Handle standby scheduling in the same manner as suspend/shutdown (#8985)
Specifically, don't forcibly unschedule/schedule on every input event, instead, let the scheduled task figure out if the deadline came to pass or not ;).

c.f., https://github.com/koreader/koreader/pull/8970#issuecomment-1092775830

Besides getting rid of some overhead, this allows proper scheduling after a task that would have blocked for longer than the standby timeout.
2022-04-12 23:08:48 +02:00
NiLuJe
2c25181644
Terminal: Make the prerequisites check verbose (#8994)
So we actually have a chance of understanding why it fails to load ;).

(Also, properly require posix FFI stuff, in the unlikely event they aren't already in the main namespace).
2022-04-12 22:45:32 +02:00
NiLuJe
61cafab0e5
AutoSuspend: Avoid unbalanced prevent/allow Suspend calls (#8970)
This prevents crashing interactions with other prevent/allow callers when the feature is disabled.
2022-04-10 19:25:37 +02:00
zwim
b845674bed
[plugin] String and formatting (#8980)
Easy the life of translators and fixes a stupid string typo.
2022-04-10 17:54:32 +02:00
zwim
158f4be724
Autosuspend: add autostandby (#8815)
Allows the device to go into standby (if available in `/sys/power/state`) to save power.
Adds an entry in the device menu to tune the timeout for standby.
(Shows total standby- and suspend-time in system statistics.)
2022-03-29 22:59:10 +02:00
Scarlett
d53ee056cc
Revert NewsDownloader (#8953)
My volumize PR introduced too many issues. Revert to previous version of NewsDownloader until they can be resolved.

Fixes #8867 

Reintroduces  #8799, #6234
2022-03-27 16:47:14 +02:00
yparitcher
c9bfb74d2a Book Shortcuts: allow recursively searching folders 2022-03-24 22:49:34 -04:00
Frans de Jonge
eeefc657cb
[fix, plugin] Wallabag: avoid crash when setDownloadDirectory doesn't have a touchmenu_instance (#8933)
Fixes #8930.
2022-03-21 18:47:22 +01:00
NiLuJe
23cd7e24bb
Minor Lua I/O cleanups (#8921)
Mostly making sure we always explicitly close io handles.
2022-03-19 23:57:31 +01:00
Utsob Roy
af7c8cade8
[feat, UX] CoverBrowser: add progressbar in Mosaic View (#8915) 2022-03-19 11:15:22 +01:00
Utsob Roy
d266d320e2
[plugin] Exporter: optimized JSON export (#8904)
I've implemented a better JSON export format that removes redundant lists and objects and introduces the `entries` key containing all the entries.

It also add `drawer` values from highlight so that user can use this piece of metadata to generate desirable output.
2022-03-19 09:59:04 +01:00
Tesseract Cat
d4bbd74208
Add OPDS PSE 1.0 support (#8919)
This PR adds support for the unofficial page streaming extension for OPDS. See: https://anansi-project.github.io/docs/opds-pse/specs/v1.0. This is useful for streaming comics from a remote server.

Addresses #7500.
2022-03-18 21:27:17 +01:00
Emir Taletovic
f8eca5fa03
Calibre plugin - Series/Tag browser updated to show back button. (#8869)
* Calibre plugin - Series/Tag browser updated to show back button.

* Handling page number

* Few updates to search logic:
- Moved "find books" option from CalibreSearch:find(option)
into CalibreSearch:browse(option) function. This way all search options
are handled in one place only.

- Menu is created only once and it is in CalibreSearch:browse(option)
function. This is where it is also invoked with UIManager:show(w).
Switching between different menu content (tags/series/books) is
done using CalibreSearch:switchResults function which will internally
call Menu:switchItemTable. Previously menu was being instantiated
in 2 places depending on are we searching books or series/tags

- Return arrow navigation: Border around Menu is gone to give space
for back arrow. Navigation seems to be working fine so far but will
give it some time to test in case I find any other bugs
2022-03-16 21:45:47 +01:00
Frans de Jonge
7235433b92
[i18n] Add context for calibre configuration type (#8909)
`Manual` could mean several things, most notably some kind of documentation and something you do by hand.

The added context is partially to aid translators and partially to preclude potential collisions in the future.

Cf. <https://github.com/koreader/koreader-translations/pull/138>.
2022-03-16 16:18:18 +01:00
NiLuJe
217a73f3c0
Initial Kindle PW5 support (#8856)
* Rejig frontlight warmth API to more closely match the existing API, and, hopefully, clarify some of its quirks, and reduce boilerplate and duplicate code in platform implementations.
* Tweak Kindle:setDateTime to prefer using the platform's custom script, as in interacts better with the stock UI. And make the fallbacks handle old busybox versions better.
* Add Kindle PW5 support ;).
* Add warmth support to the Kindle platform.
* Random TextBoxWidget cleanups: make sure we immediately free destroyed instances.
* FrontLightWidget: Refactor to make it slightly less obnoxious to grok and update; i.e., separate layout from update, and properly separate brightness from warmth handling. Move to simpler widgets instead of reinventing the wheel.
* TextBoxWidgets: Implement `setText` to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button).
* NaturalLightWidget: Make sure we pass a string to InputText
* InputText: Add debug guards to catch bad callers not passing strings ;).
2022-03-14 19:56:18 +01:00
hius07
7b4d6fd205
History: filter by book status (#8820) 2022-03-12 11:26:11 +01:00
Emir Taletovic
3e78847c46
Calibre plugin - Fixed hang when book has series but series index is nil (#8870) 2022-03-11 19:40:02 +01:00
Philip Chan
107156c0a8
[feat] Non-touch improvements (#8859)
FocusManager: fix round x use y layout
FocusManager: add tab and shift tab focus navigation support
FocusManager: handle Press key by default
FocusManager: make sure selected in instance level
FocusManager: add hold event support
FocusManager: Half move instead of edge move
FocusManager: add keymap override support
FocusManager: refocusWidget will delegate to parent FocusManager
Focusmanager: refocusWidget can execute on next tick
inputtext: can move out of focus on back
inputtext: fix cannot exit for non-touch device
inputtext: fix cannot input text with kindle dx physical keyboard
fontlightwidget: add non-touch support
datetimewidget: add non-touch support
datetimewidget: fix set date failed in kindle DX, fix datetimewidget month range to 1~23 by default
datetimewidget: make hour max value to 23
multiinputdialog: add non-touch support
checkbox: focusable and focus style
virtualkeyboard: no need to press two back to unfocus inputtext
virtualkeyboard: collect FocusManager event key names to let VirtualKeyboard disable them
openwithdialog: add non-touch support
inputdialog: can close via back button
enable all InputDialog and MultiInputDialog can be close by back
keyboardlayoutdialog: non-touch support
readertoc: non touch device can expand/collapse in toc
bookstatuswidget: non touch support
keyvaluepage: non-touch support
calendarview: non-touch support
2022-03-04 21:20:00 +01:00
zwim
eef4dc1c0d
Terminal: fix regression from #8845 (#8848)
This should fix a regression introduced with #8845 with reopening a running shell.

Adds more checks and more verbose logging messages on failures.
2022-02-27 12:16:22 +01:00
zwim
1cd396f9c4
Teminal: fix crash when grantpt or unlockpt fail (#8845)
* Fix crash when grantpt or unlockpt fail
* Disable plugin if grantpt or unlockpt fail
2022-02-26 18:16:36 +01:00
Frans de Jonge
67445beea5
[plugin] Terminal: remove stray space at end of string (#8831) 2022-02-20 16:34:32 +01:00
contrun
57188311da
kosync: send progress as a string to the server (#8758)
Currently the progress sent to the server can be either a string or an int (depending on whetther the document has pages).

The following are both payload sent from koreader to the server.

```
{"percentage":0.005,"device":"device_name","device_id":"B78EA04ACC3A453DBA220D720C0BE102","document":"348e34463a44ba68659fc6fe814a6778","progress":3}
```
where document `348e34463a44ba68659fc6fe814a6778` is a pdf file.

```
{"percentage":1,"device":"device_name","device_id":"B78EA04ACC3A453DBA220D720C0BE102","document":"4eb484b229696cb39cd8fe5495aa1bbe","progress":"\/body\/DocFragment[30]\/body\/p\/img.0"}
```
where document `4eb484b229696cb39cd8fe5495aa1bbe` is an epub file.

This may add extra work to the backend server. A few commits were added to my personal fork of [kosyncsrv](https://github.com/yeeac/kosyncsrv) (a kosync backend server). kosyncsrv initially tries to decode progress as a string. It then failed on document with pages (in which, progress is just integer page number). I then change the field's type, only to [revert it later](8a642e31a0).

I believe it is more appropriate for us to fix the progress type to string.
2022-02-20 16:08:56 +01:00
Frans de Jonge
8ff8a05ff3
[plugin] Terminal: move stray newlines outside of translated string (#8830) 2022-02-20 16:08:23 +01:00
Frans de Jonge
4d6a789f6d
[plugin] Terminal: fix @translators comments (#8829) 2022-02-20 16:07:57 +01:00
Scarlett
c3332f355f
NewsDownloader: add support for RDF feeds (#8822)
Fixes #8799.
2022-02-20 09:17:59 +01:00
hius07
8dbfead03d gestures: free long-press on FM home button 2022-02-19 22:04:12 +01:00
hius07
8bb08b503a
Cloud storage: enhance download dialog, fix Dropbox uploading (#8809)
(1) ButtonDialogTitle: new method setTitle()

(2) OPDSbrowser
-use setTitle() instead of open/close ButtonDialogTitle (no visual changes to the download dialog)
-reduce logger.info output to avoid flooding crash.log

(3) CloudStorage
-enhance download dialog (similar to OPDS), much optimized code of downloadFile
-fix a bug: cannot create new folder or upload files to the root of the Dropbox storage
2022-02-17 10:53:15 +01:00
hius07
c9fc9496aa
BookShortcuts: fix folders handling (#8795) 2022-02-15 12:04:07 +02:00
hius07
59f04ab018 ReaderProgress: insert TitleBar 2022-02-02 17:05:28 +01:00
hius07
77d3882eed CalendarView: remove close button! 2022-02-02 17:05:28 +01:00
hius07
605b09afbe CalendarView: remove unused CalendarTitle 2022-02-02 17:05:28 +01:00
Frans de Jonge
c2812c7956
[plugin] Update capitalization style "Terminal Emulator" → "Terminal emulator" (#8759) 2022-02-01 17:17:22 +01:00
poire-z
c627dfd63f ReaderStatistics: avoid self.kv leaking after close 2022-01-31 23:57:48 +01:00
poire-z
83172d62ae ReaderStatistics: reset stack/link on showing first widget
Reset self.kv stack/link on showing first widget.
This avoids return arrow to possibly show previously
displayed old and unrelated KeyValuePage.
Note: when closing a leaf KeyValuePage, the previous
one will leak as self.kv.
2022-01-31 23:57:48 +01:00
poire-z
67b17d0845 ReaderStatistics: allow reset statistics per period per book 2022-01-31 23:57:48 +01:00
poire-z
f764a61b69 KeyValuePage: allow for more fancy callbacks
Add support for hold_callback.
Provides kv_page and kv_item to callbacks.
Allow for item removal and refresh.
2022-01-31 23:57:48 +01:00