Commit Graph

7966 Commits (dc964f39410d911a0fdde9cd9af87cfbb213add6)
 

Author SHA1 Message Date
yparitcher dc964f3941
reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
3 years ago
yparitcher e157395660
add noop callback to cache size to prevent artifacts (#7106) 3 years ago
NiLuJe 34b764dc06 Kindle Legacy: Probe for SO on the K3 & K4 3 years ago
NiLuJe 1925f6e653 ReaderFooter:
* Flush mode to settings ASAP when an unrelated option updates the mode.
    Fixes, among other things, *enabling* the progress bar while the status
    bar is hidden: this showed it, but kept mode as "off".
  * Don't stomp on the current mode when toggling the progress bar.
    And *always* pop the status bar back up to see the difference, even if
    it's hidden.
    This used to be done only when *enabling* the progress bar.
3 years ago
NiLuJe f67296942f ScreenSaver:
* Don't try to expand a screensaver message without any special tokens
  * Don't needlessly nil the background when show_message is true
    Honor the actual nil background setting, now that we've got one.
    Also, only clear covers_fullscreen with no background *and* no widget.
  * Support special tokens outside of ReaderUI. Because the undocumented
    "Oops, I'll use the fallback otherwise" was extremely not
    user-friendly.
3 years ago
NiLuJe b119e29218 NetworkActivity: Fix an exceedingly unlikely crash.
If you're *extremely* unlucky, the scheduled check might run *right*
after a wakeup, before the network interface is up. So, you have a
previously stored packet count, but the new one is nil. Boom.
3 years ago
NiLuJe 5ae5c99197
Legacy Kindle: Unbreak screensavers (#7112)
* The K2 & DXg cannot be SO, so, bypass the check there

* Handle native screensavers on FW 3.x & 4.x
3 years ago
poire-z eb66856d81
CRE: allow both Top/Bottom margins fine tuning (#7104)
By having the same DoubleSpinWidget launched when
hitting "..." on any of Top margin or Bottom margin
progress bars.
DoubleSpinWidget: remove blank space when no info_text.
3 years ago
poire-z 6205f26047 Dict, Trapper: prevent dismissal by past events
Add UIManager:discardEvents(), to allow dropping events
for a period of time.
Default duration of 600ms on eInk, 300ms otherwise.
Used when showing the dict result window, so that a tap
happening just when it's being shown won't discard it.
Used with Trapper:confirm()/:info(), to avoid taps made
in a previous processing to dismiss (and so, select the
cancel action) a ConfirmBox not yet painted/visible.
3 years ago
poire-z b6323f15fc DictQuickLookup: hold prev/next buttons go to first/last result 3 years ago
poire-z aedab2d695 Dict/Wiki lookup: less text cleanup on manual input
Don't cleanup input text as much when entered manually
(or when it's sane) than when coming from book text
selection.
This may allow looking up words like "-suffix", or
do more precise Wikipedia queries.
3 years ago
NiLuJe 5756f1f43e
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
3 years ago
NiLuJe 048b0b2d83 Unbreak testsuite after #7047 3 years ago
NiLuJe a5468ba385 Fix opacity of the dictionary window
Brainfart from 6162c287e8

Forgot to zap the original UIManager:show(), so we were stacking two
identical widgets on top of each other, which obviously affected alpha.

Re #7029
3 years ago
yparitcher 5db215e5ba
bump base (#7098)
koreader/koreader-base#1278

the emulator is being impossible to use without this.
3 years ago
Jason Benwell 32b28c0b80
Footer: add "Pages left in book" as footer item (#7047) 3 years ago
poire-z f96585ece8
htmlToPlainText(): tweak format paragraphs with indentation (#7095)
Rework dafaf966, with a tabulation instead of multiple
  to ensure a constant indentation when text
is justified.
3 years ago
poire-z c98dfef7fc DictQuickLookup: various tweaks
- Rework widget layout to avoid implicit (and wrong)
  sizing, using proper padding/margins and correct
  measurements of components.
- Adjust lookup word font size so it's not smaller
  than the definition.
- Tweak small window positionning: keep it centered
  if possible, only move it to keep the highlighted
  word shown when we can.
- Large window: adjust to screen size correctly,
  leaving room for footer.
- Always have a "Close" button at bottom right.
  Former always displayed button "Follow link" will
  be added as a 3rd row in the rare case we select
  a word in a link.
- Replace "tap on lookup word to edit and redo the
  query" with an icon on the right: tap on it to
  edit the queries word, long-press to edit the
  current result word. Only close the current dict
  window when lookup is launched.
- Remove feature "tap on title to set current dict
  as the default dict for this document", as it didn't
  really work, and it was bad UX.
3 years ago
poire-z b66d0be3f9 ReaderDictionary: show nothing if interrupted quickly
If interrupted quickly just after lookup launch, don't
display anything (this might help avoiding refreshes
and the need to dismiss after accidental long-press
when manipulating the device).
3 years ago
poire-z cac7db1a1c InfoMessage: allows being drawn only after a delay
- InfoMessage: add an option show_delay.
- MovableContainer: avoid possible crash when
  not yet painted.
- ReaderDictionary: use show_delay=0.5 instead of
  scheduleIn(0.5n...) (a5b133da) as we need the
  InfoWidget to be known to UIManager to catch tap
  and allow interrupting lookups properly.
- ReaderDictionary: rework handling of no_refresh_on_close
  (6162c287) with proper regions comparisons
3 years ago
poire-z dd74194e0a cre.getWordFromPosition(): fix a few issues
Drop the use of crengine's getWordFromPosition() which
is a bit unreliable: it may returns wrong coordinates,
or words from far away in the book (ie. when holding
in the margins).
Rely only on the robust getTextFromPositions() that
we already use for multi words selection.
Having good coordinates allows refreshing a smaller region
(the higlighted word, or the 2 lines if hyphenated).
3 years ago
Frans de Jonge d560f9011d
Bump base (#7088)
Forgot to bump it before or as part of <https://github.com/koreader/koreader/pull/7037>.
3 years ago
John Beard 0e494169f2
Keyboard input in InputText (#7037)
For text input, use the SDL events, which contain the decoded
strings.

Still handle keypresses for non-text input.
3 years ago
John Beard fca87b5b3a
UI: Clicking menu icon returns to top of menu (#7074)
Fixes: #6940
3 years ago
Martín Fernández fbf60f96e4
bump base (#7077) 3 years ago
Glen Sawyer 3bd3493014
Fix double-pressing reMarkable 2 power button twice to wake up (#7065) 3 years ago
Glen Sawyer 578f92e424
Time-adjust on all reMarkable events, not just EV_ABS (#7066) 3 years ago
Martín Fernández 9db4e29bb1
bump sdcv for fast synonym search (#7068) 3 years ago
gbyl d2379fc6e6
remarkable: poweroff.png ghosting fix (#7051) 3 years ago
Frans de Jonge a96181d74f
Fix typo in "remove bookmark?" (#7062) 3 years ago
Martín Fernández cd9b3e10fd
calibre: do not attempt to stop the socket if nil (#7067) 3 years ago
NiLuJe 0685eecdad
Simplify db migration toasts (#7063)
xref https://www.mobileread.com/forums/showpost.php?p=4073920&postcount=17
3 years ago
John Beard 12d1604a75
UI: Make button radius match default window radius (#7054) 3 years ago
NiLuJe f1f439d08b
More Android trickery (#7059)
* Modernize jit syntax

It's built-in, no need for a require anymore.

* Flag Android should_restrict_JIT again

It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/281
3 years ago
Frans de Jonge b8bed49a61
Pass dict_path to dictionary fix_html_func (#7057)
That way images can be made to work in a more generic, portable manner, such as:

```
return function(html, dict_path)
    html = html:gsub('<rref[^>]*>([^<]*%.jpg)</rref>', '<img src="'..dict_path..'res/%1">')
    return html
end
```

Cf. <https://github.com/koreader/koreader/issues/6056>.
3 years ago
yparitcher 4548ced866
Quickstart: add long press sets default (#7048)
add wiki reference
3 years ago
NiLuJe f534e08ad1
Bump android-luajit-launcher (#7055)
https://github.com/koreader/android-luajit-launcher/pull/280
3 years ago
Frans de Jonge 53909db687
Close Lua state on all os.exit() calls (#7050)
Cf. <https://github.com/koreader/koreader/pull/7044>.
3 years ago
NiLuJe 21af9144ab
Don't paint invisible background-colored rounded corners (#7046)
* Don't paint invisible background-colored rounded corners

Made obvious when testing #7042

* Only enforce a highlight radius on buttons that don't already set a
custom one ;).

(Mostly, square buttons with a 0 radius ^^).

ffi/blitbuffer already handles radius being nil, which suits us just fine
:)
3 years ago
NiLuJe 7bc8ed87d0
kodev: Avoid catchsegv via -S, --no-catchsegv (#7044)
This works around #7036 on my end (so far).

* Turns out we can actually ask os.exit to close the Lua state, wheee!
Thanks @Frenzie ;).
3 years ago
NiLuJe 39c60ada20
Android: Avoid the Lua blitter (#7042)
* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/279

* Bump base

https://github.com/koreader/koreader-base/pull/1265
https://github.com/koreader/koreader-base/pull/1267
https://github.com/koreader/koreader-base/pull/1268
3 years ago
Frans de Jonge dafaf966e4
htmlToPlainText(): Format paragraphs with indentation (#7027)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4072308#post4072308>.
3 years ago
Frans de Jonge ad08ce9849
OPDS: Inform and warn about downgrade attack (#7032)
Fixes <https://github.com/koreader/koreader/issues/7007>.
3 years ago
Galunid d5103bddc3
Add fall back to text selection option to panel zoom (#6960)
* Add fall back to text selection option to panel zoom
* Add functions to allow per extension settings
3 years ago
yparitcher b2b9b49859 ReaderActivityIndicator: fix isStub()
it was being overridden by the EventListener:new

caused by #7002

c.f. https://www.mobileread.com/forums/showthread.php?t=335886
3 years ago
yparitcher 405c48b6ea Show only 1 End Document Dialog at a time
if scrolling past the end of a document the EndOfBook event get fired once per scroll (a lot)
3 years ago
yparitcher c3fd6ae38b Margins: allow direct input (more_options) 3 years ago
NiLuJe d845741b15
Android: Don't mark the platform as should_restrict_JIT (#7024)
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/278
https://github.com/koreader/android-luajit-launcher/pull/275
3 years ago
NiLuJe 09c1f35191
rM: Unbreak PowerEvents (#7043)
Most of this is scheduled with delays for reasons, so this was a stupid
idea, my bad ;).

Fix #7033
3 years ago
NiLuJe 838769b0fb
BookInfo: Saner database migration (#7039)
Avoid opening two connections in //, by feeding the current connection
to saveSetting, like we were already doing for loadSettings...

It somehow worked just fine on Kobo/Emu, but blew up in fun and
interesting ways on Kindle, probably because of the Fuse proxy.

It was still pretty dumb nonetheless.
3 years ago