2
0
mirror of https://github.com/koreader/koreader synced 2024-11-02 15:40:16 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
weijiuqiao
e19bed3371
VocabBuilder: fix and improve non-touch device experience (#12030)
Fix #12026.
2024-06-16 13:10:37 +02:00
hius07
ded709e3a1
InputContainer: consistent input type in onInput() (#12012) 2024-06-15 09:54:17 +03:00
nairyo
c7a59145a3
[fix] VocabBuilder: restore erroneously removed onShowVocabBuilder function (#11915)
Fixes #11913.
2024-05-27 20:17:00 +02:00
nairyo
126c01e1b5
Replace tweak_buttons_func with an event instead (#11777)
Also see https://github.com/Ajatt-Tools/anki.koplugin/issues/22
2024-05-16 20:44:01 +02:00
weijiuqiao
5939c82bcf
VocabBuilder.koplugin: support batch operations in book filtering (#11475)
Added support
1. Select only this book
2. Select all books
3. Select all books on this page
4. Deselect all books on this page 

when filtering.

Ref. #11471
2024-02-18 09:37:57 +01:00
hius07
e9051353a2
Vocabbuilder: fix docless title (#11008)
Closes #11006.
2023-10-14 17:56:14 +02:00
hius07
1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
2023-08-30 07:53:59 +03:00
poire-z
f0122cf457 Button: handle 'width' as the final outer width
All our widgets are considering their provided 'width'
as the outer width, except Button which considered it
as some 'inner width', to which padding/border/margin
were added. Let's have them all consistent.
Some other widgets using Button had tweaks to account
for that odd behaviour: fix and simplify them.
Also fix Button layout when text is left aligned.
2023-03-23 20:28:38 +01:00
weijiuqiao
6267249b1e
vocabbuilder: fix reset word progress bug (#10195)
fixes #10194.
2023-03-12 08:35:16 +01:00
NiLuJe
45a4aac3d3
Notification: Fence the *display* update in an attempt to avoid upsetting some boards... (#10083)
Re: https://github.com/koreader/koreader/issues/9806#issuecomment-1416827447

Depends on https://github.com/koreader/koreader-base/pull/1576

Includes assorted cosmetics tweaks related to duplicate `setDirty` calls when instantiating widgets that already have an `onShow` handler doing it. (I left widgets doing it in `update` instead of `init` alone, on the assumption that callers *may* be relying on that behavior when updating widgets at runtime. This might actually never matter, and it certainly didn't for ScreenSaverWidget, which is why I removed it from there ;p).
2023-02-07 01:01:05 +01:00
NiLuJe
21210800c1
ReaderFooter/Header: Refine autorefresh repaint-or-not checks (#10045)
Use both a whitelist for targeted widget repaints, a blacklist for no repaint at all, and a fallback for a full in-order ReaderUI repaint when unsure.

Use a similar approach in ReaderHeader (i.e., prevent explicit refreshes while ReaderMenu is open).

Re #9979, re #9768
2023-02-02 00:29:23 +01:00
Glen Sawyer
932ed44a9f
[plugin] Statistics: do not increment db sequences unnecessarily during cloud sync (#9921)
When you do an insert using either ON CONFLICT [...] DO NOTHING or INSERT OR IGNORE to prevent duplicate rows, sqlite still increments the sequence counter for each of the duplicate rows that it did not insert.
The only way around that is to explicitly write the SQL statement so that it doesn't try to insert the duplicates in the first place.
2022-12-16 21:14:49 +01:00
weijiuqiao
a76f3f5bf5
Vocabulary builder: add search ability (#9881)
And allow circle multiswipe to reload words.
2022-12-11 10:11:43 +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
weijiuqiao
e8983d335d VocabBuilder: fix not updating book title in the more dialogue when the book title is changed but not reassigned. 2022-11-16 22:51:38 +01:00
weijiuqiao
77e0ac57de
Vocabulary builder: make a word's book title changeable (#9776)
Adds the ability to re-assign which book a word belongs to
and change the name of an existing book. It can be used as
a way to regroup words and hide/show them by book.
2022-11-12 21:22:58 +01:00
weijiuqiao
5082289aad
Vocabulary builder: allow longer intervals (#9764) 2022-11-12 21:20:54 +01:00
weijiuqiao
678d0c911c
Vocabulary builder: safer db migration (#9702)
Refactor db migration to allow restarting from
an intermediate stage.
2022-11-12 00:00:38 +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
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
weijiuqiao
6bd7dfdf41
Vocabulary builder: add "Open..." to Dispatcher (#9634)
So it can be called from a gesture.
Also accommodate reset all in reversed order.
2022-10-25 12:27:07 +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
weijiuqiao
7fc803ffee
Vocabulary builder: supports review in reverse order (#9605) 2022-10-12 23:45:29 +02:00
zwim
4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +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
weijiuqiao
24edbe162f Vocabulary builder: support manually adding words to vocabulary builder 2022-10-03 01:23:00 +02:00
weijiuqiao
5d9f036331
Vocabulary builder: add Undo study status (#9528)
Adds button to undo last study operation (got it/forgot)
in more (...).
2022-10-02 02:03:23 +02:00
weijiuqiao
30915546f0
vocabbuilder.koplugin: always show more button, add book filtering (#9393)
Always show more button instead of delete regardless of review count per #9383.
Adds book filtering per #9256 (from menu or by swiping up).
2022-07-31 09:02:09 +02:00
weijiuqiao
9980827145
Vocabulary builder: fix translatable string and minor UI issue (#9233) 2022-06-25 20:40:37 +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
weijiuqiao
18db85ea0d
[plugin] Vocabulary builder bugfix and quick word deletion (#9168)
This PR fixes the bug #9162 caused by unsafe db operation and adds an edit mode for quick deletion of words requested at #9132 (comment)
2022-06-04 14:54:58 +02:00
weijiuqiao
ee6197efff
[fix, plugin] Vocabulary builder: prevent resetting changes when reviewing backwards (#9161) 2022-06-03 09:52:39 +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