Commit Graph

38 Commits (99045b431104904d3391a3d5ed01566356f76c24)

Author SHA1 Message Date
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
ezdiy fd31bcc5fd
Make UIManager track prevent/allowStandby state. (#6558)
Conversely, Trapper and plugins report standby interruptibility.
4 years ago
Frans de Jonge 3b69ea690c
[chore] Proper plurals in CoverBrowser processing (#6483)
As reported by @lescheck on Weblate

> I think this should be in plural form (because of second line)
4 years ago
Frans de Jonge 4c70e6cb56
[fix] Add plural string for number of books (#6431)
Reported by https://hosted.weblate.org/user/leschek/
4 years ago
poire-z 687074fa1f
CoverBrowser: fix "Extract and cache" crash (#5874) 4 years ago
NiLuJe 80c1e5290c
File search & BookInfo: Don't traverse hidden folders if we're not showing them (#5816)
* File search: Don't traverse hidden folders if we're not showing them

Re https://www.mobileread.com/forums/showpost.php?p=3949194&postcount=21

* Ignore macOS resource forks, too.

* Apply the same logic to the BookInfo directory walker

* And never ever show resource forks in the FM, either.
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
Robert 371e3336a5 [feat] Favorites: organize book into collections (#5527)
View, add, remove, sort, open book to/from collections.
For now, only one collection named Favorites.
5 years ago
Frans de Jonge ba8099f906
[lang] Miscellaneous improvements (#5263)
Some grammar/style, some fixes.
5 years ago
Frans de Jonge 6ed58346a1
[i18n] Add translator notes (#5250)
Thanks to <https://github.com/koreader/koreader/pull/5237> we can now  extract the knowledge currently embedded in Transifex and put it directly in our source. This positively affects <https://github.com/koreader/koreader/issues/3754>.

Translation instructions and knowledge that comes out of localization-related questions should be preserved in the source, because Transifex is too ephemeral. For example, the links from <https://github.com/koreader/koreader/pull/2290> are no longer accessible. Even when they are, it's quite useful to have this information around while dealing with the code as well, and I also hope it'll be informative to contributors who seldom visit Transifex.

This commit also makes a few minor changes to obviate the need for comments where possible.
5 years ago
Frans de Jonge da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

Docker image update in https://github.com/koreader/virdevenv/pull/43

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
NiLuJe e2961097e7
Don't use WAL on devices where it's not supported (#5162)
(i.e., truly ancient kernels and weird FS).

In which case, we use TRUNCATE, which might be a tad less terrible than
DELETE on said weird crap FS.
5 years ago
Vani Ramakrishnan 08fa5e2f17 Info message typo fix (#5003)
"succesfully" => "successfully"
5 years ago
poire-z 17f07e755f CoverBrowser: speedup "View full size cover"
It was doing a full document load to get the cover. It now does
the faster "only metadata" load.
Also move the trick of setting a default font in CreDocument, so
that all callers of document:loadDocument(false) benefit from it.
Prevent crash when no cover image is available (even if the cache
says it has one, the file may have been updated and doesn't have
it anymore).
5 years ago
poire-z ad7dc86a43 CoverBrowser: fix a few "Extract and cache" issues
Ignore path and cover specs when last invoked menu
was History.
Fix InfoMessage size, broken by InfoMessage auto resize.
5 years ago
NiLuJe 6c29b7da65 [fix] PicDocument: Pass a copy of image_bb in getCoverPageImage() (#4628)
Avoids a use-after-free in mupdf.scaleBlitBuffer

Fix koreader/koreader-base#821

Thanks for the hint, @poire-z ;).

* As @poire-z suggested, the original unscaled bb should probably be free'd.
5 years ago
NiLuJe 812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
5 years ago
poire-z 335a513826 [chore] cleanup multi-lines translatable strings
Revert 9971eb85 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)
5 years ago
poire-z 9971eb8533 Fix untranslatable strings (#4132)
Some problem somewhere with [[...]] strings starting with a
leading newline. Should probably be allowed, but for now
fix the few such cases to allow them being translated.
6 years ago
NiLuJe 0924b57877
Tweak/unbreak my CPUFreq experiment (#4119)
* Only switch to ondemand when we actually can, and when it's better than the current governor...
  This potentially leaves Mk.5 in the lurch, but there's no perfect solution there :/.

* Switch to UI for the unmark event of navigation hints markers
Might help on non-REAGL devices, and doesn't hurt there (re #3983).

* Switch SQLite DBs to WAL
Sounds nice in theory, behaves fine in practice.
6 years ago
poire-z d8d0def122
Floating punctuation: change default to disabled (#4101)
It was enabled by default, but it's mostly only needed for CJK users.
Furthermore, when floating punctuation is enabled, some rendering
issues exist (text right alignment, variable margins...) that
only CJK developpers could really fix. So, best to disable it and
avoid these rendering issues for most users.

Also: fix CoverBrowser crash when "Delete cache database"
followed by "Prune cache of removed books".
6 years ago
poire-z 7666644362
Bookmarks, CoverBrowser: scale dogear icon (#4081)
The Dogear icon is 20x20 pixels and was never scaled where used. Now:
- The bookmark icon (top right of screen) is scaled to 1/32th of the screen
width (previously, it was 1/30th on a 600px wide emulator, 1/53th on a GloHD).
On CreDocument, furthermore decrease its size if needed depending on the
selected margins so it never overwrite the text.
- CoverBrowser list view: scale it to the available room under
the "N % of P page" text, so it does not cover "page".
- CoverBrowser mosaic view: scale it to 1/16th of the cover rectangle, which
should prevent if from overwritting the text thanks to a max text width of
7/8 of the cover rectangle.

Also for CoverBrowser: don't index metadata for unsupported document
(which could happen when browsing files with PathChooser) and show
full filename for such documents.
Also: ImageWidget: small fix in case we use both scale_factor and
scale_for_dpi.
6 years ago
poire-z 4bb3999cbc RenderImage: factorize all image rendering and scaling code
New module RenderImage (alongside existing RenderText) to provides
image rendering and scaling facilities.
Uses MuPDF, but tries first giflib on GIF.
Allows for getting all the frames from an animated GIF.
6 years ago
poire-z b3b7e3d279 Remove some leading and trailing newlines (#3768)
in some InfoMessage and ConfirmBox, introduced willingly
or not, that cause top or bottom padding
6 years ago
poire-z 04350a8409 coverbrowser: fix some texts (#3764) 6 years ago
poire-z 9858060c56 [lang] coverbrowser: fix some texts (#3759) 6 years ago
poire-z 9849d89f0e
coverbrowser: allow for batch metadata extraction (#3750)
This adds a button to the Tap Plus menu, that allows
extracting metadata and cover images for books in
current directory. Info about the process and questions are
initially shown and asked, and the process can be aborted at
any moment.
6 years ago
poire-z db31bd4b96
coverbrowser: quicker extraction of EPUB metadata (#3736)
bump crengine:
Allow for quicker loading when interested in metadata only.
Allow for more than 65535 different attribute values.
Increase gamma values range.
6 years ago
poire-z fdb8dfd295
Set default 'cre_storage_size_factor' also in coverbrowser (#3733) 6 years ago
poire-z 3c857e4016 coverbrowser: keep up to date with recent core changes (#3707)
Remove the subprocess management functions from xutil.lua, as they were
moved into base/ffi/util.lua, and use them from there.
Also use the cre_storage_size_factor setting when processing credocuments,
to avoid CRE WARNING while indexing too.
Fix dealing with MuPDF document opening failures (previously, these
were not noticed and indexing was retried each time).
6 years ago
poire-z 7797c2369e
credocument: deal with loadDocument() failures (#3570)
cre:loadDocument() may fail in recognizing the document format, and
koreader would previously keep calling other methods on it, which would
make crengine segfaults. We now check loadDocument success at the
various places it is called, and try to deal the best way we can when it fails.
6 years ago
poire-z c15915a4ee Added util.getFriendlySize() (#3381)
* Added util.getFriendlySize()

* Allow for GB
7 years ago
poire-z b55265ba91 CoverBrowser: avoid crash when indexing some cre documents (#3293) 7 years ago
poire-z e350e0e35a CoverBrowser: use a cache for crengine books extraction (#3277)
We previously disabled cache, but that may cause excessive
memory usage with big books. We now use a temporary
cache directory, that we clean when no more needed.
7 years ago
poire-z 48d888bedb CoverBrowser: use MuPDF for down-scaling images (#3272) 7 years ago
poire-z 031df2ffee Added PicDocument:getCoverPageImage() and :getProps()
So an image file can have a cover in coverbrowser's display.
It also allows for an alternative viewer (ImageViewer widget)
when holding on file / View full size cover.
7 years ago
poire-z 3b5cd4c23b CoverBrowser plugin: alt views for File Browser and History (#2940)
* CoverBrowser plugin: alt views for File Browser and History

* Added Prune cache and Compact cache menu actions

* Support for book descriptions, and settings stored in db
7 years ago