2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
Commit Graph

2003 Commits

Author SHA1 Message Date
hius07
7719ad04f3
Reader: add open next file in folder to Dispatcher (#9916)
Closes https://www.mobileread.com/forums/showthread.php?t=350683.
2022-12-14 20:40:24 +01:00
NiLuJe
b16b215cbb ReaderHighlight: Appease newer versions of LuaCheck
Good to know: it now defaults to assuming that function arguments
prefixed with an underscore would be unused, which is... nice in theory ;).
2022-12-13 00:17:25 +01:00
Roygbyte
3e49cf9a18
ReaderLink: allow buttons to be added to the External link dialog (#9746)
So plugins can register and advertize themselves
as handlers of external links (ie. Wallabag).
2022-12-11 16:52:40 +01:00
Frans de Jonge
e1fe897c9b
[i18n] Add a couple of explanatory comments for translators (#9878) 2022-12-11 10:08:46 +01:00
hius07
c53dd55b16
ReaderHighlight: new Select mode icon (#9869) 2022-12-11 09:55:47 +01:00
weijiuqiao
49d8ec2f4f
Cloudsync: dropbox token re-generation (#9862) 2022-12-11 09:54:58 +01:00
hius07
05cd59ebe5
ReaderBookmark: indicate current page with dimmed page numbers after current (#9872) 2022-12-09 09:08:14 +01:00
Frans de Jonge
e58a12ba04
TouchMenu: Search menu to search the menu (#9876)
Fixes #9800.
2022-12-06 22:02:21 +01:00
zwim
192a243b4d Add datetime.lua
Move date and time related functions from util.lua
(and the statistics plugin) to a new datetime.lua.
2022-12-06 17:36:08 +01:00
zwim
d1cd2a1c8d
Restart KOReader: add a ConfirmBox instead of a plain InfoMessage (#9853) 2022-12-03 21:29:13 +01:00
Steady Quad
fa9f0acf5e
cloudstorage: Fix directory listing for some WebDAV servers (#9847)
(sub)folders on some WebDAV servers are not listed in cloudstorage due to strict xml element matching of <d:collection> elements.
2022-12-02 23:47:16 +01:00
hius07
cd56dd2edf
ReaderHighlight: pdf multi-page highlights (#9850) 2022-12-02 20:22:27 +02:00
melyux
cc53ceb039
History: remember status filter, show filtered count in title (#9822) 2022-12-02 16:56:00 +01:00
Frans de Jonge
84be6fc226
[i18n] Fix 'Choose new folder to set as home?' can't be translated (#9841)
Reported in <https://www.mobileread.com/forums/showthread.php?p=4276962#post4276962>.
2022-11-27 21:55:26 +01:00
hius07
c35140e8d2
ReaderHighlight: new icon in select mode ConfirmBox (#9830) 2022-11-25 11:18:54 +02:00
hius07
90f6dd178e
CloudStorage: add DropBox starting folder (#9821) 2022-11-22 14:53:10 +02:00
hius07
5b889a0145
Reader style tweaks: register in Dispatcher manually (#9816)
Style tweaks can be applied with a gesture or added to a profile.
2022-11-22 13:46:44 +01:00
zwim
486d7071c7
[StatusBar] Allow status bars to be repainted if they are not covered (#9768) 2022-11-20 05:33:44 +01:00
hius07
d95c692c78
ReaderHighlight: add abort select mode (#9786) 2022-11-18 20:17:25 +01:00
weijiuqiao
e481e60aa1 Syncservice: fix not updating services after adding new ones 2022-11-16 22:51:38 +01:00
NiLuJe
df890105e4 ReaderMenu: Use a dedicated handler for the Menu key
Piggybacking on the touch gesture handlers implied that the gesture
filter (tap and/or swipe) was still applied, which made no sense.

Also, stop the weird Event roundtrip for events we're actually the only
ones to handle, just call the handler ourselves directly.

Fix #9792
2022-11-16 22:11:19 +01:00
hius07
06cec98d09
Filemanagerutil: let abbreviate manage extra slash (#9785) 2022-11-14 02:20:26 +01:00
hius07
71c65d18f1
Page turns: add backward tap zone width setting (#9772) 2022-11-12 08:40:31 +02:00
poire-z
1fa706a2c5
Fix page stats messed up after rerendering (#9775)
Fix regression introduced by 48eb0231 #9651: on re-rerendering, the new pages count didn't reach the Statistics plugin.
So, if you change font size or margins, the stats for the page read since then were badly accounted, until a change of book or restart... I noticed that in Book map, strange nobody else did over the last 2.5 weeks.
2022-11-11 21:43:27 +01:00
weijiuqiao
8500fdd519
Cloud-based sync for 2 plugins: reading statistics and vocabulary builder (#9709)
This commit adds cross-device sync ability for two plugins: reading statistics and vocabulary builder. It relies on user setting up a Cloud server (DropBox and WebDAV but not FTP though) and designating a path. Behind the curtains sqlite databases are being passed around and updated.

UI-wise, for the statistics plugin, two new menu items Synchronize now and Cloud sync to set it up (might not be the best wording) are added. As for vocabulary builder, a similar Cloud sync button is added to the menu and a shortcut icon button to Synchronize now is pinned at the bottom corner.

CloudStorage new features: WebDAV creating folders and uploading files. And a new widget-like sync server chooser. In the end I decided not to add automatic sync, as the SQL commands part seem a bit much.
2022-11-11 15:53:06 +01:00
hius07
4f3000e882
ReaderHighlight: fix ending fragment check (#9769) 2022-11-10 18:13:18 +02:00
hius07
c3ed51aded
ReaderHighlight: set default long-press action with a gesture (#9723) 2022-11-02 13:58:12 -04:00
NiLuJe
925fd647dc InputContainer/FocusManager: Simplify key_events clearing on unplug
Thanks to @poire-z for the idea, it's indeed much nicer this way ;).
2022-11-02 03:48:39 +01:00
NiLuJe
09498d4bbb ReaderUI: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
NiLuJe
e0bfebb0b5 FileManager: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
NiLuJe
8cba303b96 ReaderPanning: Don't crash in the key event handler.
I'm unclear on where this is supposed to do anything, though.
But at least it no longer crashes, so, yay?
2022-11-02 03:48:39 +01:00
NiLuJe
25dce4d1b5 WebDAV: Fix a warning with the latest LuaCheck version
(error-prone negation)
2022-11-02 03:48:39 +01:00
NiLuJe
1e24a1c7a3 ReaderUI: Properly neuter gesture handling from InputContainer modules
None[1] of them actually rely on their own onGesture handler, they
all register their own stuff to ReaderUI's.
Hotfix #9710 revealed that the way this was handled didn't exactly
work as expected ;).

The only thing that consumes ges_events is InputContainer's onGesture
method. All these modules *extend* InputContainer, but none of them
*implement* a custom onGesture, so self.onGesture = nil was just a NOP,
they always access InputContainer's method via inheritance.
If we actively want to neuter it, we *have* to implement it in that
module (with a NOP).

[1] The exception being ReaderZooming, but that only when in flip mode.
2022-11-02 03:48:39 +01:00
yparitcher
4d8e2f0ea1 ges_events must be a table
regression in #9691 b523c2e8b9
2022-10-29 23:30:16 -04:00
NiLuJe
b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

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

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2022-10-29 22:55:20 +02:00
hius07
a8ff3a6571 readerzoomin: add zoom mode translation, simplify zoom mode validation 2022-10-29 17:48:21 +02:00
hius07
0919c4ef17 readerkoptlistener: simplify zoom mode validation 2022-10-29 17:48:21 +02:00
weijiuqiao
e8cd2ba498
WebDAV: fix bugs when start folder starts with "/" (#9688) 2022-10-29 17:45:52 +02:00
zwim
d7c63edca6
Random optimizations (#9657) 2022-10-28 07:51:27 +02:00
poire-z
48eb02318d
Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)
When a gesture/profile was updating multiple cre settings,
each setting handler would emit UpdatePos which each would
force a re-rendering.
When this might be happening, postpone the rerendering
until all are set.
Needs some bit of refactoring to the events at play:
introduce "DocumentRerendered" event, and use it where
we used "UpdatePos" or "UpdateToc" to mean exactly that.
2022-10-25 13:16:01 +02:00
hius07
d1abbbfdd8
Document settings submenu: add Save as default (#9643) 2022-10-25 12:34:23 +02:00
weijiuqiao
edf7cc9a61
Vocabulary builder: support extracting context from pdfs (#9622)
Move getSelectedWordContext(), now document specific,
from ReaderHighlight into each document module.
2022-10-25 12:23:18 +02:00
NiLuJe
da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2022-10-12 19:59:48 +02:00
hius07
a728e3b5fa
ReaderStatus: save status summary (#9619) 2022-10-10 17:52:47 -04:00
zwim
4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +02:00
NiLuJe
a62f076e56 DictQuickLookup: The window_list array needs to be a static class member
Also, make sure references are actually dropped,
no matter how the widget is closed, by relying on onCloseWidget ;).

Enable the "long-press-on-close" trick on the actual Close button,
too, instead of only on the title bar's cross.

Fix: https://github.com/koreader/koreader/pull/9586#issuecomment-1272332275
2022-10-09 05:30:28 +02:00
NiLuJe
c0dffe2012
Kobo: Add a debug option to turn the charging LED on PM entry failure (#9601)
This should be fairly unintrusive, but still noticeable enough without having to watch the battery gauge like a hawk, or resort to actual monitoring via kernel logs and/or usb meter and/or multimeter...
2022-10-07 17:33:57 +02:00
NiLuJe
eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2022-10-06 19:28:26 +02:00
NiLuJe
fadee1f5dc
Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00
hius07
1ea7e16f3e
Cloud storage: add Dropbox short-lived tokens (#9496) 2022-10-04 12:33:53 -04:00
hius07
c5505879c3
ConfigDialog: fix bug in DoubleSpinWidget default values (#9580) 2022-10-04 07:44:55 -04:00
hius07
b0eb0ce0e1
FileManager: add Select button to the file long-press menu (#9571) 2022-10-04 07:44:17 -04:00
poire-z
3bd27c3a76 ReaderFont: add "Font-family fonts" submenu
Allow associating a font to each of the generic
font-family names.

Bump crengine:
- CSS parsing: accept (and ignore) namesspaces
- isImage(): more checks for <object> as it can have inner content
- getFontFileNameAndFaceIndex(): returns if font has math support
- getFontFileNameAndFaceIndex(): returns if font has emojis
- CSS/Fonts: add support for font-family to font name mapping
2022-10-03 23:27:44 +02:00
poire-z
137b39416f ReaderLink:showAsFootnotePopup(): remove some logger.info() 2022-10-03 23:27:44 +02:00
NiLuJe
9bf19d1bb3
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
  * A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
  * NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2022-10-02 03:01:49 +02:00
NiLuJe
4d48b6e2fe
Misc: Use the ^ operator instead of math.pow (#9550)
And some minor code simplifications, thanks to @zwim ;).
2022-09-28 01:11:34 +02:00
NiLuJe
62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2022-09-28 01:10:50 +02:00
NiLuJe
b0d8919399
ImageViewer: Followup to #9529 (#9544)
* ImageViewer: Minor code cleanups
* GestureDetector: Fix the `distance` field of `two_finger_pan` & `two_finger_swipe` gestures so that it's no longer the double of the actual distance traveled. Get rid of existing workarounds throughout the codebase that had to deal with this quirk.
2022-09-21 23:26:22 +02:00
poire-z
a8c81a90c3
ReaderDict: fix use of dicts with ifo with DOS line endings (#9536)
Fixed in upstream sdcv, but we need to also do it in
our parsing of .ifo and picking out dict name.
Also includes minor bump of base/sdcv.
2022-09-21 00:26:10 +02:00
hius07
45e4f38c41
CloudStorage: remove cloudmgr (#9532)
Use downloadmgr instead.
2022-09-20 11:54:57 +02:00
NiLuJe
83a2965d6b
Misc: Unify error logging on network errors (#9523)
Making sure we get the relevant information in the logs, and that the UI feedback (if any), is meaningful and readable.
2022-09-17 00:08:00 +02:00
NiLuJe
2fe2515ace
FontList: Always use the binary cache format (#9519)
Since I never actually needed to look into that data ever until today, let's just get rid of the weird debug-specific behavior.

Instead, just add a dedicated "Developer options" entry that will dump it on demand (and it'll be sorted to boot, which makes it 500% more usable).

Plus, since yesterday's change, the cache format switch between debug or not miiiight actually be crashy, so re-trigger the migration ;p.

* Includes a couple of noteworthy base bumps:

https://github.com/koreader/koreader-base/pull/1516 (update to sdcv 0.5.4 + fixes pending upstream)
https://github.com/koreader/koreader-base/pull/1517 (fix ffiUtil.orderedPairs with keys of mixed types)
2022-09-15 04:42:13 +02:00
NiLuJe
13e8213e0a
A random assortment of fixes (#9513)
* Android: Make sure sdcv can find the STL
* DocCache: Be less greedy when serializing to disk, and only do that for the *current* document ;).
* CanvasContext: Explicitly document API quirks.
* Fontlist: Switch the on-disk Persist format to zstd (it's ever so slightly faster).
* Bump base for https://github.com/koreader/koreader-base/pull/1515 (fix #9506)
2022-09-14 03:49:50 +02:00
hius07
56388aa491
TextViewer: add Find (#9507) 2022-09-13 17:09:49 -04:00
poire-z
76a7d83079 CRE/ImageViewer: get scaled blitbuffer when long-press on SVG
Get a Lua userdata wrapping a crengine LVSvgImageSource object
when long-press on a SVG image, and have crengine/LunaSVG render
it smoothly scaled to the requested size by ImageViewer.
2022-09-12 00:40:08 +02:00
poire-z
087f605fd9 Allow F5 key to reload document 2022-09-12 00:40:08 +02:00
zwim
d972b7fcfa
[core] Remove a bunch of superflous semicolons (#9449) 2022-09-08 21:52:06 +02:00
NiLuJe
8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2022-09-04 02:38:27 +02:00
hius07
f67469bab4
Highlight: add note marker (#9395) 2022-08-03 09:51:57 -04:00
hius07
460d42293a
PathChooser: add creating folder (#9354) 2022-07-27 12:02:37 -04:00
poire-z
5e2ed5ae2a
bump crengine: monospace and fallback fonts tweaks (#9343)
Includes:
- Text: fix possible overflow with "white-space: pre"
- Fonts: getFontFileNameAndFaceIndex(): return family type
- Fonts: account for _bias in Font hash
- epub.css, fb2.css: remove hardcoded monospace font names
- Fonts: allow scaling monospace fonts
- Fonts: allow adjusting fallback font sizes to x-height
- HTML parser: trust xml encoding before html charset

In our list of fonts, show a "M" indicator alongside
monospace fonts, and allow long-press to select the one
to be use for "font-family: monospace".
Add 2 options to Font settings, to scale monospace fonts
by a percentage, and to adjust fallback fonts to their
x-height.
2022-07-18 01:16:51 +02:00
zwim
22fe3933c3
[fix, SDL] Time: fix crash when scrolling in continuous mode (#9314)
Introduced with #8999.

Fixes #9311.
2022-07-09 22:47:10 +02:00
poire-z
10a6ffd927 Style tweaks: fix typos and global tweak conflict
Minor logic fix: allow global_conflicts_with to be not only
a function, but also a string or a table, as documented.
2022-07-08 21:18:42 +02:00
poire-z
6fb266cb71 Style tweaks: handle conflicting/redundant tweaks
Disable redundant or incompatible tweaks when enabling some.
This makes the menu more dynamic to show what's impacted,
save some re-renderings, and may avoid the user trying
combinations that would have no effect.
2022-07-07 00:32:07 +02:00
poire-z
e4eb1c61d1 Footnote popup: allow using book font as popup font
Also move footnote popup settings into a submenu.
2022-06-25 19:53:50 +02:00
poire-z
38bd2b4c46 ReaderRolling: fix marker sometimes not removed
Noticed when jump to a footnote and quickly going back.
2022-06-25 19:53:50 +02:00
Martín Fernández
b7a27a3db3
Fullscreen refactor (#9237)
Commonize fullscreen code across different devices.

Add fullscreen toggle on SDL desktop targets. 
Expose the toggle to the dispatcher and map it to F11.

Hide touchmenu when resizing.
2022-06-24 23:19:38 +02:00
weijiuqiao
cafbf36bb2
Vocabulary builder: store word context, other tweaks and fixes (#9195)
Add a copy button and save word context (off by default), shown
via the three-dot menu of word entries.
Also some db refactoring and minor UI improvements:
- a dedicated book title table in order to shrink db size by storing
  references to title names instead of repeated actual strings,
- alignment of different forms of the "more" button and possible
 clipped words in translations.
- fix plugin name so it can be disabled
2022-06-12 21:34:17 +02:00
zwim
e8597c2e0c
Footer: update on network disconnect (#9185) 2022-06-11 22:03:51 +02:00
poire-z
b9724f1e93 Text highlighting: extend to include punctuations
When selected text seems to be a "sentence segment"
(that is, when there are punctuations around start
AND end), extend the selection to include the relevant
punctuation.
Do this only when saving highlights and for translation
(but not when dict or wikipedia lookups, or search).
2022-06-11 20:58:52 +02:00
poire-z
141fa98a32 bump crengine: text selection tweaks and helpers
Includes:
- lvtext: fix m_kerning_mode type
- XML: let 'gb2312' (Chinese) encoding be known
- Add ldomXPointer::getChar()
- LVDocView::getNodeByPoint(): tweak for text selection
- Fonts: allow fetching the list of embedded fonts
cre.cpp:
- getTextFromPositions(): use getNodeByPoint(forTextSelection=true)
  to allow panning in margins and get the nearest text instead
  of nothing.
- add extendXPointersToSentenceSegment() to allow extending some
  xpointer range to include punctuations at start or end (with
  for now a quite rudimentory implementation).
- add getEmbeddedFontList() to allow fetching the list of
  embedded fonts in the current EPUB book.
2022-06-11 20:58:52 +02:00
NiLuJe
dcb11c2542
Make luacheck >= 0.26 happy (#9174)
Re: https://github.com/koreader/koreader-base/pull/1487
2022-06-11 19:06:06 +02:00
Martín Fdez
d644b1a851 android: update doShareText signature 2022-06-10 22:47:18 +02:00
NiLuJe
73b2b38954
AutoSuspend: Make sure we send a LeaveStandby event ASAP (#9173)
Even in corner cases where we're woken up without user input (e.g., rtc alarm).

(Followup to #9124)
2022-06-07 00:22:22 +02:00
poire-z
c825d50c8f CRE: add "CJK width scaling" option
The setting is handled like all other bottom menu options
but, as it's really not useful and its target audience is
very limited, make it not shown in the bottom menu, but
available via another button in the (also quite not useful)
Word Expansion fine tuning widget.
2022-06-06 01:08:59 +02:00
poire-z
f29ee8475e Style tweaks: add "Tailor widths and text-indent for CJK"
Also add a timeout to the "Changed language for
typography rules" InfoMessages.
2022-06-06 01:08:59 +02:00
weijiuqiao
e1b137339c
[feat, plugin] Vocabulary builder (#9132)
Made the old dictionary lookup history into a flashcard-ish vocabulary builder.
2022-05-31 22:11:35 +02:00
zwim
5a033f1221
DateTimeWidget: don't make ":" and "/" translatable (#9145)
* And the ellipsis
2022-05-29 22:32:16 +02:00
NiLuJe
ae5b2d68ca
AutoSuspend: Don't send LeaveStandby events from a zombie plugin instance (#9124)
Long story short: the LeaveStandby event is sent via `tickAfterNext`, so if we tear down the plugin right after calling it (in this case, that means that the very input event that wakes the device up from suspend is one that kills ReaderUI or FileManager), what's in UIManager's task queue isn't the actual function, but the anonymous nextTick wrapper constructed by `tickAfterNext` (c.f., 
https://github.com/koreader/koreader/issues/9112#issuecomment-1133999385).

Tweak `UIManager:tickAfterNext` to return a reference to said wrapper, so that we can store it and unschedule that one, too, in `AutoSuspend:onCloseWidget`.

Fix #9112 (many thanks to [@boredhominid](https://github.com/boredhominid) for his help in finding a repro for this ;)).
Re: #8638, as the extra debugging facilities (i.e., ebb81b9845) added during testing might help pinpoint the root issue for that one, too.

Also includes a minor simplification to `UIManager:_checkTasks`, and various other task queue related codepaths (e.g., `WakeupMgr`) ;).
2022-05-25 23:36:41 +02:00
hius07
e336983fd2
Cloudstorage WebDAV: more fix slash in server address (#9128)
Honor server addresses with or without trailing slash.
Regression since #9061. Closes #9125.
2022-05-25 17:02:46 +02:00
zwim
d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2022-05-24 00:25:50 +02:00
yparitcher
8f316b1e8c
Merge discardEvents & inhibitInput (#9065)
Rename `discardEvents` to `inhibitInputUntil`
only discard Input events
2022-05-23 13:52:52 +02:00
yparitcher
a97dbb05ed
Page turn animations: add to dispatcher (#9123)
xref: https://www.mobileread.com/forums/showthread.php?p=4224443&postcount=1119
2022-05-23 09:19:47 +02:00
hius07
f2c3fd54a1
filemanagershortcuts: fix adding the first shortcut (#9107)
Closes #9105.
2022-05-18 10:48:47 +02:00
zwim
84dd58f9df
Power-savings in readerdevicestatus: Schedule on full minute and fix multiple scheduling. (#9032) 2022-05-09 18:23:50 +02:00
NiLuJe
60b043ebe9
ReaderFooter: Refresh the footer on frontlight state changes issued by the frontlight widget (#9084)
c.f, https://www.mobileread.com/forums/showpost.php?p=4220159&postcount=7
2022-05-09 08:36:13 +02:00
poire-z
f286787ff5 ReaderPageMap: fix page labels in 2-columns mode
Page labels on the right page could have some bad y position
(they were never above the last page label on the left page)
2022-05-06 23:53:45 +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
yparitcher
54ead5fc88 Page turn animations
Kindle PW5 (MTK) with hardware support
Currently only in Crengine
2022-05-05 10:48:16 -04:00
hius07
9de0df81da
Cloudstorage WebDAV: fix leading slash for root folder (#9061) 2022-05-03 09:35:25 +03: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
hius07
74d0d22a15 readerhighlight: keep highlight for default action 'Translate' 2022-04-17 09:37:29 +02:00
zwim
71f6bd8ba5
ReaderFooter: Make setDirty happy (#9005)
Don't pass a non-window-level widget.
Painting is handled explicitly via widgetRepaint, so passing a widget to setDirty was just plain wrong anyway ;).
2022-04-16 18:57:37 +02:00
Philip Chan
77accf6546
Non-touch: highlight movement improvement and enable page crop (#8947) 2022-04-14 08:59:36 +02:00
poire-z
814f42cce0 UIManager:discardEvents(): use accurate "now"
Instead of UIManager possibly staled _now, which could have
no effect after a long ReaderRolling re-rendering.
Also lower the delay after such ReaderRolling re-rendering,
so we can change settings quicker when comparing renderings.
2022-04-11 22:42:56 +02:00
zwim
eaa6e77398
Status bar: fix battery display (threshold with aux battery) (#8959) 2022-04-08 12:20:25 +02:00
zwim
d820dd84d6
Readerview: fix checkAutoSaveSettings() with enabled standby (#8961) 2022-04-03 18:20:55 +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
lennonhill
eb34fbb818
PDF: align page view with target when following internal link (#8907) 2022-03-16 23:22:56 +01:00
zwim
8f3e9a5a61
UserHyph: Scrub and sort user dict (#8863) 2022-03-16 21:30:58 +01:00
Philip Chan
9f755dd202
[NT] Hide "Start content selection" and "Select on text" menu item on touch devices (#8914)
only center hold_pos and highlight indicator position with crengine document which has stable screen position
2022-03-16 20:00:14 +01:00
Frans de Jonge
0fe3a9d19c
[i18n] Add context to book status filter options (#8906)
Fixes #8903.
2022-03-15 16:16:04 +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
Philip Chan
36fc981b7c
Non-touch: fix crash when expanding ToC (#8892) 2022-03-12 15:51:22 +01:00
Philip Chan
4f849c23ab
Non-touch: highlight support (#8877)
readerhighlight: non-touch support
focusmanager: fix same type container share same selected field
radiobuttonwidget: non touch support
sortwidget: non touch support
openwithdialog: fix layout contains textinput, checkboxes added to layout twice
2022-03-12 12:16:50 +01:00
hius07
7b4d6fd205
History: filter by book status (#8820) 2022-03-12 11:26:11 +01:00
hius07
d7549dbd87
File searcher: fix show folders, include subfolders checkbutton (#8807) 2022-03-12 11:24:07 +01:00
poire-z
831488b9e9
Bidi: keep invert() generic, handle settings in ReaderView (#8876)
Follow up to 42dd5aad. Handle settings only in
ReaderView:shouldInvertBiDiLayoutMirroring().
2022-03-08 21:27:11 +01:00
yparitcher
23d12c3f04
TOC: use bidi_wrap_func (#8879)
Fixes RTL issue noticed at https://github.com/koreader/koreader/pull/8876#issue-1161280868
2022-03-08 09:22:54 +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
Frans de Jonge
d691964c0b
ReaderPaging: allow for page diff greater than 1 in onScrollPageRel (#8836)
Cf. <https://www.mobileread.com/forums/showthread.php?p=4200567>.
2022-02-28 21:27:46 +01:00
yparitcher
7172adc6ec Toc: expanded_nodes: loopless O(1) instead of O(n) 2022-02-20 16:09:39 +01:00
yparitcher
d8087b37e3 Toc: collapse child when parent is collapsed 2022-02-20 16:09:39 +01:00
yparitcher
73bb76f92d menu: separate indentation from text 2022-02-20 16:09:39 +01:00
yparitcher
60f68023d8 BD invert: enable for TOC BookMap & PageBrowser 2022-02-20 16:09:39 +01:00
yparitcher
62c6c757cc _mirroredUI do not set at require time 2022-02-20 16:09:39 +01:00
hius07
8bfd7ca340 warning on file size over 400000 b 2022-02-19 22:04:12 +01:00
hius07
fbdb021268 Update filemanager.lua 2022-02-19 22:04:12 +01:00
hius07
56b277f72e filemanager: free home button, text viewer 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
4ccdbc90a5
Doc settings reset: fix default block_rendering_mode (#8792) 2022-02-10 12:08:51 +02:00
NiLuJe
35776f1f87 "Simplify" HW/SW dithering checks
Make it a real Document property, updated at init & toggle time.

Also, simplify a bunch of redundant nested lookups in ReaderView
(self.ui.view is self, self.ui.document is self.document).
2022-02-08 00:25:13 +01:00
NiLuJe
3122bcd9bc KOptOptions: Allow toggling SW dithering
Fix #8748
2022-02-08 00:25:13 +01:00
hius07
a9a75f503f FilemanagerShortcuts: call from PathChooser 2022-02-07 22:08:26 +01:00
NiLuJe
0408816a54 ReaderFooter: Take the PowerCover into account in the battery level
widget

Since we only use a single icon, we have to take a few shortcuts:

* The icon itself is computed based on the average of both batteries.
* The actual value is the sum of both batteries.
* Much like everywhere else, charging means the *aux* battery charging
  (i.e., connected to a power source).

Re #8741, which does the same for ReaderHeader.
2022-02-02 00:37:05 +01:00
zwim
43f14b313f
AltStatusBar: take the PowerCover into account in the battery level (#8741)
Don't show [+] in top status line when device is charging
from a power cover, but the sum of both battery levels.
2022-02-01 21:15:49 +01:00
hius07
c1c89dd611
TouchMenu: use radio buttons for single choice menu items (#8757) 2022-02-01 20:56:28 +01:00
poire-z
d39f4ea35e CRE: fix switching to scroll mode from 2-pages mode 2022-01-31 23:57:48 +01:00
hius07
1c863f76aa
Bookmarks: start Add note with empty text, add some buttons (#8738)
- New button Go to bookmark in Bookmark details dialog.
- New button Latest bookmark in the popup menu.
- Empty input box for new note, new button Paste to
  paste highlighted text (auto-text).
- Allow duplicated bookmarks to avoid orphaned highlights.
- TextBoxWidget: fix enabled up-arrow on empty box in InputDialog.
2022-01-28 22:59:25 +01:00
hius07
b7a2a27590
Highlights: add strikeout style, fix pdf highlights (#8725)
- Add new strikeout highlight style.
- Fix highlight style in pdf documents (save_document enabled)
not updated when KOReader highlight style changed.
- Fix ugly combination of mupdf and KOReader highlights
2022-01-25 21:39:03 +01:00
Philip Chan
3af268dd7a
Non-Touch: improve bottom menu usability (#8712)
- FocusManager: allow managing sub widgets by merging their
  "layout" in the main one; make "press" support simpler by
  handling it as a fake tap event at the center of the
  focused widget.
- Setup gestures on non-touch devices for new focus manager.
- ToggleSwitch: use child layout.
- ButtonProgressWidget: use child layout.
- SpinWidget and DoubleSpinWidget: add keyboard navigation.
2022-01-25 01:32:46 +01:00
hius07
1ad7b7151a FilemanagerShortcuts: add Plus button 2022-01-24 22:27:45 +01:00
poire-z
16e3b2f0ac Allow Backspace to work as back button 2022-01-24 08:50:47 +01:00
Frans de Jonge
d7c00c586f
[lang] Add missing plurals to Dropbox download messages (#8705)
Fixes #6465.
2022-01-22 15:35:01 +01:00
hius07
f83ee0d739
Bookmarks: do not duplicate datetime request on creation (#8699) 2022-01-21 17:56:08 +02:00
hius07
1c2b01a51e
Bookmarks: fix compare invalid xpointers (#8690) 2022-01-19 15:18:03 +02:00
poire-z
0216493c43 Wikipedia: rework wiki languages internal handling
Fix various issues with stacked Wikipedia lookup results,
and follow up lookups when invoked from Wikipedia lookup
history (where going to a search for language LL would
not use language LL when hitting "Full wikipedia").
2022-01-19 12:23:38 +01:00
yparitcher
87dbb9885e FM select mode: let the icon survive through reinit not only rotation 2022-01-18 09:35:32 +01:00
hius07
2a244278e3
Translator: copy translation to clipboard or save to note (#8669) 2022-01-16 21:54:08 +02:00
hius07
958077364a
Filemanager: insert TitleBar (#8648) 2022-01-12 19:41:52 +02:00
hius07
5c39c19a73
[chore] Remove leftover: cface (#8659)
Ancient menu widget had it.

Not used anymore.
2022-01-12 13:32:03 +01:00
hius07
1bfb49c6a5
PathChooser: add left Home button (#8646) 2022-01-11 14:47:06 +02:00
poire-z
99171b5267
ReaderBookmark: fix issue with unit tests (#8645)
Revert some bits from 55532b13, as the otherwise uneeded
CenterContainer is used by unit tests.
2022-01-10 23:07:39 +01:00
hius07
55532b1397
Menu widget: insert TitileBar (#8639) 2022-01-10 21:21:39 +02:00
poire-z
48ca7e820c DictQuickLookup: update to TitleBar widget
Also tweak ReaderHighlight:onHoldRelease() to avoid
doing its stuff when onHold() is clearing highlight
(previous CheckButton was closing/clearing on hold
release, new TitleBar close button does that on hold).
2022-01-08 17:43:35 +01:00
hius07
00b08d7b54
Bookmarks: fix sort within one page (#8616)
Accurate sorting of bookmarks located in one page depending on their positions in text.
2022-01-06 21:54:33 +02:00
poire-z
bc16b32395 Add Book map and Page browser features
- Book map: shows a map of content, including TOC,
  boomarks, read pages, non-linear flows...
- Page browser: shows thumbnails of pages.

- ReaderThumbnail: new Reader module that provides
  a service for generating thumbnails of book pages.
  It makes available these 2 new fullscreen widgets.
- ReaderBookmark, ReaderLink, Statistics: add methods
  to return new views of bookmarks, previous locations
  and read pages, that are needed by BookMapWidget.
- ReaderToc: compute TOC max_depth.
- ReaderBookmark, ReaderHighlight: send events on
  bookmark add/update/remove so thumbnails of the
  pages impacted can be trashed.
2022-01-04 21:59:37 +01:00
hius07
eae07af157
Dropbox: upload file, create folder (#8610) 2022-01-04 13:29:08 +02:00
hius07
04763cdb18
ReaderHighlight leftover fix (#8609) 2022-01-02 21:16:34 +01:00
hius07
3450290af9
Bookmarks/Highlights: left button, show note in book (#8600)
Bookmark list: added title bar left button for multiple actions
Highlighted text: show note on tap
2022-01-02 20:09:53 +02:00
poire-z
b35c28e8b4
[Non-Touch] Don't add touch-related menu items (#8608)
They were ending up orphaned as "New:" in the top menu first tab.
2022-01-02 15:01:08 +01:00
hius07
dd07112de7
Filemanager select mode: add folder buttons (#8595)
"New folder" and "Folder shortcuts" buttons
2021-12-30 13:52:04 +02:00
hius07
b8d6455c3f
[UX] CloudStorage redesign (#8569)
Cloud storage redesign, including:
(1) show server type in the list of storages
(2) add new cloud storage with a "plus" button (requires #8564)
(3) when browsing in a storage, the "plus" button is changed to the "home" button, to return to the CloudStorage home screen.
2021-12-25 22:57:51 +01:00
hius07
d0dd1ee888
[fix] readerhighlight: "View HTML" was always disabled (#8573) 2021-12-21 14:57:19 +02:00
hius07
f83eee02dd
[fix] filechooser: disable long-press in select mode (#8567) 2021-12-21 12:04:20 +01:00
yparitcher
035be38430 Dispatcher: Set font
Closes: #8531
2021-12-16 15:32:40 -05:00
hius07
1df6ab751b
ButtonDialogTitle: no bold font in the title by default (#8557) 2021-12-16 14:46:53 +02:00
hius07
a703b213f7
File manager: group operations (#8536)
Copy/Move/Delete for group of files.
"Select files" button in the filemanager Plus menu.
2021-12-16 13:12:25 +02:00
hius07
3deac02b71
ReaderHighlight: don't highlight text when long-press disabled (#8541) 2021-12-10 11:06:16 +02:00
poire-z
301eb387e9 ReaderRolling: fix a few re-rendering issues
When switching screen rotation, have the re-rendering
properly done only via :onUpdatePos().
When changing alt status bar font size, also have it
done via :onUpdatePos() instead of the next painting
(this also update any dogear position after the resize).
When in scroll mode (no alt status bar), be sure to
draw crengine progress bar at top (and not below the
not shown alt status bar).
2021-12-07 23:56:55 +01:00
zwim
a001a13ab6
ReaderRolling: avoid ANR on Android when (re)rendering. (#8501)
Wrap document opening and re-renderings (which can block
the app for some time) with setIgnoreInput() to avoid ANR
on Android.
Any setting update that could possibly cause a re-rendering
should send the UpdatePos event, to ensure the re-rendering
happens in ReaderRolling:onUpdatePos() where precautions
are taken to avoid ANR.
2021-12-07 19:55:55 +01:00
poire-z
cc4009e88f
ReaderDictionary: merge dict & dict_ext results (#8523)
So the presence of a dict_ext and results from it
are transparent to callers.
(This fixes the warning log when dict_ext is there.)
2021-12-07 13:51:27 +01:00
hius07
19271c08c4
Checkbutton widget optimization (#8522)
-checkmark toggling is separated from the callback
-default width added
2021-12-07 13:35:44 +02:00
hius07
785eb5f3ef
Bookmark search (#8504)
From bookmark list, main menu and with a gesture.
2021-12-04 19:37:00 +02:00
Frans de Jonge
91c4aeb2e5
[i18n] Add context to CSS style vs highlight style (#8510)
Cf. <https://github.com/koreader/koreader/pull/8489#issuecomment-985319434>.
2021-12-04 12:51:38 +01:00
hius07
ad09411c3f
DoubleSpinWidget buttons move (#8490)
Move Default and extra buttons above Cancel/OK.
Default values shown in the default button.
Precisions can be set for both values separately.
Minor geometry fix for consistence with SpinWidget.
2021-12-01 12:42:54 +01:00
Dylan Garrett
7495ea29ef
InputDialog: add 'use_available_height' option (#8467)
Use it with bookmark edit, to allow entering longer notes.
2021-11-28 23:30:15 +01:00
Martín Fernández
3427c207b0
android: bump test activity (#8483)
Now users can test light drivers too. See https://github.com/koreader/android-luajit-launcher/pull/339#issuecomment-977822717
2021-11-25 22:04:09 +01:00
hius07
e66b26865b
Highlights backup fix (#8479)
Fixes opening book with old highlights, when (after deleting the last highlight on a page) empty table of highlights for this page was not deleted.
2021-11-24 19:14:13 +02:00
hius07
3a7cba38c2
Customize page turns tap zones (#8475)
Settings for page turn tap zones position (vertical or horizontal) and width.
2021-11-23 19:16:10 +02:00
hius07
1c9e21389d
Backup and restore bookmarks/highlights: fix logic (#8473) 2021-11-23 01:11:07 +01:00
Frans de Jonge
dc88fdc66d
[chore] Fix "Compact items" capitalization (#8465)
Follow-up to <https://github.com/koreader/koreader/pull/8424>.
2021-11-21 22:44:13 +01:00
Frans de Jonge
59d09f54f8
[bug] Don't translate empty strings (#8464)
Introduced in https://github.com/koreader/koreader/pull/8419

Unfortunately it's not just useless, but it causes some edge case issue.
2021-11-21 21:00:19 +01:00
hius07
0eeb8bd2b7
Backup and restore bookmarks/highlights when switching engines (#8455)
Bookmark/highlight formats in crengine and mupdf are incompatible.
This backups and restores bookmarks and highlights when opening the
document with an incompatible engine, instead of deleting them.
2021-11-21 20:41:58 +01:00
poire-z
6f2fdd96f8
[chore] Fix a few luacheck errors (#8461) 2021-11-21 19:33:09 +01:00
Aleksa Sarai
3461f8af31
Dictionary: disable fuzzy search when CJK words (#8458)
Fuzzy searching doesn't work with CJK text: with Japanese,
we get large numbers of useless results because sdcv
decides to strip off the wrong part of the word.
It seems unlikely that sdcv correctly handles Korean
or Chinese, so just disable fuzzy searching on all
CJK-containing word lookups.
2021-11-21 19:13:29 +01:00
zwim
8ef426d79f
ReaderMenu/FileManagerMenu: deduplicate Exit menu code (#8459) 2021-11-21 19:01:43 +01:00
zwim
1d92ee19fb
Navigation menu: cleanup, use colons in menu (#8442) 2021-11-21 18:47:00 +01:00
zwim
e56aae263a
AltStatusBar: cleanup, use colons in menu (#8436) 2021-11-21 18:45:59 +01:00
Frans de Jonge
c11ea4f389
[chore] Fix a few luacheck errors (#8460)
Inadvertently introduced in <https://github.com/koreader/koreader/pull/8432> and <https://github.com/koreader/koreader/pull/8445>.
2021-11-21 18:41:07 +01:00
hius07
217937a5bc
ReaderPaging/Rolling: deduplicate inverse_reading_order code (#8445) 2021-11-21 18:33:51 +01:00
hius07
c7229d90bc
ReaderHighlight: allow for 2-steps text selection (#8432)
Add a "Select" button in the highlight dialog to initiate
text selection; on the next text selection, the text between
these 2 points will be selected.
Limited to a single page with non-CRE documents.
Also move "Search" button at end, so it's the one that
will be wide in case of an odd number of buttons.
2021-11-21 18:31:10 +01:00
hius07
58c4db694e
readersearch: do not show regexp checkbutton in pdf (#8450)
Minor optimization.
2021-11-18 16:54:07 +01:00
zwim
89064487b7
ReaderDictionary: Colons in menus (#8431) 2021-11-09 20:15:52 +01:00
zwim
c6e415d646
[Status bar] Consistent menu entries; Add "centered dot" as separator (#8424)
* Consistent menu entries; Add "centered dot" as separator

* Menu entry: Colon
2021-11-09 19:08:41 +01:00
zwim
abcd989ec4
[Status bar] Add custom text to footer (#8419)
Allows to add any text to the status bar. Can be a placeholder (empty space) for better positioning of the indicators.
2021-11-09 19:04:44 +02:00
hius07
3dabbd5d73
Typeset menu: adds "Reset document settings to default" (#8412) 2021-11-07 19:29:53 +01:00
hius07
e6d2c1cae6
ReaderGoto: adds Go to % (#8395) 2021-11-07 19:26:07 +01:00
Aleksa Sarai
3fd931bb2f
readerhighlight: ignore cases where no text is selected (#8399)
It's possible for the user to have selected nothing, and trying to
operate on the nil highlight can cause confusion or crashes. This
restores the behaviour before commit 7a0e3d5e68 ("readerhighlight:
remove selected_word and use selected_text everywhere"), which missed
this case.

In addition, add some debug guards to ReaderHighlight methods which
cannot handle selected_text being nil (or at least, shouldn't be called
with selected_text being nil).

Fixes: 7a0e3d5e68 ("readerhighlight: remove selected_word and use selected_text everywhere")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-11-06 08:11:06 +01:00