2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

731 Commits

Author SHA1 Message Date
NiLuJe
0b3747927c
WakeupMgr: Minor usage tweak (#7400)
* Unify logging with AutoSuspend (e.g., keep ourselves to showing the delay in seconds, not the raw timestamp, as that's way harder to interpret, and the RTC module and/or logger will do that for us when the time comes).
* Speaking of, minor revamp of RTC related logging to make it more human-readable.
* On Kobo, if we hit the unexpected wakeup limit, re-engage AutoSuspend's *suspend* check, so that the device has a chance to poweroff instead of being kept awake.
2021-03-10 02:21:02 +01:00
NiLuJe
601d2fc3d2
Screensaver: Unbreak screensaver_stretch_images (#7403)
* Screensaver: Unbreak screensaver_stretch_images

We don't have real ternary operators in Lua, if the second argument evaluates to false, it doesn't work.
Invert the test to avoid this pitfall.
(c.f., http://lua-users.org/wiki/TernaryOperator).

Fix #7402, regression since #7371

* Free a few similar constructs (incidentally, some of 'em also tweaked in #7371 ^^).
2021-03-10 02:14:26 +01:00
NiLuJe
48b0f2242c
OPDSBrowser: Unbreak test (#7393) 2021-03-07 00:05:41 +01:00
NiLuJe
bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
2021-03-06 22:44:18 +01:00
Georgelemental
053df60553
Account for result pagination when fetching notes or notebooks from Joplin API (#7162)
The Joplin Web Clipper API now paginates results for the APIs for fetching notes or notebooks

Iterate through Joplin API results in order
2021-03-06 19:32:56 +01:00
Alex Vanderpot
7b2eba73ba
Do not include author in OPDS download filename if nil or empty (#7384) 2021-03-06 19:29:36 +01:00
Alex Vanderpot
ac26ccdc58
OPDS: Parse Open Search Definition for feeds that support it (#7380) 2021-03-06 19:29:15 +01:00
Frans de Jonge
99db7ff633
Even more directory to folder (#7387)
Cf. https://github.com/koreader/koreader/pull/7386#issuecomment-791555451
2021-03-05 18:12:47 +01:00
Frans de Jonge
c0423401aa
A few more directory to folder (#7386)
Cf. https://github.com/koreader/koreader/issues/7350#issuecomment-789672442
2021-03-05 17:49:33 +01:00
NiLuJe
03885071b9
OPDS: Don't needlessly setup Basic auth (#7372)
* OPDS: Don't save an empty username.

That causes LuaSockets to try Basic auth, which is useless (and may or may not be problematic for some servers).

* Attempt to explicitly request non-compressed content.

Some servers may still refuse to obey, though.
They're breaking RFC2616 (a.k.a. HTTP/1.1) by doing so, though, meh.

* Let LuaSocket do its job.

It already handles setting up the Host header, as well as Basic authentication if both username & password are set.
2021-03-02 17:58:43 +01:00
NiLuJe
c2db948ff2
KeyValuePages: Handle not having anything to show slightly better (#7353)
By disabling the pagination buttons, and showing a specific label, like Menu (https://github.com/koreader/koreader/pull/7347#issuecomment-786768640)
2021-02-26 23:04:11 +01:00
NiLuJe
2e507a42a4
Get rid of OPDS libraries with content of dubious legal status. (#7351)
Remember, it's life +70 in US & EU, life +50 is Canada.
(It's actually slightly more complex than that, and some periods of
time/countries may use a far longer term. IANAL).
2021-02-26 18:20:46 +01:00
NiLuJe
26b9ab2505
Minor followup to #7335 (#7347)
* Unify SortWidget's pagination button (it was using a tap_input, which is why I'd missed it ;)). (https://github.com/koreader/koreader/pull/7335#issuecomment-785628495)
* Menu*: Remove redundant screen-layout updates from `_recalculateDimen`, as it should only be concerned with item layout (https://github.com/koreader/koreader/pull/7335#discussion_r582072032)
2021-02-26 00:48:05 +01:00
NiLuJe
525b1957b9
[RFC] Pagination UI shenanigans (#7335)
* Menu/KeyValuePage/ReaderGoTo: Unify the dialogs. (Generally, "Enter page number" as title, and "Go to page" as OK button).
* Allow *tapping* on pagination buttons, too. Added spacers around the text to accommodate for that.
* Disable input handlers when <= 1 pages, while still printing the label in black.
* Always display both the label and the chevrons, even on single page content. (Menu being an exception, because it can handle showing no content at all, in which case we hide the chevrons).
* KVP: Tweak the pagination buttons layout in order to have consistent centering, regardless of whether the return arrow is enabled or not. (Also, match Menu's layout, more or less).
* Menu: Minor layout tweaks to follow the KVP tweaks above. Fixes, among possibly other things, buttons in (non-FM) "List" menus overlapping the final entry (e.g., OPDS), and popout menus with a border being misaligned (e.g., Calibre, Find a file).
* CalendarView: Minor layout tweaks to follow the KVP tweaks. Ensures the pagination buttons are laid out in the same way as everywhere else (they used to be a wee bit higher).
2021-02-25 05:15:23 +01:00
Frans de Jonge
1bd4636a03
Standardize directory/folder to folder (#7328)
Closes <https://github.com/koreader/koreader/issues/7157>.
2021-02-22 18:44:16 +01:00
gbyl
10f65a16e7
CoverImage plugin: adjust wording (#7309) 2021-02-21 00:17:42 +01:00
poire-z
9a6468ce5e
CoverBrowser: list mode: limit font size of components (#7324)
Should trigger when per-page <= 6/7, avoids authors and
titles to become too big.
2021-02-21 00:14:03 +01:00
poire-z
b5de2b2a60 Reading statistics: tweak book stats views
Make "Current statistics" and previsouly opened book
statistics display missing info that the other view
has, mostly:
- Pages read: nb (pct%)
- Current page/Total pages: num/total (pct%)
2021-02-20 21:30:31 +01:00
poire-z
8a0d798e9e KeyValuePage: configurable items per page
Tweak building to start from items per page instead of
a fixed item height.
Guess the best font size that fit.
Update separator specification from using a "----" to
the now generic separator=true (this allows not wasting
a slot for each separator in the page and not have
only 12 items and 2 small lines in a 14 items page).
2021-02-20 21:30:31 +01:00
poire-z
6059958ab6
File browser settings: reorganize into Settings submenu (#7259)
Move classic file browser settings from CoverBrowser plugin
into FileManagerMenu, so they are available when this
plugin is disabled (as they also apply to everything
based on Menu).
2021-02-09 12:41:17 +01:00
Sergey Avseyev
8e1721173e
Add OPDS server from knihi.com (belarusian) (#7263)
https://knihi.com/readers.html
2021-02-09 09:57:57 +01:00
Martín Fernández
5c9e649804
move opds to plugin (#7237) 2021-02-06 19:09:31 +01:00
zwim
6c0345de17
CoverImage: Alternative image fit (#7221) 2021-01-31 21:34:37 +01:00
NiLuJe
df0bbc9db7
Tame some ButtonTable users into re-using Buttontable instances if possible (#7166)
* QuickDictLookup, ImageViewer, NumberPicker: Smarter `update` that will re-use most of the widget's layout instead of re-instantiating all the things.
* SpinWidget/DoubleSpinWidget: The NumberPicker change above renders a hack to preserve alpha on these widgets almost unnecessary. Also fixed said hack to also apply to the center, value button.

* Button: Don't re-instantiate the frame in setText/setIcon when unnecessary (e.g., no change at all, or no layout change).
* Button: Add a refresh method that repaints and refreshes a *specific* Button (provided it's been painted once) all on its lonesome.

* ConfigDialog: Free everything that's going to be re-instatiated on update
 
* A few more post #7118 fixes:
  * SkimTo: Always flag the chapter nav buttons as vsync
  * Button: Fix the highlight on rounded buttons when vsync is enabled (e.g., it's now entirely visible, instead of showing a weird inverted corner glitch).
  * Some more heuristic tweaks in Menu/TouchMenu/Button/IconButton
* ButtonTable: fix the annoying rounding issue I'd noticed in #7054 ;).

* Enable dithering in TextBoxWidget (e.g., in the Wikipedia full view). This involved moving the HW dithering align fixup to base, where it always ought to have been ;).

* Switch a few widgets that were using "partial" on close to "ui", or, more rarely, "flashui". The intent being to limit "partial" purely to the Reader, because it has a latency cost when mixed with other refreshes, which happens often enough in UI ;).

* Minor documentation tweaks around UIManager's `setDirty` to reflect that change.

* ReaderFooter: Force a footer repaint on resume if it is visible (otherwise, just update it).
* ReaderBookmark: In the same vein, don't repaint an invisible footer on bookmark count changes.
2021-01-29 00:20:15 +01:00
Martín Fernández
a5768c7411
calibre plugin: handle huge metadata files (#7159)
metadata files > 30MB will be parsed manually to prevent OOM
2021-01-24 13:47:52 +01:00
Frans de Jonge
1ef6d0b257
[feat] Support mimetypes in DocumentRegistry:hasProvider() (#7155)
And make .djvu the canonical extension for DjVu.

Fixes #5478.
2021-01-17 09:22:48 +01:00
Frans de Jonge
5c9dc850e8
Address assorted Weblate comments (#7154)
* Fix typo in dropbox

Reported by @lescheck

* Rephrase text justification explanation more elegantly

* CoverBrowser: fix up some plurals

* Statistics: remove random use of template function

* Use ngettext for minute/minutes and second/seconds

* Change KB/MB/GB to kB/MB/GB SI units
2021-01-16 21:40:00 +01:00
NiLuJe
dffe86dfe9
Cleanup eye-gouging madness around io.read calls (#7149)
* Don't reinvent the wheel when reading a one-line int or string from sysfs

* Simplify a whole other bunch of read calls
2021-01-16 04:41:46 +01:00
Martín Fdez
b27cf0d168 migrate calibre plugin to persist 2021-01-13 15:00:13 +01:00
poire-z
8f79c662cf Notification: closed by any event, but not consuming it
Make Notification have toast=true, and UIManager deal
specifically with such widget:
a "toast" widget gets closed by any event, and let
the event be handled by a lower widget.
This should allow us to not wait or tap to get rid
of a notification, and just go on with what we're
doing.
Also make them have a default timeout of 2s,
used with all existing ones.
2021-01-12 00:34:30 +01:00
NiLuJe
3060dc81af
Revamp "flash_ui" handling (#7118)
* Wherever possible, do an actual dumb invert on the Screen BB instead of repainting the widget, *then* inverting it (which is what the "invert" flag does).
* Instead of playing with nextTick/tickAfterNext delays, explicitly fence stuff with forceRePaint
* And, in the few cases where said Mk. 7 quirk kicks in, make the fences more marked by using a well-placed WAIT_FOR_UPDATE_COMPLETE

* Fix an issue in Button where show/hide & enable/disable where actually all toggles, which meant that duplicate calls or timing issues would do the wrong thing. (This broke dimming some icons, and mistakenly dropped the background from FM chevrons, for example).
* Speaking of, fix Button's hide/show to actually restore the background properly (there was a stupid typo in the variable name)
* Still in Button, fix the insanity of the double repaint on rounded buttons. Turns out it made sense, after all (and was related to said missing background, and bad interaction with invert & text with no background).
* KeyValuePage suffered from a similar issue with broken highlights (all black) because of missing backgrounds.
* In ConfigDialog, only instanciate IconButtons once (because every tab switch causes a full instantiation; and the initial display implies a full instanciation and an initial tab switch). Otherwise, both instances linger, and catch taps, and as such, double highlights.
* ConfigDialog: Restore the "don't repaint ReaderUI" when switching between similarly sized tabs (re #6131). I never could reproduce that on eInk, and I can't now on the emulator, so I'm assuming @poire-z fixed it during the swap to SVG icons.
* KeyValuePage: Only instanciate Buttons once (again, this is a widget that goes through a full init every page). Again, caused highlight/dimming issues because buttons were stacked.
* Menu: Ditto.
* TouchMenu: Now home of the gnarliest unhilight heuristics, because of the sheer amount of different things that can happen (and/or thanks to stuff not flagged covers_fullscreen properly ;p).

* Bump base
https://github.com/koreader/koreader-base/pull/1280
https://github.com/koreader/koreader-base/pull/1282
https://github.com/koreader/koreader-base/pull/1283
https://github.com/koreader/koreader-base/pull/1284

* Bump android-luajit-launcher
https://github.com/koreader/android-luajit-launcher/pull/284
https://github.com/koreader/android-luajit-launcher/pull/285
https://github.com/koreader/android-luajit-launcher/pull/286
https://github.com/koreader/android-luajit-launcher/pull/287
2021-01-10 01:51:09 +01:00
poire-z
1f2447dc06 Statistics plugin: change some logger.info() to dbg() 2021-01-10 01:14:48 +01:00
Martín Fernández
5ec0b049d9
Add deprecation messages to plugins (#7101)
And deprecate Goodreads plugin.
2021-01-07 23:15:32 +01:00
poire-z
2e95bc7a71 Statistics plugin: reorder Reset menu items 2021-01-07 23:10:24 +01:00
yparitcher
e157395660
add noop callback to cache size to prevent artifacts (#7106) 2021-01-06 23:12:40 +01:00
Martín Fernández
cd9b3e10fd
calibre: do not attempt to stop the socket if nil (#7067) 2020-12-27 14:10:06 +01:00
NiLuJe
0685eecdad
Simplify db migration toasts (#7063)
xref https://www.mobileread.com/forums/showpost.php?p=4073920&postcount=17
2020-12-27 03:23:08 +01:00
NiLuJe
838769b0fb
BookInfo: Saner database migration (#7039)
Avoid opening two connections in //, by feeding the current connection
to saveSetting, like we were already doing for loadSettings...

It somehow worked just fine on Kobo/Emu, but blew up in fun and
interesting ways on Kindle, probably because of the Fuse proxy.

It was still pretty dumb nonetheless.
2020-12-24 02:35:13 +01:00
poire-z
daefdc96e9 Remove PNG icons, add koreader.svg
Also move Mac specific resource in platform/mac/.
2020-12-19 14:49:18 +01:00
poire-z
24424e505e Update UI layout code to use new SVG icons
- Add IconWidget, use it for icons instead of ImageWidget.
  Specify icons by name only, look for them (with either
  .svg or .png suffixes) in multiple directories (including
  koreader/settings/icons/ to allow customizing them).
  Don't crash when icon name not found, shown a black
  background warning icon instead.
- Don't trust the icons' native sizes: replace
  scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
  so all icons get the same (tunable) size - except in
  a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
  properly centered in them, extend vertical line
  separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
2020-12-19 14:49:18 +01:00
NiLuJe
7f6bc28eca BookInfoManager: Convert thumbnail compression to ZSTD
* Avoid the Lua string copies when compressing/uncompressing the bb
  thumbs
* Delay the statement reset so that the pointer returned by the BLOB
  query is actually usable ;).
* Re-use a ZSTD decompression context
* Store date & mtime for successfully extracted documents
  c.f., 10477501f9 (r44914917)
* Switch to user_version pragma to handle DB schema versioning
* Update file size/date on *each* extraction attempt.
  @poirez-z raised a good point, this ought to be useful to deem a file
  re-parseable after an update.
* Remove xutil
  Functionality has been moved to ffi/zlib & ffi/zstd
* Preserve settings when migrating the BookInfo DB
* Warn via InfoMessage that the DB was updated
* Only store the series name in series, and move the index in series_index
  (Column names chosen to match Calibre's).
* Handle the new series_index column in BookInfo consumers
* This allows us to get rid of the code that stripped empty decimals
  from series index in *most* places, since it's now a real Lua
  number, and the string formatting library does that magic on its
  own.
2020-12-19 04:16:44 +01:00
NiLuJe
d80d6dc562 Handle the BlitBuffer struct changes
* stride is now a size_t
  On some platforms, that's 64 bits, which means it's no longer
  automatically converted to a Lua number to avoid precision loss.
  Do that ourselves, because lua-serialize doesn't know how to handle an
  uint64_t cdata ;).
2020-12-19 01:54:43 +01:00
Martín Fernández
a90038e4eb
Calibre plugin fixes for android (#6996)
* calibre plugin: scan on sdcard too
* calibre plugin: force inbox chooser in android's primary partition
* downloadMgr: override dir
2020-12-15 00:46:38 +01:00
Frans de Jonge
582807f971
[chore, plugins] CoverImage: move newline outside translated string (#6985) 2020-12-12 21:04:58 +01:00
poire-z
86701f6ccc
TextEditor: fix some settings not sticking (#6979) 2020-12-11 17:01:45 +01:00
yparitcher
b0a1077756
FileManager: fix Plus menu override (#6957)
manage it in FM not in gestures, as  #6918 made the menu tap zone the entire width so the tap is not passed through to the gesture plugin
2020-12-07 20:30:07 +01:00
zwim
0a6ef6e351
CoverImage plugin: allow saving covers as JPG (#6924) 2020-12-05 23:54:06 +01:00
Frans de Jonge
fd51671478
[chore] Change single quotes to double quotes (#6949)
*Especially* in the hello world plugin.
2020-12-04 16:04:54 +01:00
NiLuJe
493eab92c9
[RFC] Make default UI tapzones more generous (#6918)
* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
2020-12-03 17:33:54 +01:00
NiLuJe
bba8b31e1d
AutoSave: Delay I/O until after the pageturn (#6917)
nextTick was too early ;).

Prevents small hitches when turning the page for the page where this
triggers.

Apply the same trickery to the Stats DB insert, even if that one probably
had a much smaller impact.
2020-11-28 22:59:27 +01:00
zwim
52f66a89d2
CoverImage plugin: enable on Remarkable and PocketBook (#6906) 2020-11-28 13:58:44 +01:00
zwim
3137f5a158
CoverImage plugin: allow saving covers as BMP (#6904) 2020-11-28 13:57:33 +01:00
zwim
2785f0d113
Remove leftover and correct info message on empty fallback (#6897)
Cf. https://github.com/koreader/koreader/pull/6813#discussion_r527459959
2020-11-20 10:33:47 +01:00
zwim
31fe3b87c3
CoverImage plugin: add "Size and background" options (#6884) 2020-11-18 21:30:22 +01:00
zwim
bab55bfa0d
Typo in Text (#6871) 2020-11-12 21:54:42 +01:00
zwim
926e7dd402
coverimage plugin (#6813)
* Plugin for saving the cover image to file. Useful in some e-ink android devices.
2020-11-10 15:00:56 +01:00
Frans de Jonge
090f33b5b8
[fix] Minor doc touchups re. QR encode (#6861)
Cf. <https://github.com/koreader/koreader/pull/6844#issuecomment-723672448>.
2020-11-09 09:17:11 +01:00
jperon
43ba8a1173
Qrcode support (#6844)
2 new widgets:

- QRWidget, that's like an ImageWidget, but with a text property that will be converted to a QR code ;
- QRMessage, that's like an InfoMessage, but shows the message as QR code.
Moreover, it adds the ability to export QR codes to the text editor.

1 new plugin:

- Generate QR codes from clipboard

Changes to text editor plugin:

- Add the ability to export QR codes.
2020-11-04 18:59:39 +01:00
poire-z
8403154d4d
Reader: rationalize "Back" key/action handling (#6840)
Have ReaderBack be the sole handler of onBack.
Add 4 mutually exclusive options for the Back key,
to avoid ReaderLink and ReaderBack location stacks
from interfering (ReaderBack's stack being always a
superset of ReaderLink's stack).
So, remove "Enable back history", which is replaced
by Back option "Go to previous read page".
Fix a few possible crashes and inconsistencies (when
zoom, scroll or reflow have changed) with ReaderPaging
and ReaderView when restoring previous page/view.
2020-11-03 22:51:11 +01:00
poire-z
74c1813a82 GestureDetector: add Tap interval on keyboard setting
Follow up to b90f6db8: allow specifying an other
value for tap interval when the keyboard is shown
(a good value for tap interval on reader and UI
elements might be too long on the keyboard, and
prevent typing fast).
2020-10-31 09:36:24 +01:00
NiLuJe
982702fdc1
Statistics: Don't blow up when annotating/highlighting stuff with the plugin loaded, but disabled (#6829)
Re #6825
Re #6827
2020-10-26 12:27:05 +01:00
NiLuJe
42b866cd7f
Statistics: Handle DB migration to 20201022 (#6812)
* Add a few IF (NOT) EXISTS guards to DB schema stuff

* Chunk DB migrations into each specific schema revision

And bump to 20201022 to pickup the changes from #6807

Always VACUUM at the end of a (set of) migration.
2020-10-22 20:15:35 +02:00
poire-z
b40331085a
Statistics: speed up Calendar view (#6807)
Just by tweaking the SQL queries, and adding an index
on page_stat_data(start_time).
Also, in the hourly histogram, show at least a 1px bar
when there was any reading this hour.
2020-10-21 18:49:08 +02:00
yparitcher
602e0b3feb ldoc fixes 2020-10-20 18:11:55 -04:00
yparitcher
433b82f162 Dispatcher: allow registering actions at runtime 2020-10-20 18:11:55 -04:00
NiLuJe
9fc87e3b85
Address some DB migration concerns (#6804)
* Don't overwrite an existing DB backup during DB migrations

* Try to be gentler with wonky DBs during migration
2020-10-20 01:14:24 +02:00
NiLuJe
0406be3319
Random nano optimizations (#6801)
* Don't call Screen:afterPaint if nothing was actually painted

* Stupid micro-optimization (os.)time! (pun intended :D)
2020-10-18 20:38:17 +02:00
poire-z
b90f6db876 GestureDetector: add Tap interval setting, to avoid bounces
Also fix info_text not displayed, and add more
descriptive ones.
2020-10-18 20:13:44 +02:00
NiLuJe
11aeef7483
Don't shadow gettext (#6799)
(Fixes the "current book" stats page)
2020-10-17 23:22:23 +02:00
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.
2020-10-17 12:59:24 +02:00
ezdiy
5e231d759a
Bump base for sqlite. (#6796)
& make CI happy.
2020-10-16 02:34:59 +02:00
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
2020-10-15 05:31:21 +02:00
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 ;).
2020-10-09 19:23:57 +02:00
ezdiy
b8fa553407
Actually set sorting hints in plugins (#6770) 2020-10-09 07:40:23 +02:00
Marek Gibek
6b90239e7c
Statistics plugin: fix in-memory statistics. (#6759) 2020-10-06 16:32:45 +02:00
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
2020-10-02 08:53:24 +02:00
NiLuJe
ec3ec8dc21
Show full ToC entry on hold (#6729)
Fix #6728
2020-09-30 19:56:56 +02:00
ezdiy
7a40b496fb
blitbuffer: fixups for base (#6714)
fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
2020-09-28 01:04:59 +02:00
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
2020-09-22 07:21:37 +02:00
ezdiy
2afec592f8
Autostandby: Fix wrong assumptions about instance liveness. (#6666)
Got instantiated multiple times, when our state is meant to be global.
Fixes #6647
2020-09-17 13:18:14 +02:00
NiLuJe
99045b4311
Minor util & ffi/util cleanups (#6657) 2020-09-15 20:39:32 +02:00
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.
2020-09-13 19:00:03 +02:00
Frans de Jonge
b031d1c359
[Plugin] BatteryStat: consumed → charged for charging (#6646)
Closes <https://github.com/koreader/koreader/issues/6057>.
2020-09-12 11:08:26 +02:00
smartscripts-nl
4e281f00ed
Dispatcher: adds Show terminal (#6626) 2020-09-03 01:14:06 +02:00
Frans de Jonge
d7aa626ee8
Fix order of requires 2020-09-02 16:10:13 +02:00
smartscripts-nl
20ddad2951
Terminal: add shortcuts for re-useable commands (#6609)
To be able to quickly repeat often used terminal commands
2020-09-02 16:09:27 +02:00
poire-z
869e4ce1e3 CoverBrowser: list mode: show last read date for deleted files 2020-09-01 15:13:01 +02:00
ezdiy
8f8daa9dfb
PocketBook: Auto-standby plugin fix (#6612)
Fix "accessing undefined variable" in previous commit.
2020-09-01 00:54:39 +02:00
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).
2020-09-01 00:23:09 +02:00
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.
2020-08-31 16:48:29 +02:00
smartscripts-nl
0e7f1ba317
Dispatcher: adds Texteditor: open last file (#6600) 2020-08-31 11:47:37 +02:00
ezdiy
fd31bcc5fd
Make UIManager track prevent/allowStandby state. (#6558)
Conversely, Trapper and plugins report standby interruptibility.
2020-08-30 15:01:56 +02:00
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
2020-08-30 12:15:02 +02:00
poire-z
85a16d0064 Open with: add Text Editor plugin 2020-08-29 20:07:26 +02:00
poire-z
cfa45f8d88 History: show last read date instead of file size
In classic and list display modes.
2020-08-29 20:07:26 +02:00
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.
2020-08-29 20:07:26 +02:00
Frans de Jonge
671ea00a2f
[lang] Update Goodreads API key instructions (#6542)
Closes <https://github.com/koreader/koreader/issues/6539>.
2020-08-23 12:56:17 +02:00
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.
2020-08-20 13:11:02 +02:00
Galunid
9fa043e227
Use already entered values instead of defaults if not specified in perception expander (#6518) 2020-08-18 11:26:53 +02:00
Galunid
d90e221a17
Kosync network callback (#6489) 2020-08-17 09:57:01 +02:00
yparitcher
986f45871a
Dispatcher: show selected number (#6472)
followup to #6441
2020-08-17 09:55:03 +02:00
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.
2020-08-09 11:19:50 +02:00
Martín Fdez
8198b2bcc3 initialize inbox dir 2020-08-08 16:28:33 +02:00
Galunid
55a5f0c1a3
Cleanup after #6449 (#6484)
* Better description in spinwidget
* Rename SpinWidget title from "Hold pan rate" -> "Text selection rate"
2020-08-07 22:05:52 +02:00
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)
2020-08-07 21:06:25 +02:00
Galunid
627716db9c
Allow setting text selection rate (#6449) 2020-08-06 00:13:26 +02:00
yparitcher
7583571707
Dispatcher Gestures Profiles: only flush settings when changed (#6471) 2020-08-05 00:19:28 +02:00
yparitcher
2d8c50708f
Fix gesture migration when user never had custom multiswipes (#6467) 2020-08-02 21:38:01 -04:00
yparitcher
9e0ac734ba Gestures: Refactor to use Dispatcher 2020-08-02 16:55:09 -04:00
yparitcher
2a99b014a2 initial refactor of ReaderGesture into Gestures plugin 2020-08-02 16:55:09 -04:00
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.
2020-07-30 22:46:04 +02:00
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
2020-07-27 21:26:56 -04:00
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.
2020-07-27 03:39:06 +02:00
Frans de Jonge
e23f68e5f7
[fix] Statistics: allow for proper translation of plural (#6437)
Reported by @leschek
2020-07-26 07:31:20 +02:00
Frans de Jonge
4c70e6cb56
[fix] Add plural string for number of books (#6431)
Reported by https://hosted.weblate.org/user/leschek/
2020-07-25 18:28:19 +02:00
Frans de Jonge
4c524de472
Fix typo (#6425)
Reported by https://hosted.weblate.org/user/leschek/ on Weblate
2020-07-24 10:46:55 +02:00
Frans de Jonge
da507f8607
[chore] Update MD5 calls with new sha2 library (#6411)
Depends on <https://github.com/koreader/koreader-base/pull/1149>.
2020-07-21 23:25:46 +02:00
yparitcher
783103b488
Perception expander: disable margin increase when set to 0 (#6377)
Closes #6376
2020-07-15 20:31:40 -04:00
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
2020-07-14 17:39:03 -04:00
yparitcher
70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
2020-07-12 14:47:49 -04:00
Martín Fernández
1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
2020-07-11 01:29:49 +02:00
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>.
2020-06-28 11:34:22 +02:00
Galunid
37cf106fce
EvernoteOAuth set logger (#6308)
evernote-sdk-lua#4 to logger.dbg, instead of default print
2020-06-27 17:35:25 +02:00
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.
2020-06-27 09:12:30 +02:00
Martín Fdez
d91d2d72d7 disable background runner on android 2020-06-24 12:49:14 +02:00
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>.
2020-06-22 10:00:22 +02:00
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.
2020-06-19 23:38:53 +02:00
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).
2020-06-19 12:22:38 +02:00
Galunid
cd440acdc4
Add chapter title when exporting notes in Evernote (JSON/HTML, remote) (#6146)
closes #4566
closes #6138
2020-06-17 23:51:02 +02:00
Martín Fdez
d6e87a111a coding style + comment 2020-06-13 19:05:10 +02:00
Martín Fdez
a488cc57bc duh 2020-06-13 19:05:10 +02:00
Martín Fdez
835f9f62c6 fix ANRs in Kosync plugin login/register 2020-06-13 19:05:10 +02:00
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
2020-06-13 01:56:36 +02:00
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>.
2020-06-12 22:40:48 +02:00
Frans de Jonge
04a5e2acfa
[fix, plugin] Wallabag: add quiet option to callAPI() (#6252)
Dumb lazy workaround for <https://github.com/koreader/koreader/issues/6251>.
2020-06-10 21:54:57 +02:00
Mikolaj "lich" H
b741fcebac
[NewsDownloader] Added an HTML filter through a CSS selector (#6228)
Fixes #6185.
2020-06-04 22:58:14 +02:00
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.
2020-05-29 14:22:27 +02:00
mwoz123
395e65f749
Add Wallabag queue (#6170)
See https://github.com/koreader/koreader/issues/6119#issuecomment-624329183
2020-05-24 15:56:48 +02:00
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.
2020-05-20 21:40:49 +02:00
mwoz123
0e2b430796
Fix/exit dir (#6163) 2020-05-19 18:21:58 +02:00
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).
2020-05-09 23:29:49 +02:00
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.
2020-05-06 21:11:34 +02:00
Robert
3f874f0d1f
[Gesture] Add progress sync gesture (#6103) 2020-05-05 18:51:02 +02:00
mwoz123
d5bc235270
Send2Ebook: close document on going to folder (#6118) 2020-05-05 18:42:04 +02:00
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
2020-05-03 22:31:02 +02:00
mwoz123
ce3bf473da
Add move to archive plugin (#6101) 2020-05-02 23:02:36 +02:00
Roland Coeurjoly
e5b2c2953b
Add support for exporting highlights in JSON format (#6067) 2020-04-26 19:36:56 +02:00
Robert
b4f3f177ca
kosync - new string methods (#6089) 2020-04-25 09:04:44 +02:00
mwoz123
8b4f1ca42e
Wallabag remove from history setting fixes (#6059) 2020-04-15 15:25:29 +02:00
mwoz123
0b52fe9771
Wallabag remove from history setting (#6048)
Solves: #5045
2020-04-15 12:50:13 +02:00
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.
2020-04-15 08:52:16 +02:00
poire-z
635f784dfd [UX] Gestures: add action "Statistics calendar view"
Also flush current stats when showing calendar view.
2020-04-10 22:52:57 +02:00
mwoz123
904a61009d
plugins/NewsDownloader: add never download images (#6003)
Closes #5924.
2020-03-27 14:21:20 +01:00
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)
2020-03-20 23:41:36 +01:00
yparitcher
e9d0c7a96e
[fix] don't crash when enabling statistics on new book (#5971) 2020-03-20 12:01:38 +01:00
yparitcher
08359ee1b6
[UX] Next/Previous Bookmark Gestures (#5968)
Fixes #5965
2020-03-16 16:52:09 +01:00
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).
2020-02-27 23:59:02 +01:00
Martín Fernández
825b22dd6b
kosync: validate username and password against empty/blank strings (#5894) 2020-02-25 20:40:50 +01:00
poire-z
687074fa1f
CoverBrowser: fix "Extract and cache" crash (#5874) 2020-02-17 23:46:31 +01:00
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).
2020-02-17 16:53:09 +01:00
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.
2020-02-16 01:03:12 +01:00
poire-z
3ca46577bf
Statistics: new Calendar view (#5854)
Also fix RTL UI mirroring in OverlapGroup when
overlap_offset are used.
2020-02-12 23:05:18 +01:00
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.
2020-02-05 03:14:21 +01:00
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
```
2020-02-02 20:35:21 +01:00
Mustafa Ali Mutlu
2736661bfc [fix, plugin] Evernote exporter only writes one documents clippings when txt export used, rest is ignored (#5774)
fixes #3690
2020-01-25 17:28:13 +01:00
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.
2020-01-23 19:26:07 +01:00
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.
2020-01-15 08:59:36 +01:00
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
2020-01-05 09:47:33 +01:00
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.
2020-01-04 01:34:46 +01:00
Frans de Jonge
e3fa9bd4b8
[fix] Various minor string issues (#5719)
Fixes <https://github.com/koreader/koreader/issues/5712>.
2020-01-01 12:41:37 +01:00
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.
2020-01-01 12:27:51 +01:00
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.
2019-12-16 23:55:31 +01:00
Mustafa Ali Mutlu
7b0b5d5ba7 [fix] Crash when exporting notes (#5677)
Fixes https://github.com/koreader/koreader/issues/5609
2019-12-09 23:16:45 +01:00
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
2019-12-08 15:10:51 +01:00
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.
2019-12-08 15:10:51 +01:00
poire-z
016df709af CoverBrowser: list mode: fix overlap of directories and nb items 2019-12-05 12:18:52 +01:00
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.
2019-11-26 21:14:06 +01:00
Martín Fernández
5fb03475c5 revert #5493 - show android mountpoint on system stats 2019-11-26 15:04:41 +01:00
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).
2019-11-26 14:21:14 +01:00
poire-z
085d162f23 CoverBrowser: Mosaic: fix alignment on non-fully filled rows 2019-11-24 17:21:18 +01:00
Robert
03fda96041 [fix] Empty directory path and crash on TextWidget (#5606) 2019-11-19 21:06:03 +01:00
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
2019-11-06 21:02:41 +01:00
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.
2019-11-06 00:17:28 +01:00
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.
2019-11-01 11:29:11 +01:00
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).
2019-10-31 12:06:21 +01:00
NiLuJe
4f52c4147f
Fix a deadlock with empty settings (#5546)
* Fix deadlock on empty settings
Emulator only. Was stuck looping forever on directory == base == .
2019-10-30 00:27:54 +01:00
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.
2019-10-26 09:08:57 +02:00
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.
2019-10-23 22:54:14 +02:00
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
2019-10-22 23:49:04 +02:00
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)
2019-10-21 15:20:40 +02:00
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 @
2019-10-21 14:24:29 +02:00
Frans de Jonge
17244cca2f
[fix, plugin] Remove wakeup task on resume (#5502)
Should fix #5495.
2019-10-17 23:31:30 +02:00
Martín Fernández
bae69c0ef3 show android mountpoint on system stats (#5493) 2019-10-15 22:51:36 +02:00
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.
2019-10-13 08:48:37 +02:00
Mustafa Ali Mutlu
16d0e380ea [Plugin] Support for exporting annotations/bookmark renames (#5440)
Changes :parseHighlight() to parse renamed bookmarks/highlights

see #5408
2019-10-11 20:39:13 +02:00
yparitcher
8ed088159c [Plugin] Per directory defaults (#5428) 2019-10-08 17:14:38 +02:00
teroshan
63e80c7bb7 [wallabag] comply with coding conventions 2019-10-03 10:40:39 +02:00
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.
2019-10-03 10:40:39 +02:00
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)
2019-09-29 23:09:58 +02:00
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.
2019-09-14 16:27:54 +02:00