Commit Graph

614 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
poire-z b90f6db876 GestureDetector: add Tap interval setting, to avoid bounces
Also fix info_text not displayed, and add more
descriptive ones.
4 years ago
NiLuJe 11aeef7483
Don't shadow gettext (#6799)
(Fixes the "current book" stats page)
4 years ago
ezdiy 893909146d
Pocketbook: use raw input I/O (#6791)
This allows for better energy efficiency (no more 50Hz tick poll),
as well as lower input lag / higher precision - touch events are
native linux ones.

In addition, auto off/suspend plugin is used in this mode, as we need
to trigger (timed) sleep / poweroff on our own, since the OS ones
will no longer work whenever koreader has focus.

This is for rooted devices only, and possibly somewhat FW
specific, so enabled only on PB740-2 where it's reasonably tested.
4 years ago
ezdiy 5e231d759a
Bump base for sqlite. (#6796)
& make CI happy.
4 years ago
NiLuJe dfe3502b91
ReaderStatistics: Data collection improvements (#6778)
* Update the data collection format & handler to make it much less tortuous
* Update the pagecount & resync the stats on document layout changes
* Update the database schema to allow doing most queries against a SQL view that rescales the collected data to be accurate regardless of document layout (thanks to @marek-g for the SQL magic ;)).
* Add a "reset stats for current book" entry in the list of reset options, one that won't horribly break stats in said book ;).
* Fixed a couple of resource (SQL connection) leaks (in ReaderStatistics:getCurrentBookStats & ReaderStatistics:getCurrentBookStats).
* Flush stats to the DB on periodical metadata saves.
* Minor cosmetic tweaks to the code
4 years ago
NiLuJe b932b97b20
A few reMarkable QoL fixes (#6772)
* Enable AutoSuspend plugin on rM

Fix #6769
Re: #6028

* Use the PowerEvent handler on rM

It makes much more sense than the fire & forget & hope for the best
approach copied from the Kindle platform, because we *are* controlling
suspend ourselves (mostly), unlike on Kindle ;).

Fix #6676

* Enable HW inversion on the rM

I mean, we kinda forgot to ever test that, but I don't really see why it
wouldn't work ;).
4 years ago
ezdiy b8fa553407
Actually set sorting hints in plugins (#6770) 4 years ago
Marek Gibek 6b90239e7c
Statistics plugin: fix in-memory statistics. (#6759) 4 years ago
Galunid 8761181cd5
KOSync improvements (#6733)
* KOSync - allow automatic WiFi enabling, when user requested progress update

* Add "Sync every # pages" setting to menu

* Get rid of unused default variable

* Simplify logic
4 years ago
NiLuJe ec3ec8dc21
Show full ToC entry on hold (#6729)
Fix #6728
4 years ago
ezdiy 7a40b496fb
blitbuffer: fixups for base (#6714)
fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
4 years ago
yparitcher 34b3d5541d Gestures/Profiles: make sure dispatcher is initalized
even when the menu is not opened. this was causing a crash when the event name was parsed from creoptions
4 years ago
ezdiy 2afec592f8
Autostandby: Fix wrong assumptions about instance liveness. (#6666)
Got instantiated multiple times, when our state is meant to be global.
Fixes #6647
4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
NiLuJe 592e4f42df
Hilariously simpler fix for #6616 (#6650)
* Hilariously simpler fix for #6616

Reverts #6648 for a much, much simpler solution, that will actually
cover every possible situation automagically.
4 years ago
Frans de Jonge b031d1c359
[Plugin] BatteryStat: consumed → charged for charging (#6646)
Closes <https://github.com/koreader/koreader/issues/6057>.
4 years ago
smartscripts-nl 4e281f00ed
Dispatcher: adds Show terminal (#6626) 4 years ago
Frans de Jonge d7aa626ee8
Fix order of requires 4 years ago
smartscripts-nl 20ddad2951
Terminal: add shortcuts for re-useable commands (#6609)
To be able to quickly repeat often used terminal commands
4 years ago
poire-z 869e4ce1e3 CoverBrowser: list mode: show last read date for deleted files 4 years ago
ezdiy 8f8daa9dfb
PocketBook: Auto-standby plugin fix (#6612)
Fix "accessing undefined variable" in previous commit.
4 years ago
ezdiy 724d3aa5ff
PocketBook: Auto-standby plugin (#6602)
Adaptively pins the auto-standby UI lock. When frequent input
from user is observed, we'll prevent for increasingly longer
periods of time, and revert back to more aggressive standby
with infrequent input (infrequent taps when reading a book).
4 years ago
poire-z 962fd02c98
Tame BackgroundRunner: stop running when no more job (#6605)
A BackgroundRunner plugin instance will stop running
(rescheduling a check every 2 seconds) when there is no
(or no more) job to run.
Clients of this service now have to emit an event after
adding a job into PluginShare.backgroundJobs, so an
already loaded but stopped BackgroundRunner can notice
it and start running again.
4 years ago
smartscripts-nl 0e7f1ba317
Dispatcher: adds Texteditor: open last file (#6600) 4 years ago
ezdiy fd31bcc5fd
Make UIManager track prevent/allowStandby state. (#6558)
Conversely, Trapper and plugins report standby interruptibility.
4 years ago
smartscripts-nl 4cff623244
Terminal: support multiple lines and make it re-invokeable (#6599)
With this changes you can enter multiple lines with commands and after viewing the output you can re-invoke the terminal with a button
4 years ago
poire-z 85a16d0064 Open with: add Text Editor plugin 4 years ago
poire-z cfa45f8d88 History: show last read date instead of file size
In classic and list display modes.
4 years ago
poire-z ed6bc1fb31 CoverBrowser: list mode: show fake cover when no cover
Also prevent very long directory names from overflowing
over neighbour items.
Also bump base for lua-ljsqlite3 to use sqlite3_close_v2()
and avoid possible crashes.
4 years ago
Frans de Jonge 671ea00a2f
[lang] Update Goodreads API key instructions (#6542)
Closes <https://github.com/koreader/koreader/issues/6539>.
4 years ago
Galunid 85b498d76e
Revert "Kosync network callback (#6489)" (#6535)
This reverts commit d90e221a17. Reverts #6489 since it introduced problems for people having [*]Auto sync now and in the furture & Action when wifi off: prompt.
4 years ago
Galunid 9fa043e227
Use already entered values instead of defaults if not specified in perception expander (#6518) 4 years ago
Galunid d90e221a17
Kosync network callback (#6489) 4 years ago
yparitcher 986f45871a
Dispatcher: show selected number (#6472)
followup to #6441
4 years ago
Galunid d1018d2e4a
Make "Auto sync now and future" persistent (#6488)
Currently this setting applies only to the current KOReader instance. It
gets reseted after KOReader restart.
4 years ago
Martín Fdez 8198b2bcc3 initialize inbox dir 4 years ago
Galunid 55a5f0c1a3
Cleanup after #6449 (#6484)
* Better description in spinwidget
* Rename SpinWidget title from "Hold pan rate" -> "Text selection rate"
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
Galunid 627716db9c
Allow setting text selection rate (#6449) 4 years ago
yparitcher 7583571707
Dispatcher Gestures Profiles: only flush settings when changed (#6471) 4 years ago
yparitcher 2d8c50708f
Fix gesture migration when user never had custom multiswipes (#6467) 4 years ago
yparitcher 9e0ac734ba Gestures: Refactor to use Dispatcher 4 years ago
yparitcher 2a99b014a2 initial refactor of ReaderGesture into Gestures plugin 4 years ago
poire-z 65d9f4f6e4
CoverBrowser: delay GC for quicker browsing/exiting (#6453)
Slow browsing and exiting (ex: closing History) could
be noticed when the memory usage is already high (as the
GC has a lot of memory to visit). Delaying it to after
the new screen is shown limits the feeling of slowness.
4 years ago
yparitcher 87b1f0c1f2
simplify Dispatcher (#6435)
there is no need to pass the caller rather just the table where the setting is located. passing the setting alone is not enough as sometimes it is nil and then you do not get a reference to its location
4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
Frans de Jonge e23f68e5f7
[fix] Statistics: allow for proper translation of plural (#6437)
Reported by @leschek
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
Frans de Jonge 4c524de472
Fix typo (#6425)
Reported by https://hosted.weblate.org/user/leschek/ on Weblate
4 years ago
Frans de Jonge da507f8607
[chore] Update MD5 calls with new sha2 library (#6411)
Depends on <https://github.com/koreader/koreader-base/pull/1149>.
4 years ago
yparitcher 783103b488
Perception expander: disable margin increase when set to 0 (#6377)
Closes #6376
4 years ago
yparitcher bda44a99ef
Dispatcher: use sections (#6364)
use `device` `filemanager` `rolling` and `paging` sections to organize the
dispatcher menu and allow the user to know when the action will apply

add events from ReaderGesture

allow profiles in FM
4 years ago
yparitcher 70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
4 years ago
Martín Fernández 1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
4 years ago
Frans de Jonge ac1fa5d677
[plugin] Wallabag: Make remove from history consistent with deletion (#6320)
Finished is a specific status distinct from 100% read.

Also reorganize the menus slightly.

Closes <#6316>.
4 years ago
Galunid 37cf106fce
EvernoteOAuth set logger (#6308)
evernote-sdk-lua#4 to logger.dbg, instead of default print
4 years ago
Frans de Jonge 8ea7a1354a
[chore, plugin] Simplify Wallabag http.request handling (#6307)
See <https://github.com/koreader/koreader-base/issues/594#issuecomment-484233915>.

LuaSocket takes care of everything now, so all similar code can be simplified.
4 years ago
Martín Fdez d91d2d72d7 disable background runner on android 4 years ago
Frans de Jonge 1abaa39c27
[plugin] Add menu separators to Evernote menu (#6294)
This makes the menu structure slightly clearer.
See <https://github.com/koreader/koreader/issues/2778#issuecomment-647324742>.
4 years ago
yparitcher a9d4e97115
[plugin] Dispatcher: for profiles & gestures (#6106)
add a Dispatcher module that allows for dispatching multiple events at once.
This will allow for profiles & for gestures that do multiple things.

it has 2 methods:
Execute which is given a kv table of settings to change and fires an event for each of them.
addSubMenu adds a menu item to a menu to allow for modifying which events are called
it also has settingsList which is a master table of all allowed setting and their corresponding info
(it is mostly from ReaderGesture and needs a lot of work)

to allow for a new setting all one has to do is add a entry to settingsList with a corresponding event and it will work out of the box.

the profile plugin is right now still a stub, just to test Dispatcher. the plan is to finish it and eventually refactor ReaderGesture to rely on this.
This also needs effort to move many functions out of reader gesture into events where they belong.
4 years ago
Martín Fernández 83cde64bcc
unified calibre plugin (#6177)
joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
4 years ago
Galunid cd440acdc4
Add chapter title when exporting notes in Evernote (JSON/HTML, remote) (#6146)
closes #4566
closes #6138
4 years ago
Martín Fdez d6e87a111a coding style + comment 4 years ago
Martín Fdez a488cc57bc duh 4 years ago
Martín Fdez 835f9f62c6 fix ANRs in Kosync plugin login/register 4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
Frans de Jonge 19b15462b2
[plugin, UX] Wallabag: aid with setting up missing information (#6262)
The MultiConfirmBox indicates which settings are still missing and offers you a quick way to get to them.

Cf. <https://github.com/koreader/koreader/issues/6129>.
4 years ago
Frans de Jonge 04a5e2acfa
[fix, plugin] Wallabag: add quiet option to callAPI() (#6252)
Dumb lazy workaround for <https://github.com/koreader/koreader/issues/6251>.
4 years ago
Mikolaj "lich" H b741fcebac
[NewsDownloader] Added an HTML filter through a CSS selector (#6228)
Fixes #6185.
4 years ago
poire-z c65c33d75f
Statistics: some fixes, reordering and rewording (#6194)
- Fix wrong values for books opened (or first opened)
  from April 14th to May 20th: highlights and notes
  possibly being NULL was preventing nb of pages and
  last_open from being fetched.
- Re-order current book and all books stat items to some
  hopefully more sensible order.
- Some rewording for clarity.

KeyValuePage:
- Have value_overflow_align="right" only align right
  when value overflows 1/2 screen width, but not
  when only key overflows that.
- Show truncated text also on Tap when there is no
  callback.
4 years ago
mwoz123 395e65f749
Add Wallabag queue (#6170)
See https://github.com/koreader/koreader/issues/6119#issuecomment-624329183
4 years ago
poire-z 39345704ec
Statistics: fix number of highlights (#6173)
This number might have been leaking from a previously opened
book, and can be innacurate.
Reset it from the number of highlights stored in settings.
Note that the number of "Notes" shown does not mean much.
4 years ago
mwoz123 0e2b430796
Fix/exit dir (#6163) 4 years ago
poire-z e5206922c6 [UX] Normalize SpinWidget and DoubleSpinWidget
- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
  when appropriate: when the value may have an immediate
  visual effect, so one can tweak it without having to
  go thru menus to re-open it again).
4 years ago
poire-z 46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
4 years ago
Robert 3f874f0d1f
[Gesture] Add progress sync gesture (#6103) 4 years ago
mwoz123 d5bc235270
Send2Ebook: close document on going to folder (#6118) 4 years ago
poire-z eaabc42ea9
[Plugin] Fix move to archive plugin names (#6113)
Mismatches in these names prevent this plugin from being disabled'able. https://github.com/koreader/koreader/pull/6101#issuecomment-623131390
4 years ago
mwoz123 ce3bf473da
Add move to archive plugin (#6101) 4 years ago
Roland Coeurjoly e5b2c2953b
Add support for exporting highlights in JSON format (#6067) 4 years ago
Robert b4f3f177ca
kosync - new string methods (#6089) 4 years ago
mwoz123 8b4f1ca42e
Wallabag remove from history setting fixes (#6059) 4 years ago
mwoz123 0b52fe9771
Wallabag remove from history setting (#6048)
Solves: #5045
4 years ago
poire-z ba4e175ee6
Statistics: fix md5 leaking between newly opened books (#6052)
Which could cause a same book appearing multiple times
as different entries in statistics.
4 years ago
poire-z 635f784dfd [UX] Gestures: add action "Statistics calendar view"
Also flush current stats when showing calendar view.
4 years ago
mwoz123 904a61009d
plugins/NewsDownloader: add never download images (#6003)
Closes #5924.
4 years ago
poire-z 55d7109042
Terminal plugin: a few tweaks (#5985)
- Show output in a TextViewer with a monospace font.
- Include stderr, so errors are shown
- Use Trapper to allow interrupting command (and to fix
  some refresh issues)
4 years ago
yparitcher e9d0c7a96e
[fix] don't crash when enabling statistics on new book (#5971) 4 years ago
yparitcher 08359ee1b6
[UX] Next/Previous Bookmark Gestures (#5968)
Fixes #5965
4 years ago
poire-z e6612eefe1 CoverBrowser: fix no content with Pathchooser in RTL UI
Really needed these :resetLayout() (as done in Menu.lua)
when stuff is right aligned (otherwise, first computation
of x-offset, when there was no content, being Screen.width,
would stick, and would draw the content off-screen on the
right - no issue noticed when left-aligned as the offsets
would stay being 0 whether there is content or none).
4 years ago
Martín Fernández 825b22dd6b
kosync: validate username and password against empty/blank strings (#5894) 4 years ago
poire-z 687074fa1f
CoverBrowser: fix "Extract and cache" crash (#5874) 4 years ago
poire-z c2a5d3f3f3
FileManager: tell plugins to save settings on close (#5872)
So that Statistics settings modified while in FileManager
are saved.
Also allows resetting statistics when in FileManager
(where there is no current book id to exclude).
4 years ago
poire-z 95d18fe8d9
Statistics: revamp settings, add calendar settings (#5867)
Also adds options to remove statistics for books
with low reading duration (to clean up stats for
books just quickly browsed and not yet read).
Also adds TextWidget:getFontSizeToFitHeight()
even if we ended up not using it.
4 years ago
poire-z 3ca46577bf
Statistics: new Calendar view (#5854)
Also fix RTL UI mirroring in OverlapGroup when
overlap_offset are used.
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
Frans de Jonge 668eee97fa
[CI] Add curly braces check (#5809)
Update shellcheck and shfmt to the latest version.

Fixes <https://github.com/koreader/koreader/issues/5152>.

Btw, you can apply shellcheck suggestions with a command like:

```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
4 years ago
Mustafa Ali Mutlu 2736661bfc [fix, plugin] Evernote exporter only writes one documents clippings when txt export used, rest is ignored (#5774)
fixes #3690
4 years ago
poire-z c449d0ad1e [UI] Render metadata text with book language
Gives the book language to Text*Widget (and XText) when
drawing title, authors and other metadata text.
Might be needed to properly display a Japanese book title
when the UI language is Chinese.
4 years ago
Mustafa Ali Mutlu 1a7fa9f9e4 [fix, plugins] Evernote: confusing info/error message when exporting bookmarks (#5765)
Remove unnecessary all_count == 0 check, because of it no condition holds true.
4 years ago
Rafael Fontenelle 4e5779199d [plugin] fix netsh command (#5744)
The edited `netsh` command line had errors:
1- missing v4tov4 (or v6 variant)
2- should have `=` instead of `:`
3- typo in listen(ing)address and listen(ing)port
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
Frans de Jonge e3fa9bd4b8
[fix] Various minor string issues (#5719)
Fixes <https://github.com/koreader/koreader/issues/5712>.
4 years ago
poire-z 908151a3b0 [feat] Adds Document> Auto-save book metadata sub-menu (#5687)
Replaces DAUTO_SAVE_PAGING_COUNT in defaults.lua with
a new option available in menu, that allows setting
an interval in minutes instead of a page count.
4 years ago
poire-z 1d55afac67 CoverBrowser: Mosaic: better words wrap in text covers
Update words wrapping tweaks for use_xtext: add zero-width spaces
around dots and underscores to allow more wraps.
Fix overlap of directory name and nbitems for long directory names.
4 years ago
Mustafa Ali Mutlu 7b0b5d5ba7 [fix] Crash when exporting notes (#5677)
Fixes https://github.com/koreader/koreader/issues/5609
4 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
  side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
  of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
  and menu footers
- flip inverse_reading_order when UI is mirrored

More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
  has changed (tap on top/bottom left/right corners, for
  bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
  in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
4 years ago
poire-z d6d49a64a7 [RTL UI] use auto or LTR text direction in some specific cases
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).

Use specific non-default ones in some specific cases:
- Force LTR text direction when showing HTML and CSS, and
  configuration files (in some plugins).
- Use Wikipedia server language and text direction when
  showing an article.
- Use auto with Dictionary results, as we don't know the
  dictionary language, and they may contain mixed content.
- Force LTR when showing some paths (still needs more of them)

TextEditor plugin: add 2 new options "Auto paragraph direction"
and "Force paragraph direction LTR".

Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.
4 years ago
poire-z 016df709af CoverBrowser: list mode: fix overlap of directories and nb items 5 years ago
poire-z 7b4b06f557 CoverBrowser: Mosaic: only left-align for File browser
Left align partially filled rows for File browser/chooser, but
have them centered for History and Favorites for a prettier
look when only a few items are displayed.
5 years ago
Martín Fernández 5fb03475c5 revert #5493 - show android mountpoint on system stats 5 years ago
Robert 830fc790f1 Battery stats plugin: fix and improvements (#5626)
- fix incorrectly shown awake, sleeping, charging and discharging,
- remove unneeded debug mode and logging to external file,
- prevent showing values like inf, -inf, nan in estimated times
  (we now show "n/a"), and values below zero,
- show extra confirm box when we want to reset data,
- show time in format xxhxxm instead of only pure minutes,
- check at initialization that the device was charging when it was
  turned off (battery level larger than at the time of exit).
5 years ago
poire-z 085d162f23 CoverBrowser: Mosaic: fix alignment on non-fully filled rows 5 years ago
Robert 03fda96041 [fix] Empty directory path and crash on TextWidget (#5606) 5 years ago
Frans de Jonge dc4453eb7f
[fix, plugin] Don't show full widget together with isOnline() (#5575)
Fixes https://github.com/koreader/koreader/issues/5415

Cf. https://github.com/koreader/koreader/pull/5452 https://github.com/koreader/koreader/pull/5573 https://github.com/koreader/koreader/pull/5574
5 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
poire-z 16c021a76a
CoverBrowser: fix files_per_page setting type (#5556)
Avoid saving/getting "12.0" (as the lua-ljsqlite3 driver does),
and save/get "12" instead by properly converting it to a string
and back, as the config.value table column is of type TEXT.
5 years ago
poire-z 602a821acc
CoverBrowser: list mode: better default for files_per_page (#5551)
Don't use a hardcoded default value of 10 files per page, but
compute it from available height, as previously (this reverts
a bit from 0ecf42e9).
5 years ago
NiLuJe 4f52c4147f
Fix a deadlock with empty settings (#5546)
* Fix deadlock on empty settings
Emulator only. Was stuck looping forever on directory == base == .
5 years ago
Robert dec0e73a7b [statistic plugin] Don't generate md5 sum on open document (#5528)
There is no need to generate a md5 sum for documents that were already opened.
5 years ago
poire-z 0ecf42e995
CoverBrowser: list mode fixes and tweaks (#5525)
- Use a hardcoded default value of 10 files per page.
- Save cover sizetag as "s<nb of items per page>" instead
of "s<item height>" so they are stable (and not re-fetched)
when switching between FileBrowser and History, which have
some small geometry differences.
- When showing History in landscape mode, decrease perpage
from the set value, so items don't look smaller.
- Use a step, larger with big items, when iterating and decreasing
font sizes to make text fit, to speed up the process a bit.
5 years ago
Jörg Derungs 946595fa46 CoverBrowser: select nb of items in Detailed list mode
New menu options:
- Detailed list mode: select nb of items per page
- Series: new option to show it on a separate line
5 years ago
poire-z f05e62c1fb
TextWidget: small refactoring, better handle max_width (#5503)
Lots of code was doing some renderText calls to get the size
of some text string, and truncate it to some width if needed,
with or without an added ellipsis, before instantiating
a TextWidget with that tweaked text string.

This PR fixes/adds some properties and methods to TextWidget
so all that can be done by it. It makes the calling code
simpler, as they don't need to use RenderText directly.
(Additionally, when we go at using Harfbuzz for text rendering,
we'll just have to update or replace textwidget.lua without
the need to update any higher level code.)

Also:
- RenderText: removed the space added by truncateTextByWidth
  after the ellipsis, as it doesn't feel needed, and break
  right alignment of the ellipsis with other texts.
- KeyValuePage: fix some subtle size and alignment issues.
- NumberPickerWidget: fix font size (provided font size was
  not used)
5 years ago
Nick ef22e85469 UI Changes (#5508)
* Changed File Browser text

KOReader looks nicer than KOReader File Browser,

* Remove the "page x of x" if only one page

Removes it from the bottom of the file browser

* Remove the "page x of x" if only one page

Removes it from the top menu, if there is only one page, why show page 1 of 1

* Renamed ~ to Home

Since the file browser can be considered "Home"

* Added 12 hour time option

Also tweaked the charging icon,  looks nicer than +, tweaked seperator between time and battery, - instead of @
5 years ago
Frans de Jonge 17244cca2f
[fix, plugin] Remove wakeup task on resume (#5502)
Should fix #5495.
5 years ago
Martín Fernández bae69c0ef3 show android mountpoint on system stats (#5493) 5 years ago
teroshan ebcefe1c98 [feat] plugins/Wallabag: add ability to set a list of tags to ignore (#5467)
A new setting has been adding allowing to set a comma separated list of
tags to ignore.

Entries with either of these tags will be skipped by the client when
fetching the list of articles to download. Extra articles will be
fetched from the server to make up for the skipped articles, ensuring to
meet the target number of articles.
5 years ago
Mustafa Ali Mutlu 16d0e380ea [Plugin] Support for exporting annotations/bookmark renames (#5440)
Changes :parseHighlight() to parse renamed bookmarks/highlights

see #5408
5 years ago
yparitcher 8ed088159c [Plugin] Per directory defaults (#5428) 5 years ago
teroshan 63e80c7bb7 [wallabag] comply with coding conventions 5 years ago
teroshan 26437758e5 [wallabag] fetch pdf files directly instead of converting them
Currently, all the articles were converted to .epub by default. When
handling an article that linked to a .pdf file, it resulted in an
unreadable file.

This patch skips the conversion for a pdf file, and download it directly
instead.
5 years ago
Mustafa Ali Mutlu a0e2f02c32 [Plugin] Joplin support (#5431)
Adds joplin support, fixes https://github.com/koreader/koreader/issues/5086

Changes
-adds a submenu to evernote menu 
   - -Joplin
      |-Set IP and port
      |-Set authorization token
      |-Export to Joplin
      |-Help

-adds EvernoteExporter:exportBooknotesToJoplin()
-adds JoplinClient.lua
-modifies html_export, txt_export and joplin_export flags to work with each other. (eg if user selects one others deactivated)
5 years ago
Frans de Jonge 5557adef14 [plugin] Normalize autoshutdown_timeout_seconds variable name
This discrepancy caused accidentally not properly updating the timeout setting from the GUI dialog.
5 years ago
Frans de Jonge e257c4e45e
[feat, Kobo] Autoshutdown (#5335)
The methods used here will likely work on most embedded devices, which is why I put them in their own WakeupMgr interface/scheduler module, separate from Kobo.

See https://www.mobileread.com/forums/showthread.php?p=3886403#post3886403 for more context.

Fixes #3806.
5 years ago
Robert deebbfe606 [plugin/statistics] Synchronize Current book with footer (#5344)
Better synchronize statistics Current Book with footer.

Also some stylistic improvements in the strings.
5 years ago
Robert 48f20b2153 [i18n, plugins] ReadTimer - better plural forms (#5315)
See: https://github.com/koreader/koreader/pull/3420#pullrequestreview-71776459
5 years ago
Frans de Jonge 4cdc3ab99b
[feat, plugin] Add AutoTurn (#5295)
Fixes <https://github.com/koreader/koreader/issues/3019>.
5 years ago
Frans de Jonge 6979e080f8
[fix, UX] Update kosync login/logout text (#5278)
As a side effect of <https://github.com/koreader/koreader/pull/4189> some menus have to manually trigger updates.

I'm not overly enthused with this solution but I couldn't think of anything better right now.

Fixes <https://github.com/koreader/koreader/issues/5224>.
5 years ago
Frans de Jonge be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
5 years ago
Frans de Jonge ba8099f906
[lang] Miscellaneous improvements (#5263)
Some grammar/style, some fixes.
5 years ago
Frans de Jonge 102180b202 [i18n, plugins] Statistics: fix estimated days to read plural 5 years ago
Frans de Jonge 2c555830f9
[feat, i18n] Implement ngettext (#5257)
Fixes <https://github.com/koreader/koreader/issues/5249>.

See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html and https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html for more information.

Usage:
```lua
local T = ffiUtil.template
local _ = require("gettext")
local N_ = _.ngettext

local items_string = T(N_("1 item", "%1 items", num_items), num_items)
```
5 years ago
Frans de Jonge 45a0f285f1
[fix, i18n] Make two strings translatable (#5256)
Fixes <https://github.com/koreader/koreader/issues/5255>.
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 a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
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
lucarota ac7b6aaab5 Fix: Zsync -> Subscribe to book share crashes (#5184)
Patch similar to PR #3086.
Same problem #2638 when tap Subscribe to book share.
"Zsync" -> "Subscribe to book share" crashes koreader if not connected to wifi

After this fix when koreader is offline after "Zsync" -> "Subscribe to book share" we are asked to enable wifi.
5 years ago
lucarota bcb662c863 minor: translate some menu text and error message (#5185) 5 years ago
Robert 825a3c4b52 Add gesture - show current book statistics (#5167) 5 years ago