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

4717 Commits

Author SHA1 Message Date
poire-z
54eb2e1137
Quick start guide: fix links to images (#8072)
"../resources/..." was not working on some devices like
Android. Build the correct relative path on all devices.
2021-08-14 22:53:46 +02:00
poire-z
954ba9608e
Button: reduce font size to avoid truncation (#8078)
If the button text would be truncated, try to avoid
it by reducing the font size, and even switching to
a 2-lines TextBoxWidget.
TextBoxWidget: fix possible glyphs truncations when
a small line_height is used. Also avoid some bad
result from getFontSizeToFitHeight(), possible due
to some rounding errors.
2021-08-14 22:15:01 +02:00
hius07
ef1dea990e
Menu/GoTo: tweak go to page/letter dialog layout (#8056)
2 columns instead of 3, to get larger buttons and
avoid truncation with some translations.
2021-08-14 21:29:25 +02:00
hius07
3c597d1d84
FileSearcher: allow call with a search string (#8073) 2021-08-14 17:53:39 +02:00
hius07
fa4784cf13
Screenshoter: options to View and Delete after screenshot (#8050)
Also remove code duplication in ImageViewer.
2021-08-14 17:52:29 +02:00
hius07
c8a7f52672
Checkbutton: ensure max width, multiline if needed (#8066) 2021-08-14 00:49:19 +02:00
hius07
b622d6edd8
ReaderDeviceStatus: add high battery level alert (#8037) 2021-08-14 00:00:47 +02:00
Martín Fdez
6fb52528cd disable light settings on ChromeOS, android TV and e-ink devices without lights 2021-08-13 11:35:43 +02:00
Martín Fdez
8bf19a7327 flush settings before being killed 2021-08-13 11:35:43 +02:00
hius07
ace3f0ee16
ConfirmBox: new properties (#8065)
* keep_dialog_open, default to false.
Set to true to keep dialog open upon pressing any button, except Cancel and dismissable tap.

* other_buttons_first, default to false.
Set to true to put other buttons above Cancel - OK row
2021-08-13 00:45:10 +02:00
NiLuJe
f4cd12a48c
Merge pull request #8057 from NiLuJe/master
A bunch of tweaks & fixes
2021-08-11 22:06:25 +02:00
yparitcher
7148aed51c
ReaderStatus: end book action: delete file: go to current directory in FM (#8042)
Go to the directory of the deleted file, instead of the folder you happend to switch into the reader from as this may have changed (via changing books from history etc)
2021-08-11 09:54:44 +02:00
zwim
b3c4b8dc94
[fix, lang] SortWidget: make "go to page" string translateable (#8061) 2021-08-10 21:19:07 +02:00
Frans de Jonge
3f8d389ee4
[fix, lang] KeyValuePage: make "go to page" string translateable (#8059) 2021-08-10 21:18:38 +02:00
NiLuJe
1e9346aec6 Fix Wi-Fi toggle on the Elipsa
It turns out that the kernel needs a little push now that the dedicated
wifi power control module is gone ;).

Issue was only exposed if you booted KOReader while the Wi-Fi was down.
2021-08-09 02:33:07 +02:00
NiLuJe
bc133e70d3
Input: Minor simplifications around pen/finger discrimination & the snow protocol (#8021)
* Decode EV_KEY:KEY_BATTERY
* Input: Only drop hovering *pen* events.
  There are currently too many broken 0-pressure *finger* events being
  reported on the Elipsa, making a dumb rejection highly annoying.
* Bump base
https://github.com/koreader/koreader-base/pull/1393
* Rely on actual events to detect loss of contact for the "snow"
protocol.
  Allows simplifying the whole thing.
* Use `ipairs` over `pairs` for pure arrays.
2021-08-03 20:57:53 +02:00
Frans de Jonge
acfc5eec2b
[lang] Add a couple of plurals (#8028)
Reported by @ichnilatis-gr , see https://www.mobileread.com/forums/showthread.php?p=4140493#post4140493 and following.
2021-07-26 09:41:04 +02:00
hius07
e5f28a0f60
"Page turns" menu development (#8022)
Make "Taps and gestures - Page turns" available only in reader.
Move there other page turn related menu items from Navigation.
Remove duplicated code. Added standard "star" for default RTL.
2021-07-25 23:59:06 +02:00
Martín Fernández
990b6768f4
disable battery level on desktop Linux (#8026)
This also include ChromeOS laptops (chromebooks) since the power sysfs attributes don't exist in linux containers.
2021-07-25 23:29:30 +02:00
Evan Boehs
9bb6b70c7a
Check for update → Check for updates (#8027) 2021-07-25 21:04:13 +02:00
hius07
45d770b131
Activate menu: standardize to 2 checkboxes (#8017) 2021-07-23 17:19:36 +02:00
hius07
2a6931e72f
History: add confirmation before cleaning (#8016) 2021-07-23 17:14:25 +02:00
poire-z
5bab3e5e98
Fix luacheck after d9cc3af2 2021-07-23 15:54:12 +02:00
hius07
2ab31a9a36
File browser: Settings submenu reordering (#8000) 2021-07-23 15:47:02 +02:00
Brian Hughes
d9cc3af220
Reset everyone's duration time to classic (#8008)
Reset unwanted migration of this setting to "modern"
done with #7897.
2021-07-23 14:16:41 +02:00
yparitcher
dc59391632
Dispatcher: use UIManager:sendEvent instead of the current instance (#7999)
This fixes inheritance issues when changing documents.
Also allow "Go to page" in FM.
2021-07-23 13:27:12 +02:00
Galunid
e7fa044807
Remove zsync plugin (#7957) 2021-07-22 09:01:57 +02:00
poire-z
7b90305570
PDF written highlights: trash cached tiles on close (#8002)
Small followup to e3bac94d.
2021-07-21 22:28:34 +02:00
NiLuJe
817e9e26e8
Minor input tweak after #7986 (#8004) 2021-07-21 22:20:08 +02:00
NiLuJe
ae35e898fb
Kobo Elipsa support (#7986)
Includes a few minor cleanups along the way ;).
2021-07-21 18:12:58 +02:00
poire-z
b31b7728db
Quick start guide: revamp text and look (#7985)
By @offset-torque, extracts from his upcoming user manual.
See https://github.com/koreader/koreader/discussions/7898
2021-07-20 17:22:45 +02:00
poire-z
e3bac94db1 PDF written highlights: fix boxes, trash cached tiles
TileCacheItem: add created_ts property.
Document: manage a tile_cache_validity_ts and ignore
older cached tiles.
This timestamps is updated when highlights are written
as annotations in, or deleted from, the PDF, so we can
get the most current rendered bitmap from MuPDF and
avoid highlight ghosts on old tiles.
Save this timestamp in doc settings so older cached to
disk tiles will also be ignored across re-openings.
Bump base for: mupdf.lua: update frontend pboxes with
MuPDF adjusted ones.
2021-07-20 15:19:59 +02:00
poire-z
eeb09d2150 PDF text selection: fix/tweak spacing between words/boxes
We may get multiple boxes when selecting texts, one for each
word, and we have to add spaces between the extracted words
ourselves. Previously, we were only adding a space if the
last char of previous word was ASCII, so missing spaces
after accents or greek words.
Try to do better by measuring the distances between boxes
and comparing to box heights, with a few heuristics.
2021-07-20 15:19:59 +02:00
zwim
48d1b23469
FileSearcher honor filemanagers sorting order (#7978) 2021-07-18 20:21:39 +02:00
yparitcher
120eaf9193
secondsToHClock(): always floor seconds for consistency (#7987)
Fixes: #7984
2021-07-18 20:18:56 +02:00
poire-z
16ab5aa194 SDL keyboard input: should go to top level widget only
Avoid the typed input to be added to all
InputText present on the stack: only the
top one should handle it.
2021-07-15 23:18:47 +02:00
hius07
41f2a6f8a4
InputText: fix search on multi-bytes UTF-8 (#7981)
Also fix crashes when text is invalid UTF-8.
2021-07-15 21:57:12 +02:00
zwim
9d2c6b07aa
Fix date in onetime_migration (#7980)
Fixes #7979
2021-07-15 17:52:23 +02:00
hius07
7eea2ae7cd
InputText/InputDialog: add case sensitive search (#7966) 2021-07-15 16:28:54 +02:00
NiLuJe
72fbdf7fd4
ReaderZooming tweaks (#7968)
* ReaderZooming tweaks

Re #7964 & #7962

* Fix oversight in setNumberOf

Co-authored-by: yparitcher <y@paritcher.com>
2021-07-15 15:34:13 +02:00
zwim
ab6867c8fa
FileManager: allow case sensitive file search (#7956)
Bump base for cre.cpp cleanup and utf8proc FFI.
Add a checkbutton for case sensitive search in FileBrowser,
and use Utf8Proc.lowercase() for case insensitive search.
Also use it in ReaderUserHyph as a replacement for
crengine getLowercasedWord().
2021-07-15 12:53:28 +02:00
zwim
26cc3df5c5
ReaderSearch: fix wait button position, code cleanup (#7973) 2021-07-15 11:51:10 +02:00
hius07
5947085ba4
InputText: up/down arrows move cursor to start/end of line (#7976)
when already on the first or last line.
2021-07-15 10:27:21 +02:00
ichnilatis-gr
4b7ac191dc
Greek keyboard: translate Space key (#7974) 2021-07-15 10:26:25 +02:00
Frans de Jonge
86a1552ccd
Fix wrong escape (#7952)
;-)

Assuming you want it to show up as `'\'`, anyway.
2021-07-10 19:03:12 +02:00
poire-z
ca91df1f87
CheckButton: fix hold when in a movable container (#7948) 2021-07-10 12:31:55 +02:00
Frans de Jonge
f411035d7d
[plugin] Remove GoodReads plugin (#7943)
Deprecated half a year ago in <https://github.com/koreader/koreader/pull/7101>.

Any potential remaining users whose API key hasn't yet automatically expired through inactivity can copy it over from an older release if desired.

Discussed in <https://github.com/koreader/koreader/discussions/7898#discussioncomment-976475>.
2021-07-10 09:24:07 +02:00
zwim
4d9d599a6a
CRe: fix issues with case sensitive and regex search (#7947)
Fix crash with previous commit.
Show regex checkbox only with cre documents.
2021-07-08 23:30:37 +02:00
zwim
826a765705
CRe: support for case sensitive and regex search (#7883)
- bump crengine: findText(): add support for regular
  expression search.
- bump base: add thirdparty/srell/srell.hpp, a C++ library
  that provides Unicode regex support, used by crengine.
- ReaderSearch: with credocuments, add checkboxes for case
  sensitive and regular expression search.
2021-07-08 19:30:16 +02:00
NiLuJe
0e60625160
Screensaver: Fix an old w/h typo (#7941)
Fix #7938, exposed by #7929
2021-07-07 19:07:36 +02:00
hius07
f711f060bf
A few small design fixes (#7933)
Reduce CheckButton font size.
Remove icons in TouchMenu truncated items popup.
Fix some wording.
2021-07-05 12:38:24 +02:00
poire-z
a1d64de9b5
Font contrast: fix value in notification (#7934)
Fixes small issue noticed at https://github.com/koreader/koreader/discussions/7898#discussioncomment-962282
2021-07-05 11:03:27 +02:00
hius07
897622d4bb
CRe: reset call cache on rendering change (#7927)
This fixes some values sometimes not updated in footer.
2021-07-05 10:03:14 +02:00
NiLuJe
ed5a9294a4
ScreenSaver: Saner close behavior (#7929)
Should fix #7643
2021-07-05 04:56:14 +02:00
yparitcher
b07414c2b5 make sure ReaderLink gets a deep copy of location
Fixes: #7922
2021-07-04 21:45:19 -04:00
patart
246b402d9c
Add another mimetype alias for FB2 files for OPDS (#7932)
I've encountered an issue when Calibre Content Server's OPDS feed produced ``text/fb2-xml`` mimetype. Don't know if it is actually Calibre to blame, but thought this simple fix will save some poor souls' time.
2021-07-04 22:03:20 +02:00
jimman2003
a7bbf24f87
Greek keyboard: tweak popup keys (#7930)
By @ichnilatis-gr
2021-07-03 20:57:39 +02:00
poire-z
c0386e5dd0
Greek keyboard: add more diacritics (polytonic) (#7906)
Provided by @ichnilatis-gr
2021-06-30 20:47:41 +02:00
Frans de Jonge
58a5a09574
Device status: fix ellipsis (#7910) 2021-06-30 20:46:13 +02:00
hius07
8146bbf13b
KeyboardLayoutDialog movable (#7911) 2021-06-30 15:54:24 +02:00
Brian Hughes
ba65dc155b
Adds time left for chapter and document to the screensaver message options (#7897) 2021-06-30 01:45:34 +02:00
hius07
6c35e01acb
InputDialog: manage keyboard hiding (#7908)
Disable keyboard hiding with Tap in some cases.
2021-06-29 21:42:18 +02:00
poire-z
859c68d3f9 Menu: fix item sizes when switching display modes 2021-06-29 21:37:05 +02:00
poire-z
d57296b6bc Device status: fix crash in debug mode 2021-06-29 21:37:05 +02:00
NiLuJe
11b50d51ae
Device status: fix wording (#7907) 2021-06-29 21:36:43 +02:00
hius07
c4f4190ad4
ReaderFooter settings menu: keep upper menu page (#7903) 2021-06-29 14:10:21 +02:00
hius07
884c664f63
Device status alarm: battery and memory (#7857)
Move former low battery alarm into a device status
alarm menu, and add high memory usage checks.
2021-06-29 14:07:29 +02:00
hius07
eb41ad3bda
FileManager: add overwrite check for Rename (#7833)
Checks for existing destination file/folder for Rename operation
and asks to overwrite.
2021-06-29 14:01:44 +02:00
hius07
5e2d83965b
InputDialog, InputText: a bunch of updates (#7896)
- New way to hide the VirtualKeyboard: to hide the keyboard
  tap any point of the screen outside the inputbox and above
  the keyboard; to show the keyboard tap the inputbox.
  (Removed hacky "holding the arrow-down key" which is no
  longer needed).
- InputDialog windows are movable/translucent by default
- Redesign of the Clipboard dialog
2021-06-29 11:01:12 +02:00
hius07
db60ba48b7
OPDS catalog, Cloud storage: hold return arrow to go to top (#7845) 2021-06-29 10:22:03 +02:00
hius07
2d764d47b8
InputText: fix typo (#7880) 2021-06-23 17:19:39 +02:00
hius07
c6ccc73d55
Status bar: hide battery if level higher than threshold (#7876)
closes #7242
2021-06-22 19:03:05 +02:00
Frans de Jonge
12ebffc669
ReaderPaging: show page overlap menu in reflow (#7820)
Cf. <https://www.mobileread.com/forums/showthread.php?t=339912>.

I'll have to check why this doesn't work in continuous. Cf. https://github.com/koreader/koreader/issues/3932#issuecomment-395354006
2021-06-21 18:53:44 +02:00
hius07
61d24879d3
Translator: copy translation input to the clipboard (#7855) 2021-06-21 18:50:49 +02:00
Jason Benwell
682f7561a0
Use smaller symbols for pages_left_book in compact_items (#7828)
Use the (smaller) "‹" or "›" symbols in pages_left_book, to match pages_left, in compact_items
2021-06-21 18:48:33 +02:00
Martín Fernández
ee92ca68e8
workaround for Onyx Poke2 nonsense (#7872)
Requires koreader/android-luajit-launcher#320

Also the luajit-launcher bump adds support for Likebook P78 and sanitizes clipboard text.
2021-06-20 15:42:00 +02:00
NiLuJe
e7f7ac9547 Menu: Also avoid calling input handlers on unpainted widgets
Fix #7869
2021-06-20 04:21:56 +02:00
NiLuJe
240a4acdcc TouchMenu: Abort early if tap/hold handlers are called on an unpainted
widget

May happen if we have blocking stuff on startup (e.g., Wi-Fi), and you
spam tap the screen during the white screen.
2021-06-20 04:21:56 +02:00
NiLuJe
d2db93431a DictQuickLookup: Fix stupid thinko in #7432
Fix #7864
2021-06-18 18:02:15 +02:00
NiLuJe
62fd154629 DocCache: Log the effective cache size 2021-06-18 18:02:15 +02:00
NiLuJe
e4a333a980 KOptInterface: Keep returning nil in get*Boxes when we don't actually
get any boxes

Exposed by #7624, but we were arguably putting garbage in the Cache
before that anyway, so, it w<asn't all that great either ;p.

Fix #7850
2021-06-16 13:53:17 +02:00
NiLuJe
a4dc7375f1 Util: Always sanitize filenames on Android
Fix #7837
2021-06-16 13:53:17 +02:00
NiLuJe
6b31b160a2
CloudStorage: Log download failures (#7834)
Re #7354
2021-06-12 21:11:53 +02:00
yparitcher
002b4d4be9 Kopt/Creoptions: change to using an event to update configurable. Abstract implimentation out of ConfigDialog 2021-06-11 13:26:48 +02:00
yparitcher
0577f57617 TouchMenu: open to items page when going up a level
Builds on #7490
2021-06-11 13:26:48 +02:00
yparitcher
729388df81 Dispatcher: indentation 2021-06-11 13:26:48 +02:00
yparitcher
225f9aeccb Cleanup for #7626 2021-06-11 13:26:48 +02:00
NiLuJe
1b852d1842
util.findFiles: Don't die on broken symlinks (#7829) 2021-06-11 13:25:53 +02:00
NiLuJe
ba070c24de ReaderFooter: Add a chapter_progress widget
(i.e., in-chapter num / total).

Fix #7792
2021-06-08 03:27:45 +02:00
NiLuJe
0d1325cc83 ReaderFooter: Make pages_left_book use an actual prefix icon
Instead of baking in a hyphen, so as to avoid signed zeroes, or
confusion with page progress if page maps are enabled.

Also, made compact itemps RTL friendly.
2021-06-08 03:27:45 +02:00
Martín Fernández
9f097da4f0
Bump android backend (#7813)
* Bumps the target Sdk to Android 11 (API30)
* Add a crash handler
2021-06-07 17:13:34 +02:00
hius07
d8ea93662f
NumberPicker: correct max day in input dialog (#7803) 2021-06-05 20:58:10 +02:00
hius07
0d161272fc
Menu/ToC: harmonize font sizes (#7795)
Menu: display the right item ("mandatory") with a
smaller font size related to the left item font size,
instead of a function of perpage.
ToC popups: use same font size as in ToC.
2021-06-05 00:55:20 +02:00
hius07
2fe8c3c41b
"Book description": more consistent wording (#7789) 2021-06-04 18:47:29 +02:00
NiLuJe
0b58abada5
[fix] ReaderZooming: Deal with some more zoom_mode shenanigans (#7780)
Migrate *global* zoom_mode settings to genus/type, too.

Nothing can actually set this as a global anymore, but we still honored
it nonetheless.

Fix #7778
2021-06-01 12:08:12 +02:00
NiLuJe
8d37d49d70 CSS Tweaks: Update Alt ToC description, now that it moved to a dedicated
menu entry.
2021-06-01 12:07:36 +02:00
NiLuJe
df77819dc2 Menu: Allow translating the "Go to" input hint 2021-06-01 12:07:36 +02:00
zwim
594b4c9035
Add option for custom hyphenation rules (#7787)
This is the successor of #7746.
2021-06-01 12:06:55 +02:00
Frans de Jonge
039947886f
Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785)
This reverts commit f25da5d0d5.
2021-05-31 22:19:24 +02:00
hius07
ecafdbfed8
KeyValuePage: use items font size in child TextViewer (#7782) 2021-05-31 21:50:44 +02:00
hius07
2df54251a7
ReaderHighlight: close popup menu on 'Copy' (#7776) 2021-05-31 20:36:12 +02:00
zwim
f25da5d0d5
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
2021-05-31 20:34:26 +02:00
yparitcher
b30e366ccd
ReaderLink: option to add location to stack on opening book (#7685) 2021-05-31 20:28:43 +02:00
hius07
4973134fb6
VirtualKeyboard: Allow hiding the keyboard with a hold on the down arrow key (#7751)
(And showing it again with a tap on an input field)
2021-05-30 01:02:07 +02:00
NiLuJe
d2ad6a83e1 ReaderTypeset: Minor reword after #7759
c.f., https://github.com/koreader/koreader/pull/7759#discussion_r638929468
2021-05-29 22:36:34 +02:00
NiLuJe
1ded7c3907 PocketBook: Support the PB741
Re: https://github.com/koreader/koreader/issues/7747#issuecomment-846850605
2021-05-29 22:36:34 +02:00
NiLuJe
92afc63951 PocketBook: Deal with FW shenanigans on the PB627
Might break it on older FW, who knows.

Fix #7747
2021-05-29 22:36:34 +02:00
NiLuJe
5a468b8cf2 VirtualKeyBoard: Handle UX fallouts of VirtualKeyPopup overflow.
Don't close the popup on the first hold_release, ensuring it won't
immediately close on a *different* key if the finger hasn't moved.

If the finger *did* move, that's a quick swipe, and that's unaffected by
this tweak.
2021-05-29 22:36:34 +02:00
Frans de Jonge
1054137641
[lang] Improve "set to" consistency (#7773)
Also remove a double space pointed out by @NiLuJe.
2021-05-29 12:40:25 +02:00
Martín Fernández
b8d658b922
android: minor fixes (#7753)
* Save settings before installing a new APK & after resume. 
* Move Resume/Suspend events to Resume/Pause callbacks
2021-05-26 22:26:43 +02:00
Martín Fernández
dc0d759148
don't log thirdparty app list if they're platform defaults (#7760) 2021-05-25 22:26:36 +02:00
zwim
203e434a51
[lang] Slightly reword some notification sentences (#7759) 2021-05-25 15:24:04 +02:00
NiLuJe
ad3bc29b1e
Events: Never stop propagating CloseWidget (#7744)
That seems like a rather terrible idea to beign with, and that that may actually have fatal consequences.

Re #7738

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-05-24 22:54:58 +02:00
NiLuJe
887138f57f
ReaderDictionary: Handle all dictionaries being disabled better. (#7737)
By showing a warning, instead of not passing any -u flag to sdcv and letting it query *all* dictionaries if FS order...

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-05-24 22:48:15 +02:00
NiLuJe
2067a16fa1
ReaderZooming: Unconditionally update the configurables on SetZoomMode (#7735)
Expand #7728 to also catch SetZoomMode (mostly for Dispatcher's sake, but other things also send it).
2021-05-23 19:01:09 +02:00
zwim
e955a28796
Uppercase sharp s (#7741) 2021-05-23 12:36:28 +02:00
Martín Fernández
fdb0539aae
Bug report changes (#7709)
* android: dump logcat to file
* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-05-23 01:20:13 +02:00
zwim
8315ee1c7e
Notifications menu: remove "No notifications" (#7736)
Implemented when all other menu items are unchecked.
2021-05-22 23:47:55 +02:00
hius07
7419820c09
VirtualKeyboard: hold left/right arrows moves to start/end of line (#7730) 2021-05-22 23:25:14 +02:00
NiLuJe
dac6fb4008
Notifications: Sort the settings appropriately in the FM (#7734)
Otherwise it's flagged as orphaned ;).

(Also tweak indenting of said settings to be more in line with how we
usually do these).

Overlooked in #7718
2021-05-22 20:45:06 +02:00
NiLuJe
bee2a605f1
ReaderStatus: Don't crash in EndOfDocument actions that *immediately* destroy the ReaderUI instance. (#7733)
This is handled in an Event handler, but we have zero guarantee that
we're actually the *final* Event sent to the Document, and other Events
usually kinda need the Document instance to still be alive ;).

Delay action until the next tick to avoid potential crashes.
2021-05-22 04:46:41 +02:00
NiLuJe
c05b1a4ee4
ReaderZooming: Deal with some more fallout of the new zoom modes (#7728)
* Namely, ensure zoom_mode is consistent with genus & type *both ways*. (I only dealt with the "no zoom_mode" case in my original fixup).
Because documents with settings dating back from before the new zoom modes had "old" zoom_mode settings mixed with "new" genus/type defaults that didn't agree with each other.
It lead to super-confusing ConfigDialog behavior, because ConfigDialog was in fact not reflecting the reality.
(As the source of truth is actually `zoom_mode`).

* There was a snafu in manual mode, because of the extremely weird way prefixes are handled by Configurable/ReaderConfig/DocSettings/ConfigDialog.
So, make sure we only have a *single* zoom_factor, and that it's updated and saved properly under the right name everywhere.

Fixes inconsistencies between first swapping to manual mode, and what the ConfigDialog said/did (because again: possibly a lie), vs., re-opening the same document, which would magically use *different* settings, closer to what was expected (but still broken because of the prefix mismatch and a disagreement on defaults between the two variants).

Fallout from #6885
2021-05-22 03:28:52 +02:00
hius07
fdb69e0eee
InputText: show clipboard dialog on long-press (#7719) 2021-05-21 21:51:30 +02:00
NiLuJe
0e83551e8d History: Don't flash when swapping documents
(i.e., when History is spawned from ReaderUI, delay the flash until we
*show* the next widget, instead of when we close the current RD
instance).

Prevents flashing the InfoMessage.
2021-05-21 01:58:00 +02:00
NiLuJe
2c4cbd12a2 DocumentRegistry: Downgrade refcount warnings to debug logging.
It can happen in perfectly sane contexts.

CReDocument: Don't destroy internal engine data when Document just
decreased the refcount (as opposed to actually tore down the document
userdata if it were the last ref).

PdfDocument: Only write edited documents if the Doc instance was torn
down.

PicDocument: Silence some DocumentRegistry related warnings
2021-05-21 01:58:00 +02:00
poire-z
7dea979ef4 ReaderHighlight: fix long-long-press regression 2021-05-21 00:57:50 +02:00
poire-z
26750dab99 ReaderHighlight: clearer symbols on selection start/end buttons 2021-05-21 00:57:50 +02:00
zwim
6e2be98edc
Notifications: options to show none/some/more (#7718)
Notification: adds some functions so it can be used as
a notification manager.
Have various bits of code emitting events that may generate
notifications advertize themselves as the source for following
notifications.
Add a menu to allow selecting some subsets of sources
to show or hide.
2021-05-20 23:14:11 +02:00
zwim
78fdce8e9f
Dispatcher: fix possible crash when no document (#7716) 2021-05-20 19:23:34 +02:00
Frans de Jonge
6e1950676a
[lang] Fix minor inconsistency (#7714)
It should be "Not found." as in "Find next".
2021-05-20 09:31:39 +02:00
poire-z
4b6b12b799 Remove unused "pan_delayed_interval" support 2021-05-19 23:55:07 +02:00
poire-z
d0165f8bd1 Fix scrolling, add inertial scroll on non-eInk devices
Add a new reader module: ReaderScrolling, that exposes
some Scrolling options to the menu (which are to be used
by and implemented in ReaderPaging and ReaderRolling
themselves) and implement some inertial scrolling logic
used by both of them.
Default to "Classic scrolling" which is the expected
behaviour on phones and tablets.
The old CreDocument buggy behaviour is available as
"Turbo scrolling" for both Paging and Rolling documents.
Added a "On release scrolling" option that might be
useful on eInk to avoid dynamic pan/scrolling.

Try to avoid bad interactions between pan and swipe,
cancelling unwanted panning if we ended up doing a
swipe or multiswipe.
2021-05-19 23:55:07 +02:00
poire-z
e4fd45ef08 Pan zoom mode: update footer when panning in a same page 2021-05-19 23:55:07 +02:00
poire-z
0a3978f60b Reader: remove full refresh on vertical swipes
Small diagonal swipes is what can be used for
full refrehes. Tweak a bit how it is done.
2021-05-19 23:55:07 +02:00
poire-z
33744217de Chapter navigation: fix possible crash in scroll mode
Update self.current_page on each pos change,
so getPreviousChapter() and al. have something
to work with.
2021-05-19 23:55:07 +02:00
poire-z
001d48f6cc Fix a few possible crashes
- TextWidget: avoid crash with small max_width (could happen
  when opening menu on a small emulator window)
- TextWidget: avoid crash if re-used after :free()
- ReaderHighlight:clear(): fix possible crash when
  scheduled and run after document closed
- DictQuickLookup: minor canSearch() tweak ('selected_text'
  is normally available only on multiple words selection,
  but is currently available on single word selection thanks
  to some unrelated side effect)
2021-05-19 23:55:07 +02:00
zwim
067ece7281
Fix changeFontSize after added granularity (#7689)
Whith the new font size step of 0.5 (46a2d9c), the gesture
for increasing or decreasing font size would change the
size by only half of the given value.
2021-05-19 21:21:23 +02:00
NiLuJe
7c7f9e6ebb Truly silence the attempt at loading SDL2
Expanding on https://github.com/koreader/koreader/pull/7682
ffi/input, loaded by the Device singleton, also needs to know that in
order to setup the proper input backend for SDL2.

Requires https://github.com/koreader/koreader-base/pull/1372 because
that's where the machinery for those checks live.
2021-05-19 20:55:00 +02:00
NiLuJe
d56a944b79 Tests: Handle FM/ReaderUI instances slightly more sanely
* Tear down FM instances properly
* Don't manhandle ReaderUI too much, and document when the tests do
  actively broken shit, like bypassing safeties to open two // ReaderUI
  instances.
2021-05-19 20:55:00 +02:00
NiLuJe
90c38e2d0d ReadHistory: nil guard a Document instance access
We're now more careful about this, so, I suppose weird timings may mean
we might be trying to access a nil here.

Fix #7706

Guard a few other similar constructs
2021-05-19 20:55:00 +02:00
NiLuJe
6dc1c1efca Unbreak ReaderFooter test
Tests: Update the ffi.metatype wrapper

(Better idea: move to busted master).
2021-05-19 20:55:00 +02:00
NiLuJe
189035cafc ReaderFooter: Get rid of magic nil settings
And go through one-time-migration to ensure the settings are properly
filled.

Also, disable hold-to-skim by default.
2021-05-19 20:55:00 +02:00
NiLuJe
99ee3763c1 USBMS: Close all widgets before quitting
FFI finalizers can fire in unspecified orders, but for MuPDF,
we need to ensure that the context is the *very* last thing that get
destroyed.
As such, we need to make sure we close open documents properly on our
end, first.

This prevents potential crashes while switchign to USBMS inside an open
document handled by MuPDF.

Fix #7428
2021-05-19 20:55:00 +02:00
NiLuJe
8d3aacbac3 ReaderFooter: Fix the madness related to its hold footer
Namely, instead of making it lower priority than readerhighlight and
hoping for the best, make it higher priority, as it should (ReaderFooter
itself is *above* Reader, after all), with a sane set of fallthroughs:

* No footer
* No hold-to-skim
* Held outside the footer (but inside the footer tap zone)

This made the crap workaround from #7466 unnecessary, and actually fixes
the behavior in PDFs (because readerhighlight will match the *physical*
page, which may include off-screen content) and ePubs w/r eclaim bar
height (in which case, there's actual content behind the footer that
readerhighlight could have matched on).

Fix #7697
2021-05-19 20:55:00 +02:00
NiLuJe
056eeef747 ReaderPaging: Unbreak flipping mode's double taps
As discussed in #7646, regression since #6322
2021-05-19 20:55:00 +02:00
NiLuJe
94f708b53b BookInfoManager: Actually close the document after extraction
DocumentRegistry just decreases a ref, it doesn't close anything.

Plug the same Document leak in a few other places, and document this.
2021-05-19 20:55:00 +02:00
hius07
e70bc60f0f
Inputtext: don't allow the cursor to move within a hint (#7687)
Same as 17e6049e but for "hold".
2021-05-19 19:09:22 +02:00
zwim
6cb2ba65cd
CRe: draw progress bar under alt status bar (#7667) 2021-05-19 18:14:14 +02:00
hius07
f3fe643d81
InputDialog: add search (#7701)
Searches for a string in the edited text.
Available in the Text editor and other input dialogs with the navigation bar enabled.

Find first searches from the beginning of the text.
Find next searches from the next to cursor position, used for continious search.
By now, the Search input window is closed after the search. You need to press the Find button again for continious search, the search string is kept in the input.
Is it better to keep the dialog open for the comfortable continious search? And close it with the Cancel only?

Case insensitive. Cursor jumps to the beginning of the found string.
Notifications are shown for better results visibility.

Unfortunately, violated our standartization to "search", couldn't invent better short wordings.
2021-05-19 18:05:16 +02:00
NiLuJe
ba00f3879d
ReaderHighlight: nil guard a few self.hold_pos accesses (#7700)
Fix #7698

That only leaves a single unguarded access in onUnhighlight
2021-05-16 19:54:46 +02:00
Martín Fdez
ffd5b88c87 warn before downgrading APK. Prompt for download in the browser to get a notification 2021-05-16 16:55:50 +02:00
Martín Fdez
23b7bfe0ce move android specific bits outside OTAManager 2021-05-16 16:55:50 +02:00
NiLuJe
4b265bcd7a Allow ingoring the B288 feature bans, for debugging purposes. 2021-05-16 12:47:38 +02:00
NiLuJe
f413cd15e8 PB: Unconditionally disable HW rotation on B288 SoCs
Apparently, it's even more broken than usual on some devices/FW combos.

Fix #7663
2021-05-16 12:47:38 +02:00
Frans de Jonge
529c681851
CloudStorage: log error (#7694)
References <https://github.com/koreader/koreader/issues/7688>.
2021-05-16 12:46:26 +02:00
hius07
834feef8cd
InputDialog: add 'Go to line' button (#7673) 2021-05-16 12:45:36 +02:00
NiLuJe
e6027313e9 ConfigDialog: Gesture range needs to be a Geom
Regression since #7664
Fix #7681
2021-05-14 18:50:53 +02:00
NiLuJe
628aef2099 OTA: Unbreak exit code on Install
Regression since #7657
2021-05-14 18:50:53 +02:00
Martín Fernández
c1892d2619
[chore] Move SDL check to the end of Device's probe function (#7682)
To avoid a few log lines on all platforms:

```
ffi.load: SDL2
ffi.load (warning): libSDL2.so: cannot open shared object file: No such file or directory
ffi.load: libSDL2-2.0.so
ffi.load (warning): libSDL2-2.0.so: cannot open shared object file: No such file or directory
ffi.load: libSDL2-2.0.so.0
ffi.load (warning): libSDL2-2.0.so.0: cannot open shared object file: No such file or directory
```
2021-05-14 13:31:24 +02:00
Frans de Jonge
feec47d982
[doc] Documentation stub for Dbg module (#7677)
Cf. <https://github.com/koreader/koreader/pull/7664#discussion_r631858784>.
2021-05-13 18:13:58 +02:00
Frans de Jonge
11a22254d6
[doc] Fix random typo (#7676) 2021-05-13 17:57:48 +02:00
NiLuJe
bb65a69193
Geom: nil guard a few rect methods (#7664)
We've managed to trip a few of those on dimen fields post-init but
pre-paintTo in a few weird coner-cases, a point at which dimen is often
nil.

ConfigDialog: Deal with that very thing in update()

Fix #7656
2021-05-13 13:05:05 +02:00
poire-z
f0ecbeb1d5
ReaderToc: option to show a dotted line (#7669)
A dotted line joining the ToC entry text to the
page number may make it easier to use.
(This replaces the menu item separator from d879062e.)
Also fix baselines aligment, which could be a bit off.
2021-05-13 01:55:35 +02:00
zwim
a20cac6904
[chore] Remove dead code (#7665) 2021-05-12 16:47:16 +02:00
NiLuJe
de6f2e84a3
FileManager/ReaderUI: Clarify the current instance accessor (#7658)
* FileManager/ReaderUI: Clarify the current instance accessor

Make it clearer that we actually store it in a *module/class* member, not an *instance* member.

Also, warn if there's a close/open mismatch.
2021-05-11 00:49:35 +02:00
Martín Fernández
939fcf7f0e
android: avoid downloading the APK again if there's one download in progress + fix signature error (#7657) 2021-05-10 20:36:22 +02:00
Hzj_jie
1a08f2cb69
Plugins: adds PluginMenuInserter helper (#7419)
Allows user-plugins to register themselves
into "More tools" menu.
2021-05-10 12:46:55 +02:00
zwim
d082f795e6
Dispatcher: some formatting cleanup, rewording and re-ordering 2021-05-10 12:44:55 +02:00
NiLuJe
1ffbd8760d KOPTInterface: Minor optimization when hashing the configurable status
Use a table & table.concat instead of individual concats.
And then use that same table for every hash-related operation.

(Nothing else uses the configurable hash function, otherwise I'd have
limited the table shenanigans to the function itself).
2021-05-09 23:10:44 +02:00
NiLuJe
48c474e245 Device: Add some more logging in onPowerEvent
Could possibly help shed some light on potential SleepCover races...
re #7633
2021-05-09 23:10:44 +02:00
NiLuJe
2635593890 Cache: Some more tweaks after #7624
* Allow doing away with CacheItem
  Now that we have working FFI finalizers on BBs, it's mostly useless overhead.
  We only keep it for DocCache, because it's slightly larger, and memory pressure might put us in a do or die situation where waiting for the GC might mean an OOM kill.
* Expose's LRU slot-only mode
  And use it for CatalogCache, which doesn't care about storage space
* Make GlyphCache slots only (storage space is insignificant here, it was
  always going to be evicted by running out of slots).
* More informative warning when we chop the cache in half
2021-05-09 23:10:44 +02:00
NiLuJe
05806abeaa CreDocument Call Cache: Minor modernization tweaks
* Neuter timekeeping when statistics are disabled
  Saves a few syscalls ;).
* Port to ffi/lru
  Only a tiny bit of it actually requires any sort of LRU logic, so it's fairly painless.
* Release the cache on close
* Use string.buffer to serialize function arguments
  Ought to be faster than the custom approach ;).
  (Still requires wrapping them in a table, though).
  It's much less human-readable, but then again, this doesn't need to be :).
2021-05-09 23:10:44 +02:00
NiLuJe
ed0aa1ed11 ReaderUI: Ensure we flash when opening a document
Regression since #7624
2021-05-09 23:10:44 +02:00
Frans de Jonge
310151fac9
Fix typo (#7655)
Follow-up to #7632.
2021-05-09 09:17:20 +02:00
Martín Fernández
d303fdf694
android: Prompt for install updates when they're downloaded (#7632) 2021-05-08 23:02:35 +02:00
hius07
3d713dc34c
Dictionary: disable 'Clean history' when the history is empty (#7636) 2021-05-06 17:28:54 +02:00
hius07
c129354ca3
Wikipedia: disable 'Clean history' when the history is empty (#7637) 2021-05-06 17:27:39 +02:00
mergen3107
2c1cae64b6
Remove notification on font change (#7589)
Should reduce refreshes competition and avoid glitches.
2021-05-06 01:11:29 +02:00
zwim
46a2d9c145
Dispatcher: Make font size actions consistent with ConfigDialog's NumberPicker (#7626) 2021-05-05 20:48:42 +02:00
Kevin Reuning
1cefd27946
DropboxAPI: Handle pagination (#7621)
Fix #7600 

Co-authored-by: NiLuJe <ninuje@gmail.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-05-05 20:44:44 +02:00
hius07
752ec49c6f
FM: Make "Refresh content" an actual Event/Gesture (#7592)
* And enable it by default in the FM as the "hold on top-right corner" Gesture, instead of the onHold handler of the "+" button.
2021-05-05 20:43:43 +02:00
zwim
3d9ed32458
Android: Send Suspend/Resume Events on STOP/START (#7630)
* ReaderHeader: Refresh it *now* on Resume, instead of just re-scheduling an update if auto-refresh is enabled..
2021-05-05 20:41:14 +02:00
NiLuJe
06a273b48d Port ffiUtil.getTimestamp users to TimeVal:now()
They were all using it to compute durations,
something which is going to be more sensible
from a monotonic clock source.
2021-05-05 20:37:33 +02:00
NiLuJe
21b067792d Cache: Rewrite based on lua-lru
Ought to be faster than our naive array-based approach.
Especially for the glyph cache, which has a solid amount of elements,
and is mostly cache hits.
(There are few things worse for performance in Lua than
table.remove @ !tail and table.insert @ !tail, which this was full of :/).

DocCache: New module that's now an actual Cache instance instead of a
weird hack. Replaces "Cache" (the instance) as used across Document &
co.
Only Cache instance with on-disk persistence.

ImageCache: Update to new Cache.

GlyphCache: Update to new Cache.
Also, actually free glyph bbs on eviction.
2021-05-05 20:37:33 +02:00
NiLuJe
ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
2021-05-05 20:37:33 +02:00
NiLuJe
e7acec1526 ReaderUI: Saner FM/RD lifecycle
* Ensure that going from one to the other tears down the former and
    its plugins before instantiating the latter and its plugins.

UIManager: Unify Event sending & broadcasting
  * Make the two behave the same way (walk the widget stack from top to
    bottom), and properly handle the window stack shrinking shrinking
    *and* growing.
    Previously, broadcasting happened bottom-to-top and didn't really
    handle the list shrinking/growing, while sending only handled the list
    shrinking by a single element, and hopefully that element being the one
    the event was just sent to.

These two items combined allowed us to optimize suboptimal
refresh behavior with Menu and other Menu classes when
opening/closing a document.
e.g., the "opening document" Notification is now properly regional,
and the "open last doc" option no longer flashes like a crazy person
anymore.

Plugins: Allow optimizing Menu refresh with custom menus, too.

Requires moving Menu's close_callback *after* onMenuSelect, which, eh,
probably makes sense, and is probably harmless in the grand scheme of
things.
2021-05-05 20:37:33 +02:00
NiLuJe
b24ecf35d4 CreOptions: Display weight classes names, in addition to their raw value. 2021-04-30 06:02:09 +02:00
NiLuJe
56d7a2d86b CreOptions: Minor wording tweak after #7616
c.f., https://github.com/koreader/koreader/pull/7616#discussion_r622732969
2021-04-30 06:02:09 +02:00
NiLuJe
9f835156d1
PluginLoader: Allow querying whether a specific plugin is loaded (#7607)
* PluginLoader: Allow querying whether a specific plugin is loaded (instantiated, actually).

Re #7598

* PluginLoader: Add a method to access a specific Plugin's instance
(Besides `self.ui[plugin_name]`, that is).

Requires some nastiness to avoid pinning stale references in memory :s.

* PluginLoader:  Tweak genPluginManagerSubItem to keep from rebuilding `self.all_plugins`, it's using `loadPlugins`, which is cached, so it made no sense to re-compute this one.
2021-04-29 19:30:18 +02:00
poire-z
9ef435c97a
bump crengine: more granular font weights (#7616)
Includes:
- MathML: a few minor fixes
- (Upstream) lvtext: fix possible index out of range
- Fonts: RegisterExternalFont() should take a documentId
- Fonts: fix: letter-spacing should not be applied on diacritic
- (Upstream) Fonts: more granular synthetic weights
- Fonts: synthesized weights: tweak some comments
- Fonts: keep hinting with synthetic weight
- Fonts: fix synthesized weight inconsitencies
- Fonts: fix getFontFileNameAndFaceIndex()
- Fonts: adds LVFontMan::RegularizeRegisteredFontsWeights()
- Fonts: handle synth_weight tweaks in glyph/glyphinfo slots
- (Upstream) Fonts: fix some compiler warnings
- Fix hyphenation on Armenian and Georgian text

Update the bottom menu widget "Font Weight" to allow more
granular weights than the previous "regular | bold".

Also bump thirdparty/luasec to v1.0.1.
2021-04-29 01:37:53 +02:00
hius07
3cb9508185
Filemanager: enhance file operations dialogs (#7582) 2021-04-27 21:22:16 +02:00
hius07
86126d042f
Dispatcher: add "Toggle status bar" action (#7606) 2021-04-26 21:45:34 +02:00
hius07
9d9667c226
Status bar: do not hide alone empty indicators (#7602) 2021-04-26 17:40:06 +02:00
NiLuJe
da4aec223c CloudStorage (FTP): Unbreak after #7597 2021-04-26 04:00:26 +02:00
Andy Bao
ea6576d2b6
CloudStorage (FTP): Do not buffer entire download in memory (#7597) 2021-04-25 13:08:49 +02:00
NiLuJe
e0a67bb656
OTA: Handle tar checkpointing visual feedback w/ an FBInk daemon (#7588)
Instead of forking it on every checkpoint.

Won't change much in the grand scheme of things, but FIFOs are fun.
2021-04-25 01:15:38 +02:00
gbyl
617ed2c078
Gestures: Allow disabling tap and/or swipes for page turns (#7572)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
Co-authored-by: NiLuJe <ninuje@gmail.com>
2021-04-22 18:35:08 +02:00
yparitcher
dde3c80e73
do not exit when opening unsupported file by last for FM (#7580)
fixes: #7577

see prior art in #3935 #3933
2021-04-22 16:35:00 +02:00
zwim
e4c9409f97
[plugin] Add a caching mechanism for CoverImage (#7510) 2021-04-22 08:38:49 +02:00
NiLuJe
14f9f9d3fc
FileManager: Tweak #7564 (#7571)
Tweak the goHome handler directly, instead of only the Home button.
Also, limit it to when it's actually needed, as changeToPath already
does it.
2021-04-19 21:29:26 +02:00
NiLuJe
9e9a87434b
NetworkManager: Just warn if the gateway is unreachable after a (#7570)
successful authentication.

Fully tearing down Wi-Fi was a bit optimistic, as the AP list can
technically still be up, so the user might want to try again and/or
connect to another AP.

Fix #5912, regression since #4616.

The reasoning behind #4616 doesn't really apply anymore anyway, as the
Wi-Fi prompt now handles this inconsistent state properly.

The whole codepath should be *extremely* rare anyway (and/or require
super-broken network conditions).
2021-04-19 21:29:12 +02:00
Martín Fernández
53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
2021-04-19 09:04:31 +02:00
NiLuJe
9988eab1a1
ReaderToc: Unbreak ToC depth detection (#7569)
No need to reinvent the wheel.

Fix #7568, regression since #7553
2021-04-19 02:21:58 +02:00
hius07
3df1ce3644
Style tweaks: add links italic style (#7567) 2021-04-19 02:21:44 +02:00
gbyl
508a294016
ScreenSaver: Allow toggling the reboot/poweroff overlay message (#7566)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-19 02:20:46 +02:00
NiLuJe
d3213e6b80 UIManager: Follow the same ScreenSaver preparations than Generic's
PowerEvent handler

(i.e., flash to white befor eimages).

Re #7519
2021-04-18 01:03:33 +02:00
NiLuJe
14cd6febbb Kindle Legacy: Cleanup key mappings
The K3 has a mapping similar to the K4, not to the DX & K2.

Fix #7561
2021-04-18 01:03:33 +02:00
NiLuJe
d6c6b3eb71 ReaderHeader: Skip the refresh if we're not visible
Similar in spirit to the previous commit, although since we're drawn as
part of the CRe page, this is just the refresh per-se that's optimized,
it had no chance to actually be visible.
2021-04-18 01:03:33 +02:00
NiLuJe
079418d3cd ReaderFooter: Smarter hardware event handlers
Make sure we don't repaint the footer over anything else than ReaderUI,
as some events are fired without direct UI interaction, so we can't be
assured of the actual state of the UI.

Fix #7556

Exposed since #7379, but could arguably happen with other existing
handlers before.
2021-04-18 01:03:33 +02:00
NiLuJe
832d915795 SortWidget: More tweaks
* Support cancelling individual moves.

Coopt the cancel button to actually do just that, cancel, instead of close.

* Don't close when hitting the accept button, allowing to chain multiple moves.

Changes are still propagated to the caller on each individual move, though.

* Update the new icons to match our usual stroke width.
2021-04-18 01:03:33 +02:00
gbyl
32802ee7f2
reMarkable: Remove refresh before poweroff (#7563)
This is now handled in a platform-agnostic manner (#7558).

Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-18 01:02:59 +02:00
gbyl
915c5c7755
FileManager: Also refresh content when tapping the "Home" button (#7564)
Co-authored-by: gbyl <gbyl@users.noreply.github.com>
2021-04-18 01:01:59 +02:00
hius07
7b169dfa5e
FileManager: Hold the "+" button to refresh content (#7559) 2021-04-18 00:58:52 +02:00
yparitcher
475f46c427 fix for #7553: missing comma 2021-04-16 16:53:02 -04:00
NiLuJe
6def0bb7f0 FrontLight: Workaround potential crashes when swiping the frontlight bar.
This whole widget is a mess.
2021-04-16 22:12:15 +02:00
NiLuJe
956ecdc910 FrontLight: Ensure the warmth bar is empty at 0
Fix #7548
2021-04-16 22:12:15 +02:00
NiLuJe
7f3a9f4761 ReaderToc: Minor look'n feel tweaks
* ReaderToc: Tweak padding around items to be a tad more balanced for multi-level ToCs, and perfectly balanced for flat ToCs. (Re #7548)
* ReaderToc: Make the onHold popup's width match said padding. (Re #7548)
* InfoMessage: Allow passing the alignment flag to TextBoxWidget
* ReaderToc: Center text inside the InfoMessage onHold popup
2021-04-16 22:12:15 +02:00
NiLuJe
1ac0ad2f1a Android: More input handling tweaks
* Android: Fix #7552 by simply ensuring we drain the input/cmd queue first, simply by scheduling the task to the next tick, instead of locally re-implementing part of the event loop ;). (Requires https://github.com/koreader/koreader-base/pull/1356 for extra safety).
* Android: Clear input state when the window loses focus. (Related to the above fix).

* Bump base:

https://github.com/koreader/koreader-base/pull/1356
https://github.com/koreader/koreader-base/pull/1357

* Bump android-luajit-launcher:

https://github.com/koreader/android-luajit-launcher/pull/293
https://github.com/koreader/android-luajit-launcher/pull/298
https://github.com/koreader/android-luajit-launcher/pull/299
2021-04-16 22:12:15 +02:00
NiLuJe
97b81a7eb6 Menu: Don't share the dimen object across Menu instances (!)
The object was never re-assigned, so closing a smaller menu (e.g.,
Calibre metadata search) made the underlying one (e.g., CoverBrowser's
ListMenu) inherit the smaller dimensions...

Instead of creating the object in the Class constructor, create it in the
instance constructor (i.e., :init).

Similar cleanups in other Menu* related classes.
2021-04-16 22:12:15 +02:00
NiLuJe
3274183466 Minor Input & TimeVal cleanups
* Input: Don't create a new TimeVal object for input frame timestamps, just promote our existing table by assigning it the `TimeVal` metatable.
* TimeVal: Export (const) `zero` & `huge` TimeVal objects, because they're common enough in our codebase. (NOTE: not actually const, that's a Lua 5.4 feature ;p).
* GestureDetector: Explain the behavior of the `last_tevs` & `first_tevs` tables, and why one needs a new object and not the other.
* Speaking of, simplify the copy method for `first_tevs`, because it doesn't need to create a new TimeVal object, we can just reference the original, it's unique and re-assigned for each frame.
2021-04-16 22:12:15 +02:00
hius07
fce63d3c0f
Numberpicker: show hint with boundaries instead of the current value (#7529)
* Numberpicker: show hint with boundaries

* Show current value in the hint
2021-04-16 22:01:24 +02:00
hius07
c560be3740
SortWidget: Redesign the footer to be more in line w/ Menu & KeyValuePage 2021-04-16 22:00:02 +02:00
hius07
d879062eeb
ReaderToc: Add an option to display a separator between entries (#7551) 2021-04-16 21:59:01 +02:00
hius07
7092df7f4e
Button setIcon: Allow keep button width (#7546)
Useful when said Button was instantiated with a custom width, as is the case in SortWidget.
2021-04-16 01:35:04 +02:00
NiLuJe
ea3fa5c2c7
Calibre: More QoL tweaks (#7545)
* Wireless: Optimize memory usage in StreamMessageQueue (use an array of string ropes, that we only concatenate once). Allowed to relax the throttling, making transfers that much faster.
* Persist: Add a "zstd" codec, that uses the "luajit" codec, but compressed via zstd. Since both of those are very fast, it pretty much trounces everything in terms of speed and size ;).
* Persist: Implemented a "writes_to_file" framework, much like the existing "reads_from_file" one. And use it in the zstd codec to avoid useless temporary string interning.
* Metadata: Switch to the zstd codec.
2021-04-14 00:35:20 +02:00
NiLuJe
47c59e0e5a
Persist: Add the new native LuaJIT serializer to the list of supported codecs (#7543)
And swap the Calibre metadata cache to it.
2021-04-13 18:11:39 +02:00
NiLuJe
22b9396696
Centralize one time migration code after updates (#7531)
There have been a couple of these this month, and keeping stuff that should only ever run once piling up in their respective module was getting ugly, especially when it's usually simple stuff (settings, files).

So, move everything to a dedicated module, run by reader.lua on startup, and that will actually only do things once, when necessary.
2021-04-13 17:54:11 +02:00
NiLuJe
f2e90f505b
Input: Minor cleanups (#7542)
* TimeVal: Log the results of the COARSE probes in debug logs
* GestureDetector: Print details of failed clock probes in debug logs
* GestureDetector: Skip the BOOTTIME probe when CLOCK_BOOTTIME is unsupported.
* Input: Decode ABS_DISTANCE events in debug logs
* Get rid of duplicated <linux/input.h> constants, use the FFI module everywhere (re #7536)
* Kobo: Get rid of the `touch_alyssum_protocol` quirk. Replace it by setting `main_finger_slot` to `1`, like on the H2O.
2021-04-13 17:53:15 +02:00
Glen Sawyer
b6b332e311
Fix for PR #7415 breaking reMarkable touch input (#7536)
The Wacom pen reports sane CLOCK_REALTIME timestamps, but the Touchscreen reports timestamps frozen at the boot time ts (in REALTIME) :s.

So, make everyone use synthetic CLOCK_MONOTONIC timestamps in order to make gesture detection behave.
2021-04-12 18:54:12 +02:00
NiLuJe
b8d0cc4c35
Calibre: Minor QoL fixes (#7528)
* CalibreMetadata: Get rid of the now useless NULL-hunt: here, this was basically looking for `rapidjson.null` to replace them with... `rapidjson.null` :?. IIRC, that's a remnant of a quirk of the previous JSON parser (possibly even the previous, *previous* JSON parser ^^).
* CalibreSearch: Update the actually relevant NULL-hunt to make it explicit: replace JSON NULLs with Lua nils, instead of relying on an implementation detail of Lua-RapidJSON, because that detail just changed data type ;).
* UIManager: Make sure tasks scheduled during the final ZMQ callback are honored. e.g., the Calibre "Disconnect" handler. This happened to mostly work purely by chance before the event loop rework.
* Calibre: Restore a proper receiveCallback handler after receiving a book, in order not to break the "Disconnect" handler's state (and, well, get a working Disconnect handler, period ^^).
* Calibre: Unbreak metadata cache when it's initialized by a search (regression since #7159).
* Calibre: Handle UTC <-> local time conversions when checking the cache's timestamp against the Calibre metadata timestamp.
* Bump base (Unbreak CRe on Android, update RapidJSON)
2021-04-12 02:31:53 +02:00
hius07
ad924e3c1c
Dict/Wiki lookup results window: improve the 'pencil' button (#7523) 2021-04-10 22:08:59 +00:00
hius07
25b40fd1b6
Input dialogs: do not allow blank input cont'd (#7516) 2021-04-10 22:08:29 +00:00
NiLuJe
d31dc1e450 FileManager modules: Slightly less hackish onSetRotationMode handlers...
And, also, rotate the parent widget (i.e., FM/RV) to avoid leaving the
user with a broken layout when they exit in a different orientation ;).
2021-04-10 00:39:49 +02:00
NiLuJe
e27925f4bb FileManagerShortcuts: Handle rotation events 2021-04-10 00:39:49 +02:00
NiLuJe
99372e8c63 FileManagerCollection: Handle rotation events 2021-04-10 00:39:49 +02:00
NiLuJe
a185290549 FileManagerHistory: Handle rotation events
Fix #7518
2021-04-10 00:39:49 +02:00
NiLuJe
5f9f7ce1da ReaderBookmark: Don't confuse bookmarks with highlights
Attempting to update a highlight when matching on a bookmark doesn't
make sense, and no longer works since #7411

Also, switch to ipairs(), and stop piggybacking on a new local that
shadows or uses the function's item argument.
It works in Lua, but it's super weird and error-prone.

Fix #7520 (regression since #7411).
2021-04-10 00:39:49 +02:00
NiLuJe
a62561e81e Fontlist: Move cache file in a subdirectory, so as not to mess with
Cache's state tracking

Re #7510

Legacy cache has to be deleted in Cache,
*before* the first getDiskCache call.

Reword the "Clear caches" Dev menu entry & callback:
We now have an actual "Restart" action (on most, if not all, platforms).
And we clear the whole cache folder, which may host other things (e.g.,
fontlist)
2021-04-10 00:39:49 +02:00
hius07
17e6049e30
Inputtext: don't allow the cursor to move within a hint (#7507) 2021-04-05 12:59:15 +02:00
gbyl
d3f3e37f23
hidden setting: highlight lighten factor (#7497) 2021-04-05 10:02:41 +02:00
NiLuJe
e4adcdf422 ReaderHighlight: Allow customizing the highlight lightening factor.
Followup to #7497
2021-04-05 09:54:59 +02:00
NiLuJe
01224e5f49 Hide the zoom spiel when swicthign to continuous mode with reflow
enabled.

Zoom modes are disabled w/ reflow since #7463

Fix #6572
2021-04-05 09:54:59 +02:00
hius07
aef1e271b5
[UX] Search dialogs: don't close when searching with nothing entered (#7501)
File search, Fulltext search, Search dictionary, Search Wikipedia, DictQuickLookup: do nothing when nothing entered and search is pressed.
2021-04-04 17:27:17 +02:00
zwim
10922561dd
Add update of the top and bottom status bars, on +/-Charging (#7379) 2021-04-04 12:17:09 +02:00
Frans de Jonge
627065c354
Add a period (#7493) 2021-04-04 08:53:34 +02:00
NiLuJe
cbfcb2373d
ScreenSaver: Get rid of automagic settings (#7496)
By which I mean, explicitly initialize default settings, making everything seven hundred billion percent less weird.

Also, split the background option between image and (solo) message, because the defaults for those are different, and trying to twist the one into the other was leading to pure madness.
2021-04-04 03:28:45 +02:00
NiLuJe
03e9fac156
Input: Process input events in batches (#7483)
Requires https://github.com/koreader/koreader-base/pull/1344 & https://github.com/koreader/koreader-base/pull/1346 (fix #7485)

Assorted input fixes:

* Actually handle errors in the "there's a callback timer" input polling loop.
* Don't break timerfd when the clock probe was inconclusive.

Not directly related, but noticed because of duplicate onInputEvent handlers:

* HookContainer: Fix deregistration to actually deregister properly. "Regression" extant since its inception in #2933 (!).
* Made sure the three plugins (basically the trio of AutoThingies ;p) that were using HookContainer actually unschedule their task on teardown.
2021-04-03 01:48:35 +02:00
poire-z
25aabd69d9 Style tweaks: remove "Toggle alternative EPUB content"
With MathML support, this is no longer all or nothing.
As it's quite rare and technical, let this be handled
via user style tweaks.
2021-04-02 23:05:51 +02:00
poire-z
bc5881668e TOC: highlight first chapter on page instead of last
So its in sync with the chapter shown in the footer,
which was previously fixed with a482baac.
2021-04-02 23:05:51 +02:00
poire-z
fbb4f21720 Notifications: add some top margin
68a5fcdb moved them a bit to near the top than before,
and it can overlap with CRE rendering progress bar.
Also makes it nicer when multiple notications are stacked.
2021-04-02 23:05:51 +02:00