Commit Graph

200 Commits (master)

Author SHA1 Message Date
hius07 d82815952e
Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
2 days ago
NiLuJe ac5d662eb4
Statistics: Also skip hidden flows stuff in continuous mode (#11284)
Followup to #11279
4 months ago
greatyingzi c12b4f2e14
Statistics: fix a crash in continuous mode opening statistics page (#11279) 4 months ago
NiLuJe 9ab866598a ReaderProgress: Ensure a sane dimen
Otherwise, depending on the DPI, the size computation might not cover
the full-screen, leaving gaps to what was behind the widget.

Fix #11177
5 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 5 months ago
hius07 2ed2c2c23d
md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
7 months ago
NiLuJe d039aa5f3a Statistics: Minor style-nit followup to #10968
Too late to avoid the whitespace diff churn, unfortunately ;).
7 months ago
hius07 517731dbbb
Finished books: freeze history timestamp and statistics (#10968) 7 months ago
poire-z f78a8c5315
Custom metadata: update Statistics db on metadata change (#10894) 8 months ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
8 months ago
weijiuqiao 416237e526
Statistics: Attempt to prevent rampant replication of null id_books (#10749)
And add an OTM block to do a cleanup pass on existing DBs (which might take a while if you're severely affected, because we've seen reports of DBs north of 2GB).
9 months ago
Frans de Jonge b8af326836
[i18n,plugin]Statistics: differentiate different types of 'reset' (#10621)
References <https://github.com/koreader/koreader/discussions/10479>.
10 months ago
Glen Sawyer 128f205324
[plugin] Statistics: fix sync caused by semicolon in SQL comment (#10503)
Follow-up to <https://github.com/koreader/koreader/pull/10498>.
11 months ago
Glen Sawyer 2aa11b13ad
[plugin] Statistics: sync the `last_open` field (#10498) 11 months ago
poire-z 2aeb4a87df
Statistics: fix ReaderProgress bad layout in RTL UI (#10389) 1 year ago
weijiuqiao 34c2dab54b
statistic.koplugin: fix today's timeline showing next day when within custom offset (#10299)
Continuing https://github.com/koreader/koreader/pull/10254#issuecomment-1494697269
1 year ago
poire-z 7c5c7bb9cf Calendar view's day view: thicker separator at 00:00
When using the new option "Daily timeline starts at",
make the separator line between 23:00 and 00:00 thicker.
Also tweak time picker to pick minutes by units of 10,
and remove max hour (06:00) limitation.
1 year ago
Piotrek Marciniak 2e630286df
Sync book statistics: add to dispatcher (#10285) 1 year ago
weijiuqiao 5648c942c1
Calendar view: add options to change start time of days (#10254)
Can be set for example to 04:00 to see after-midnight readings
with those of the previous evening in day timeline.
Also fix possible shifts in day start when crossing DST changes
with prev/next.
Also fix sorting (by reverse reading duration) of books at top
1 year ago
melyux 55259846a8
Fix N_() usages, rearrange a SQL select (#10146)
Fix some of my early blunders in using the `N_()` gettext function. Mini-PR from https://github.com/koreader/koreader/pull/9924#discussion_r1104298501 (@Frenzie).

There was also one line for generating this same `%1 (%2 pages)` text that confusingly uses different ordering in the SQL query output; switched the two SELECT arguments around to make it match the other 5 usages. Works the same as before
1 year ago
poire-z 81f2aed086 ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments,
and a file size large enough to ensure a cache file is used.
The idea is simply, on any rendering setting change, to
skip the rerendering of the full book and to defer any
rerendering to the moment we draw a DocFragment, and
render only it.
So, on a setting change, only the fragment containing the
current page will be rerendered, and the new fragments we
may cross while turning pages.
When having done so, KOReader is in a degraded state (the
full page count is incorrect, the ToC is invalid...).
So, a full rerendering is needed, and one will happen
in the background, and when the user is idle, we reload
seamlessly and quickly from the cache file it has made.
ReaderFlipping will show some icons in the top left
corner to let it know at which steps in this procress
we are.
1 year ago
melyux 8b99c50b2d
Duration format: add "Letters" format (1h30m10s) (#9924) 1 year ago
hius07 ee75abd4a0
Statistics: show correct number of notes in a book (#9928) 1 year ago
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.
1 year ago
melyux b1bbd590db
Statistics: cleanup and tweaks (#9904)
Many tweaks (alignment, dates...), reordering and
rewording in "Current statistics", per-book stats,
and Reading progress.
1 year ago
poire-z 24a3c722c8
Calendar view: properly use datetime module (#9893)
No need to pass the translations from main.lua
to calendarview.lua.
Also use datetime translations in ReaderProgress.
1 year ago
weijiuqiao 49d8ec2f4f
Cloudsync: dropbox token re-generation (#9862) 1 year ago
zwim 192a243b4d Add datetime.lua
Move date and time related functions from util.lua
(and the statistics plugin) to a new datetime.lua.
1 year ago
poire-z b1f77ac085
Calendar view's day view: tweak SQL data extraction (#9834)
Ensure any reading at 0h00 or 23h59 looks like it
continues from previous or to next page if DB data
seems to indicate so.
1 year ago
poire-z 3ef2811e59
Calendar view's day view: visual tweaks (#9832)
- Add vertical lines every 10mn
- If today, show an arrow indicator at current time
- Add "Today's timeline" to menu
- Rename badly named self.hour_width, which is a height
1 year ago
weijiuqiao 1c42641733
Calendar view: fancier day details with timeline (#9813) 1 year ago
weijiuqiao 81b2f22b04
ReaderStatistics: fix sync sql command (#9811)
Fixes sync sql command that uses left join instead of
inner join, which adds unnecessary comparisons and
might result in incorrect mapping between databases.
1 year ago
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.
2 years ago
weijiuqiao 74eb001eca
Calendar view: adjust color palette to avoid pure black bars (#9739) 2 years ago
NiLuJe f58d1c0449
Cleanup: Track color constant name change (#9716)
* Bump base

https://github.com/koreader/koreader-base/pull/1547
https://github.com/koreader/koreader-base/pull/1548
2 years ago
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).
2 years ago
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.
2 years ago
NiLuJe d2ac2ca6e7 Cleanup: Remove unused onAnyKeyPressed handlers
And simplify the few we do catch by using aliases instead of duplicated
functions;).
2 years ago
zwim 4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2 years ago
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.
2 years ago
hius07 c5505879c3
ConfigDialog: fix bug in DoubleSpinWidget default values (#9580) 2 years ago
poire-z d352579d06
BookMap: allow tap on ToC titles and outside page slots (#9400)
This helps jumping to page when ToC chapters are short
and the bookmap page rows narrow.
Also fix crash when invoking BookMap and PageBrowser
on a PicDocument (considered DocLess by Statistics).
2 years ago
zwim 081bc6784f
[plugin, statistics] simplify ReaderProgress for better translations (#9113) 2 years ago
zwim d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2 years ago
NiLuJe 23cd7e24bb
Minor Lua I/O cleanups (#8921)
Mostly making sure we always explicitly close io handles.
2 years ago
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
2 years ago
hius07 59f04ab018 ReaderProgress: insert TitleBar 2 years ago
hius07 77d3882eed CalendarView: remove close button! 2 years ago
hius07 605b09afbe CalendarView: remove unused CalendarTitle 2 years ago
poire-z c627dfd63f ReaderStatistics: avoid self.kv leaking after close 2 years ago