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

453 Commits

Author SHA1 Message Date
Frans de Jonge
cd3ca88316
[spec] Even more TimeVal coverage (#4674) 2019-02-28 17:31:39 +01:00
Frans de Jonge
626d7340f3
[spec] Add more TimeVal tests (#4672)
That should please CodeCov.
2019-02-28 15:01:13 +01:00
Frans de Jonge
abba7ba873
[fix] TimeVal: add dbg:guard against incorrect subtraction order (#4669)
In principle, any negative subtraction result should be caused by a logical error.
2019-02-27 22:20:47 +01:00
Frans de Jonge
8abf79b497
[spec] Add GestureDetector stub (#4614)
Cf. #4613.
2019-02-19 07:38:25 +01:00
NiLuJe
011370882f [chore] Some Wi-Fi tweaks (#4564)
* On Kobo, kill WiFi on startup if we detect an inconsistent state...

Untested, not terribly pretty.

The other solution is to slow down the Wi-Fi meny by doing the same
check for the "Wi-Fi connection" checkbox as in the later wifi_status
one...

* Don't enable auto_restore_wifi by default

It's liable to silently murder batteries for no good reason, given that
we prompt to enable WiFi by default when needed, and we otherwise have
no actual need to keep WiFi on in the background.

re #2215 (in particular, this directly contradicts @houqp in
https://github.com/koreader/koreader/pull/2215#discussion_r74696133 ;)).
2019-02-08 22:29:11 +01:00
poire-z
f2a9ed0b79
bump crengine: count nb of images drawn & others (#4542)
Includes:
- Update french hyphenation pattern
- epub.css: update style for 'blockquote'
- DrawBuf: count nb of images and surface drawn

Adds Document:getDrawnImagesStatistics() to help deciding
if refresh with (possibly costly) dithering should be used
(on devices with HW dithering capabilities) with CreDocument:
when a page contains enough images to benefit from it.
2019-02-03 11:25:34 +01:00
NiLuJe
d113cb9475
A few Kobo input tweaks (#4450)
* Fix the Touch input probe on Trilogy devices that depend on the touch_probe_ev_epoch_time quirk (fix #630)
* Expose a "Pageturn button inversion" feature in the Navigation menu (for all devices with keys) (fix #4446)
* Allow ignoring the accelerometer on the Forma (Screen > Ignore accelerometer rotation events; also available from the Gesture Manager) (fix #4451)
* Fix SleepCover handling on the Forma (fix #4457)
* Make isWifiOn a tiny bit more accurate (check the actual WiFi module instead of sdio_wifi_pwr)
* Move all flash related Screen options to the eInk submenu
2019-01-08 02:59:47 +01:00
poire-z
22b7f17cd8 Fix translator, enable selected text translation
Update translator.lua to use a still working google translate API.
Add a method to show translations (main and alternates) in
a TextViewer.
Re-enable "Translate" button in text selection/highlight buttons
dialog.
Target language can be set with a manually added setting:
    translator_target_language = "fr"
and will fallback to the UI language.
2018-12-17 15:19:25 +01:00
Frans de Jonge
1cba60765b
[feat] MenuSorter: add sorting_hint support (#4399)
By adding a `sorting_hint` to a menu item, the program will put orphaned items in the relevant (sub)menu instead of in the first menu with a NEW prefix.

Fixes #4393.
2018-12-14 16:56:57 +01:00
NiLuJe
f020b1264a
A few Kindle fixes (#4394)
* Implement isWifiOn on Kindle (fix #4380)
* Ensure frontlight intensity is properly restored on resume on Kindle. (fix #Fix #4392)
Only actually matters when the frontlight is *off*.
2018-12-10 22:10:35 +01:00
poire-z
98c3f0d366
bump crengine: fix max image height, handle <epub:switch> (#4390)
Includes:
- (Upstream) Fix dangerous compile warnings
- Fix max image height to prevent spurious page breaks
- Hide <epub:case> in <epub:switch>, show only <epub:default>

Adds a style tweak to show <epub:case> and hide <epub:default>
for the curious person.
2018-12-08 22:58:11 +01:00
poire-z
ea946d52d6 bump crengine: tables rendering improvements and others
bump crengine, which includes:
- Adds support for symbol fonts (local or embedded)
- Fix some issues when rendering text in constrained width
- Page splitting: fix possible missing blocks
- CSS: adds support for 'auto', ignore % for borders
- Fix right border drawing position
- Fix: adds missing properties in copystyle()
- Adds comments, erm_killed rendering method
- Adds getRenderedWidths(): get node min/max node content width
- Tables rendering: fixes and improvements
- getRenderedWidths: enable min_width to be a single CJK char
- Fix wrong text wrap avoid in some case
- epub.css: add style for 'blockquote'
- Fix rendering issue when line ends with an image

Adds a few style tweaks related to tables.

Enforce table width: 100% in Wikipedia EPUBs to keep
previous look, which feels better with the various kinds
of tables in Wikipedia pages.

Fix unit tests as juliet.epub (full of blockquotes), grew quite
a few pages with the epub.css update.
2018-12-07 14:11:46 +01:00
Frans de Jonge
f71627cf1d [spec] Version: slight refactor 2018-11-07 20:46:07 +01:00
Frans de Jonge
be32144829 [fix] Version pattern: add two extra numbers for point release
Also see #4303.
2018-11-07 20:46:07 +01:00
Frans de Jonge
42548939bc
[spec] version_spec: forget about rev and commit (#4303)
Stable doesn't have them.
2018-11-02 21:12:00 +01:00
poire-z
233f375af4 Cleanup onSetStatusLine()
Follow up to fa0117bb (#4268), to make things a bit clearer:
Only ReaderRolling get the 'SetStatusLine' event, and tells
crengine about the change, and then send the 'UpdatePos' event.
ReaderFooter now just gets a :setVisible() method.

Now, all the code that calls a self.ui.document:set* method, that
most probably triggers a full re-rendering by crengine, do signal
'UpdatePos' immediately after. This event signals that all page
number, pages count, positions... are no more valid and must be
queried or computed again.
This could also be used if we ever want to cache Page Links or
Screen Boxes: this event will have us dropped these caches.
2018-10-23 13:12:40 +02:00
poire-z
fa0117bb2a Fix default not being used for View mode and Progress bar
Default setting set by holding on the bottom config buttons
for "View mode" (scroll/page) and "Progress bar" (full/mini)
were not used.

Also, when switching Progress bar from 'full' to 'mini',
show the mini bar again.
2018-10-14 21:32:31 +02:00
Martín Fernández
717184f1d6 move e-ink related settings to a submenu (#4246) 2018-10-10 21:34:47 +02:00
poire-z
d8d0def122
Floating punctuation: change default to disabled (#4101)
It was enabled by default, but it's mostly only needed for CJK users.
Furthermore, when floating punctuation is enabled, some rendering
issues exist (text right alignment, variable margins...) that
only CJK developpers could really fix. So, best to disable it and
avoid these rendering issues for most users.

Also: fix CoverBrowser crash when "Delete cache database"
followed by "Prune cache of removed books".
2018-07-24 21:01:45 +02:00
NiLuJe
8089d916a5
Visual feedback around tar/zsync on Kobo during OTA updates (#4043)
* With a bonus version normalizer fix.
  * And a zsync bump/fix to avoid softlocks with OpenStack HTTP frontends (also, pull those from the OTA mirror list).
2018-07-03 23:16:45 +02:00
sebastien
71ff69ec4f cre word gap: use values from defaults.lua (#4045) 2018-07-03 15:29:04 +02:00
poire-z
d8e58a08fd
bump crengine: adds support for dpi-based css units (#4040)
Adds a new toggle to the bottom menu: Zoom (dpi), which
allows for scaling CSS absolute units and image sizes.
2018-07-03 07:05:57 +02:00
Robert
f372dd752b Unit tests: word gap - space condensing (#4036) 2018-06-30 20:49:01 +02:00
Robert
d29a65b96e cre: add Word Gap setting to bottom config panel (#4026)
Maps to crengine's Space Condensing feature (named Word Gap
as a similar feature is named for PDF)
2018-06-30 16:55:43 +02:00
NiLuJe
2f3d1c80dd
Minimal KOA2 support (#4016)
* Minimal KOA2 support
(Touch, Screen, Battery). Hopefully :).
2018-06-23 18:08:11 -04:00
poire-z
b9141897a3
bump crengine: text formatting: fix leading spaces issues (#4008)
Includes:
- text formatting: fix leading spaces issues
- new English US & GB hyph patterns
2018-06-13 01:19:51 +02:00
poire-z
9a0728e421
Style menu cleanup (#3996)
Use epub.css as the main default style, with all file formats
except FB2 (which needs fb2.css).
(epub.css has been cleaned recently to be more conforming to HTML
specs and to not include class name based styles - with conditional
compatiblity styles for previously opened documents. It should be
usable on all HTML based documents, except FB2 which has some
incompatible specs.)

Consider all shipped css files other than "epub.css" and "fb2.css"
obsolete, and put them in a sub-menu (these other css files have
not been updated in the same way, and are kept as-is for when a
previously opened document requests one of them).

Add an icon indicating which style is set as default (like it's
been done for the Font and Style tweaks menus).

Also set the font size of the full status bar (available with
cre documents) when the setting "cre_header_status_font_size"
is present in settings.reader.lua (to add manually).
2018-06-06 13:18:29 +02:00
poire-z
14e77306b7
Fix unit tests after crengine update (#3993) 2018-06-02 19:28:00 +02:00
NiLuJe
e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

I was somehow convinced I'd already done that...
While we're there, explain why we need to siphon those specific vars

* Fix a stray eth0

-> $INTERFACE

* Be very very sure we have INTERFACE set in our env

re #3936

* Make getFirmwareVersion less fragile on Kobo

Not that we actually use it right now, but, still. :D

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

Namely, the H2O² and Aura SE
Not that the H2O²r2 support is still broken, this just allows us to
implement it cleanyl without breaking handling of the original H2O²

re #3925

* Tweak sleeps a bit around Kobo WiFi modules...

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
2018-05-10 12:26:07 +02:00
poire-z
62630706bb
bump base/crengine: stylesheet handling improvements (#3934)
Includes:
- Fix a few CSS selector issues
- CSS: add support for some pseudo-classes
- Hyphenation: update fr & de patterns
- CSS: Fix non-lowercasing of specific elements names
- Revert parts of recent BR handling fixes
2018-05-07 23:58:12 +02:00
poire-z
8b2253b3e9
bump base: crengine, freetype, libjpeg-turbo (#3928)
Includes:
- [build] FreeType: bump to 2.9.1
- [build] bump libjpeg-turbo to 1.5.3
- bump crengine:
 - Fix CSS selector specificity computation
 - [fix] crengine/src/lvfntman.cpp: improve letter_spacing limit
 - [fix] crengine/src/lvxml.cpp: add all empty HTML elements
 - html head styles: fix styles not being applied
 - Hyphenation: increase MAX_PATTERN_SIZE from 16 to 35
 - html documents: proper handling of <BR> tags
 - Allows requesting old (broken) XML/DOM building code
- cre.cpp: setStyleSheet(): accept filepath and/or css text,
  and added getIntProperty() and getStringProperty()

credocument/readerrolling: request older XML/DOM building code
for books previously opened, to not lose bookmarks and highlights

(unit tests update because of new handling of consecutive BR via css
pushed links down in the book)
2018-05-05 00:38:50 +02:00
Robert
9e67c5a614 CloudStorage: Allow use reserved characters in FTP username and FTP password (#3924)
Depends on RFC 3986 compliant util.urlEncode() and adds unit tests for the new functions.
2018-05-04 17:06:58 +02:00
Frode Austvik
f12f317e9d [spec] Replace custom assert[Not]AlmostEquals with assert.is[_not].near (#3885)
Also, change "make static-check" to also check the tests.
2018-04-15 23:49:08 +02:00
poire-z
82b13a64b0
Fix overlap in scroll mode for cre documents (#3870)
Use a setting 'copt_overlap_lines' (default to 1) for the
number of text lines from previous page to show on next
page (instead of a hardcoded and unscaled 20).
Take footer height into account for overlap calculation
and dim area.
Show overlap only when changing pages (not when panning).

Also fix ReaderFooter:getHeight() which was returning
a higher height than the real one since footer refactoring.
2018-04-14 00:26:57 +02:00
Frans de Jonge
2c1178896c
[feat] Add ReaderBack (#3821)
This implements a reasonable facsimile of going back on Android.

The back button first goes back in a history of visited pages.
When there's no history left, it closes the app.

Fixes #3816.
2018-03-31 21:19:31 +02:00
onde2rock
1b91470899 [FocusManager] More intuitive key navigation + spec (#3774)
FocusManager now finds the closest widget on the right or left on inner horizontal border.

See : https://github.com/koreader/koreader/pull/3765#issuecomment-373944897
2018-03-21 12:21:48 +01:00
poire-z
c93bbec40d
cre: more constrast settings (#3737)
Use ButtonProgress like it was done for kopt.
2018-03-11 14:54:17 +01:00
Frans de Jonge
e15a1ab1b3
[fix, spec] InputText:addChars() unicode handling (#3729)
Also rename from `addChar` to `addChars` for clarity.

Fixes #3703.
2018-03-07 10:22:49 +01:00
Frans de Jonge
8633d4bed1
[spec] Input test stub (#3701) 2018-03-01 20:40:23 +01:00
Frans de Jonge
720fd5d826
[spec] Test all aspects of Math module (#3683) 2018-02-22 12:26:51 +01:00
Frans de Jonge
ced9e45d92
[fix] DocumentRegistry: don't create empty sdr and add hasProvider() (#3675)
As suggested by @poire-z https://github.com/koreader/koreader/pull/3653#issuecomment-364663156
2018-02-10 18:36:18 +01:00
poire-z
5357fdde7c
cre full text search: fix inconsistencies (#3656)
Fix various inconsitencies: some occurences not highlighted
on displayed page; different occurences highlighted on same
page wheter we went there searching backward or forward; pages
with occurences simply just skipped when searching in one
direction, and not in the other...
To avoid edge cases, crengine will now give back results on up
to 3 pages, that we need to filter.
Bump base and crengine
2018-02-04 20:57:13 +01:00
Frans de Jonge
f6ca1c7c0a
[feat] Open with: choose which engine to use for file (#3653)
Fixes #3345

* Add SVG to MuPDF filetypes
2018-02-02 21:21:52 +01:00
Frans de Jonge
d714bd3aea
[feat] DocumentRegistry: add getProviders() and preferred by weight (#3651)
This is step one toward "open with".

References https://github.com/koreader/koreader/issues/3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
* Add a few image files to MuPDF
	* ".bmp",
	* ".gif",
	* ".hdp",
	* ".j2k",
	* ".jp2",
	* ".jpeg",
	* ".jpg",
	* ".jpx",
	* ".jxr",
	* ".pam",
	* ".pbm",
	* ".pgm",
	* ".png",
	* ".pnm",
	* ".ppm",
	* ".tif",
	* ".tiff",
        * ".wdp",
2018-01-31 20:49:21 +01:00
Frans de Jonge
90059221db
[spec] util_spec: tests for util.getFriendlySize() (#3650) 2018-01-31 17:22:34 +01:00
Hzj_jie
65f26cecbb Do not execute background runner if device is suspended (#3608) 2018-01-17 09:17:53 +01:00
Robert
605df50fbd [fix] util.secondsToClock 00:60 should be 01:00 (#3371) 2017-10-18 15:27:27 +00:00
Hzj_jie
7461e396dd [chore] Ignore empty files and tables in DocSettings (#3348) 2017-10-12 19:52:01 +02:00
Frans de Jonge
0fa090ee47 [chore] Rework util spec, rework util.secondsToClock: round seconds to minutes in 00:00 mode + spec
Most of the tests in util_spec were the wrong way around.
It's `assert(expected, given)`.
2017-10-12 19:39:52 +02:00
Frans de Jonge
1508fe27c9 dbg_spec: setVerbose test 2017-10-12 19:39:52 +02:00
Frans de Jonge
a394e644b5 Add gettext_spec stub (#3343) 2017-10-11 14:22:11 +02:00
Frans de Jonge
53c0756def CircleCI: finishing touches (#3340)
* junit test results; unfortunately this seems to conflict with the verbose out

* fix deps cache: two files can change independently

* verbose print obsoleted by gtest in upsream busted
2017-10-11 08:38:30 +02:00
Frans de Jonge
5bd288e378 [fix] #nocov on broken scroll mode tests 2017-10-10 14:08:49 +02:00
Frans de Jonge
372967bc65 [fix] MockTime spec 2017-10-10 14:08:49 +02:00
Frans de Jonge
a710d2c68a Fix readerfooter_spec (#3326)
My bad, leftover from #3323 but not caught due to some Travis → CircleCI migration birth pains.
2017-10-08 22:01:42 +02:00
Frans de Jonge
6e52e559ae [fix, Android] Don't steal frontlight control on start (#3319)
I believe this should be `if isKobo()`, or better yet that the entire
block should be moved to `KoboPowerD:init()` because afaik that is the
only platform where the system doesn't provide trustworthy frontlight
information. But to be absolutely sure that I don't break anything (and I
don't want to spend any time on this atm) I'm temporarily excluding only
Android where this behavior is known to be problematic.

See discussion in https://github.com/koreader/koreader/issues/3118#issuecomment-334995879

References #3118 (using keyword "references" because phrases like "possibly fixes"
result in GH autoclose).
2017-10-08 16:40:24 +02:00
Frans de Jonge
d23d01643e Add LuaData and Dictionary Lookup History (#3161)
* Add dictionary history

Fixes #2033, fixes #2998.

* Add LuaData

* table handling in base settings

* Add LuaData spec
2017-10-07 22:13:46 +02:00
Frans de Jonge
23e2183931 [fix] KOSync plugin server location (#3288)
This is only step one. It remains to be determined why the connection is downgraded to sslv3, which will result in a handshake failure.
2017-10-02 09:51:34 +02:00
Frans de Jonge
a6be301695 Added Size module 2017-09-23 20:24:45 +02:00
Frans de Jonge
9eb073a524 [travis] Add protection against unscaled sizes
As pointed out by @poire-z

* [fix, UX] SkimToWidget scaling

* [fix] Button scaling

* [fix, UX] Scale ProgressWidget

* [fix, UX] Scale confirmbox

* [fix, UX] Scale just about everything
2017-09-23 20:24:45 +02:00
poire-z
2c1e7f2a4f Bump base for crengine bump (#3249)
crengine crashes, rendering and selection delay fix by @frankyifei
2017-09-23 00:10:47 +02:00
Frans de Jonge
cfaa119c35 [fix, UX] Allow modal widget on top of modal widget (#3170)
Fixes #2653.
2017-09-05 00:01:46 -07:00
Frans de Jonge
829e2fffd8 [fix] MenuSorter: take care of orphaned submenus
See https://github.com/koreader/koreader/pull/3167#issuecomment-326805768
2017-09-04 22:55:14 -07:00
Hzj_jie
1ff46a67b4 SwitchPlugin and BackgroundTaskPlugin with tests (#3137) 2017-08-31 16:37:39 +02:00
Frans de Jonge
4513718a2a [fix] MenuSorter: ignore separator as first item
See https://github.com/koreader/koreader/pull/3107#issuecomment-323581851
2017-08-20 21:12:17 +02:00
Frans de Jonge
7277059176 add unit test 2017-08-17 11:18:28 +02:00
Zijie He
2ba079e3eb Reserve last good docsetting 2017-08-17 08:50:15 +02:00
Frans de Jonge
1fd8989906 [ci] readerlink_spec.lua: #nocov on failing tests 2017-08-16 17:44:16 +02:00
Frans de Jonge
7b12954cad [ci] #nocov on BatteryState
All tests fail while trying to do coverage.
2017-08-16 17:15:12 +02:00
Frans de Jonge
e3c17aa6d0 Travis: run luacheck on unit tests (#3059)
* Travis: run luacheck on unit tests
2017-08-08 13:35:40 -07:00
Robert
1bfad22af0 Fix: Footer hides text (#3056)
This patch should resolve issue #2257 (Footer hides text)
Sometimes, depending on an epub style, some text is hidden by the progress bar (the mini one at the bottom).
2017-08-08 19:06:11 +02:00
Hzj_jie
a8513c95b6 Several minor fixes (#3057)
1. Android.getScreenBrightness() is used in frontend/device/android/powerd.lua to retrieve the frontlight intensity.
2. kosync.koplugin won't save settings for whisper sync.
3. batterstat.koplugin won't work correctly if several on* events are fired.
2017-08-08 08:29:57 +02:00
Hzj_jie
c9a997f42c BackgroundRunner (#3008)
* Use getCapacityHW() to ensure latest battery capacity can be retrieved

* BackgroundRunner

* Start background_runner_spec.lua

* AutofrontLight plugin now uses BackgroundRunner plugin
2017-07-28 16:48:19 +02:00
Hzj_jie
d6845d94b1 ReadHistory: support reload (#3003)
Allows ReadHistory to reload according to the modification timestamp of history.lua.
2017-07-19 14:56:17 +02:00
poire-z
17656778b1 Book information: refactored and additional features
- Factored out duplicate code from filemanager.lua and filemanagerhistory.lua
to new filemanagerbookinfo.lua (and other common code to filemanagerutil.lua).
- Uses sidecar files' new doc_props and doc_pages settings, or fallback to
old 'stats' settings, or to opening document.
- Shows filename, filetype and directory.
- Shows description (Hold to see whole truncated text), keywords, and
cover image (tap to extract image from document and display it if available).
- Book information now available from reader menu, to display info about
the currently opened book.
- Convert possibly HTML description to plain text via added
util.htmlToPlainTextIfHtml() (for simple HTML conversion).
2017-07-14 16:46:38 +02:00
Frans de Jonge
9b557ed15a Bump base: crengine update (#2985)
* crengine: return description and keywords metadata
  Only available for EPUB documents for now. @poire-z
* crengine: css related improvements, fix crash, better handling of gif @frankyifei
2017-06-28 08:39:24 +02:00
Hzj_jie
970f2e7306 Several improvements of AutoFrontlight plugin and enable it by default (#2975)
* Force refresh when kindle is out of screensaver or usb is unpluged.

* Improve AutoFrontlight

* More plugins sub menu

* Last brightness should always be updated

* Finish autofrontlight improvement and enable it by default.

* More tets

* onFlushSettings

* MenuSorter can now correctly sort sub menus
2017-06-24 09:55:31 +02:00
Hzj_jie
7d2ed4c3d0 Move kobo auto-suspension logic out of UIManager (#2933) 2017-06-23 10:04:11 -07:00
Hzj_jie
53eb4dee50 AutoFrontlight plugin (#2941)
* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
2017-06-14 19:32:16 +02:00
Frans de Jonge
ed0ba6737e test: add optmath spec stub (#2950)
* test: add optmath spec stub
2017-06-13 09:40:56 -07:00
Frans de Jonge
2096a27b65 test: add translator spec (#2953) 2017-06-13 00:11:43 -07:00
Hzj_jie
30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 2017-05-16 02:11:11 -07:00
Qingping Hou
55ec64a859 readermenu(fix): override pan gesture from scrolling 2017-04-24 15:19:38 +02:00
Qingping Hou
72ae80870c quickstart fix (#2804)
* translation text fix

* quickstart(fix): go back to home dir after document close

* quickstart(fix): purge old quick start files

* spec: fix quickstart tests
2017-04-24 08:27:29 +02:00
Frans de Jonge
a192178bf6 Version spec: slight improvements 2017-04-22 02:15:56 -07:00
Frans de Jonge
21622b5da8 Spec: Wikipedia stub 2017-04-15 15:59:03 -07:00
Frans de Jonge
89099e2c94 Swipe for menu and quickstart guide (#2761)
* Swipe for menu and quickstart guide

Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.

Fixes #2608.

* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec
2017-04-15 14:45:56 +02:00
Hzj_jie
999898fa69 Merge various information into systemstat (#2764)
* Merge various information to systemstat
2017-04-14 21:12:28 +02:00
Frans de Jonge
92b9139294 ReaderFooter (lang): "Show toc markers" to "Show chapter markers"
I think it sounds more natural as chapter than as table of content, which is an implementation detail (i.e., the chapter markers are shown based on what's in the TOC).

Also removed redundant "this" from "Remaining pages in this chapter"
2017-04-08 01:39:25 -07:00
Frans de Jonge
3982170886 MenuSorter: fix findById 2017-04-04 08:04:14 -07:00
Frans de Jonge
e9df73f6dc Developer documentation improvements
* Fixed up all of util and added when absent
* Updated widget examples to new coding style
2017-04-04 08:01:15 -07:00
Robert
a3c4254809 Added util.fixUtf8 (#2704)
* Remove invalid UTF-8 chars from OPDS
* add unit tests
2017-04-02 16:17:49 +02:00
Hzj_jie
ea2de9638b LuaSettings:wrap() / LuaSettings:child() function to create an LuaSettings to represent a sub table of an existing one (#2685) 2017-03-28 15:10:36 -07:00
Frans de Jonge
8b7e18a7d7 MenuSorter: resolve review comments
* simplify user config loop
* simplify unit test for Travis memory use
* remove unused util variable
2017-03-26 11:12:44 +02:00
Frans de Jonge
ddf590eb6d MenuSorter: split out menu order configuration 2017-03-26 11:12:44 +02:00
Frans de Jonge
33c848f813 MenuSorter: first unit tests 2017-03-26 11:12:44 +02:00
Frans de Jonge
653ff64438 MenuSorter: handle disabled 2017-03-26 11:12:44 +02:00
Frans de Jonge
8f31a81601 MenuSorter: some documentation
MenuSorter: forgot to add plugin style change

MenuSorter: worked out the final quirks

* Menu always compressed into tables without missing indexes for ipairs compatibility
* Orphans attached
* Separators no longer count as items
2017-03-26 11:12:44 +02:00
Frans de Jonge
56659ddb20 MenuSorter: avoid recursion in findById 2017-03-26 11:12:44 +02:00
Frans de Jonge
b7b5950e98 MenuSorter: review comments and various bug fixes
* fixed wrongful retention of submenus variable and added return to MenuSorter:findById
* fixed readerfooter_spec.lua error
* fixed review comments
2017-03-26 11:12:44 +02:00
Qingping Hou
2aa9d5d64e test: add unit tests for docsettings 2017-03-06 07:47:20 +01:00
Qingping Hou
9b7aba3fba fix: override readerhighlight hold in readerfooter
Also fix touch zone dependency graph generation code.

ReaderHighlight has now been migrated to use touch zone

Inputcontainer's touch event handling logic changed to only stop
propagation when handler returns `true`. Previously, it stops
propagation when a handler is found. This is needed to support
both readerhighlight_tap and tap_forward touch zones.
2017-01-30 05:53:44 -08:00
Qingping Hou
0b9c9d6ddb test(chore): remove side effects 2017-01-30 05:53:44 -08:00
Hzj_jie
529d1b3d33 evernote: ReadHistory integration and text file output (#2498) 2017-01-21 01:32:42 -08:00
Qingping Hou
581039aed5 opds(fix): unescape name and value 2016-12-29 00:02:22 -08:00
poire-z
a8dd8c6f30 textboxwidget: even better text wrapping
util.isSplitable() accepts now also the previous char to help
decide if a space can be used to split a line.
TextBoxWidget:_splitCharWidthList() : simplified logic
2016-12-14 11:39:46 -08:00
poire-z
5040bfe4c5 textboxwidget and scrolltextwidget enhancements (#2393)
util: made isSplitable() accept an optional next_char
for wiser decision

textboxwidget: speed up rendering, enhanced text wrapping,
allow selection of multiple words with Hold.

scrolltextwidget: allow scrolling with Tap.

Details in #2393
2016-12-11 14:32:02 -08:00
Qingping Hou
a6c506dc10 kobolight(refactor): move into plugin & only enable for kobo 2016-12-10 16:06:51 -08:00
Qingping Hou
0c49b915de refactor: add touch zone subsystem to inputcontainer
Touch zone decouples screen size from gesture event registration.

The win here is each individual widget does not need to update
gesture range on screen rotate/resize anymore.

Another advantage is we now have a centralized ordered array to handle
all registered touch event listeners, makes it much easier to resolve
gesture range conflicts between multiple widgets.

This patch also includes the following changes:

* migrate readerpaging to use readerui's touch zone
* migrate readerfooter to use readerui's touch zone
* move inverse read direction setting to touch menu's setting tab
* moved kobolight widget from readerview into readerui
* various dead code cleanups and comments
2016-12-10 16:06:51 -08:00
Hzj_jie
9efc723388 PR #2356 breaks CJK character splitting 2016-11-25 16:46:56 -08:00
Qingping Hou
cd24eb82d7 readerpaging(fix): handle edge cases where paging pan will crash the reader 2016-11-24 00:41:29 -08:00
robert00s
fc5ba9b862 Fix hyphenation words with unicode character in texboxwidget (#2356) 2016-11-19 12:26:53 -08:00
Qingping Hou
efae2ed16f network(fix): automaticallly obtain IP if network is already authenticated 2016-11-06 23:56:29 -08:00
Qingping Hou
558754e9b5 footer(refactor): various bug fixes and optimizations 2016-11-05 00:06:26 -07:00
Qingping Hou
abbb72b6d3 readerrolling(fix): do not emit PageUpdate event until document is ready 2016-10-08 15:53:58 -07:00
Hzj_jie
f1637ef19b Merge pull request #2268 from Hzj-jie/master
This is the implementation of whisper sync
2016-10-07 14:47:58 -07:00
Hzj_jie
fd7ae875c0 Whisper sync feature
Now KOReader supports more sync options, and most of the sync operation can be
executed automatically.
2016-10-07 11:23:27 -07:00
Qingping Hou
ebc7055b43 chore: move kobo specific code into kobo/device.lua 2016-09-19 01:10:53 -07:00
Qingping Hou
31470efa3b Merge pull request #2250 from Hzj-jie/master2
Add readhistory_spec / docsettings_spec
2016-09-13 00:35:28 -07:00
Zijie He
ced671bc69 Add readhistory_spec / docsettings_spec 2016-09-12 20:04:13 -07:00
Zijie He
125fb6dfc6 unload network manager package to ensure it is initialized correctly. 2016-09-12 14:52:22 -07:00
Zijie He
9b66bf1149 Restore WIFI state when koreader starts. 2016-09-12 11:53:42 -07:00
Hzj_jie
da2c57f93a Automatically connect WIFI after Kobo has been resumed (#2215)
* Add bash scripts to control WIFI / IP, so we can share them with frontend/device/kobo/device.lua.

* add test cases
2016-09-01 00:05:40 -07:00
chrox
001433e6bc various test/coverage optimization 2016-08-15 00:32:40 +08:00
chrox
7fd6037bb0 fix #2219
The ABS_PRESSURE ABS code is also detected on some KOBO devices
if ABS_PRESSURE events are feeded to handle orientation those devices
will have a unresponsive screen as described in #2219.

This patch registers an event adjustment handler for Kindle Oasis to
adjust the ABS_PRESSURE code to ABS_OASIS_ORIENTATION code so that
it won't affect event handling on other devices.
2016-08-13 18:57:15 +08:00
chrox
9ab005a1d3 fix unit test of readerlink and readerpaging
and have more confidence with the unit testing framework.

Now `make testfront` won't retry on failure and testing files are
ordered in each run so that it's possible to reproduce testing failure.

And this patch also fix flush settings not working before suspend issue:
at some point the `FlushSettings` event is sent to `UIManager` instead
of `ReaderUI`, but `UIManager` only delegated events to active widgets
and `ReaderUI` is actually not an active widgets thus will miss the event.

This patch also add a verbose debug mode with "-v" as a switch to turn
on this mode. With verbose mode on, event handling will be logged.
2016-08-12 17:05:07 +08:00
Qingping Hou
61b6896391 Merge pull request #2217 from chrox/benchmark_tool
fix k2pdfopt performance degradation
2016-08-11 13:37:39 -04:00
chrox
9afad43a3e refactoring utils to tools as discussed in #2197 2016-08-11 19:29:09 +08:00
chrox
7ea12c0198 fix broken unit tests on Travis CI
1. It turns out that `device_id` is not defined in unit test environment
which makes the `assert(self.kosync_device_id)` fail and somehow makes `luajit` segmentation fault.
2. In the device spec, stubbing `io.open` will make subsquent `require`
all return boolean value and segmentation fault `luajit`.

This patch is a minimum viable change that makes CI work on both my
local box and Travis.
2016-08-11 18:17:09 +08:00
Zijie He
820a39c8f7 Update KOSyncClient 2016-08-10 10:42:51 -07:00
Qingping Hou
1c5543358c readerfooter(fix): avoid setting mini footer to invisible when full progress bar is on
Our previous assumption is user will only choose between full or min
bar. The does not hold anymore as many more info has been added to the
mini bar and sometimes user might want to have both of them on. This
patch makes the reader behavior consistent when both bars are set to be
on for a document.
2016-07-23 18:00:37 -07:00
Qingping Hou
f30e487959 readerpaging(fix): set the corrent page number on GoBackLink event 2016-07-18 01:33:35 -07:00
Qingping Hou
3339ed4e5f test(fix): update tests for default scroll mode 2016-07-17 23:33:03 -07:00
Qingping Hou
0d9fc17d7c chore: rename SetDefaults:SaveSettings 2016-07-16 22:47:19 -07:00
Qingping Hou
20eb36a03d feat: add network management UI for kobo 2016-07-11 23:50:19 -07:00
chrox
71bf9efc7c split accient greek words with spacing character
This should fix #1705.
2016-06-28 23:50:25 +08:00
Qingping Hou
fadad90447 uimanager(fix): handle stack change in close 2016-06-21 01:53:42 -07:00
Qingping Hou
af2f3c30c7 uimanager(fix): handle last widget in broadcast event properly 2016-06-18 22:32:08 -07:00
chrox
f5ea29c8d3 fix unit test of defaults since we deleted one global default
I'm afraid this unit test is not maintainable, each time we
change the structure of the defaults.lua we must change this spec
accordingly. We probably will get rid of defaults.lua as well as the
filemanagersetdefaults and this spec.
2016-06-15 02:52:58 +08:00
Qingping Hou
ce7ae2dfac uimanager(fix): handle edge case where second widget in stack is ignored 2016-06-11 12:17:18 -07:00
Hzj_jie
cf8c0aa81f Add docsettings unittest 2016-06-06 10:05:16 -07:00
Hzj_jie
016aaa92b9 Merge remote-tracking branch 'upstream/master'
Conflicts:
	frontend/docsettings.lua
2016-06-06 08:56:07 -07:00
Qingping Hou
301925e34a textboxwidget(fix): handle onHoldWord event 2016-06-05 00:37:54 -07:00
Qingping Hou
adf5ffdd26 dictquicklookup(fix): use self.region for matching hold event 2016-06-05 00:08:23 -07:00
Qingping Hou
2e417cfbd8 filemanager(refactor): use purge method from docsettings 2016-06-03 22:06:02 -07:00
Qingping Hou
8268d8d32c test(fix): clean up after screenshot test 2016-06-01 21:32:35 -07:00
chrox
449089881c accommodation of EPUB spec for new crengine 2016-06-01 21:35:14 +08:00
Huang Xin
f718b0669f Merge pull request #2045 from koreader/defaults
defaults(refactor): remove global hack in filemanagersetdefaults
2016-06-01 08:31:36 -05:00
Qingping Hou
a92a88e063 uimanager(fix): check active widgets in the correct order 2016-05-29 22:03:04 -07:00
Qingping Hou
9586b36eb6 defaults(fix): purge entry from persistent file 2016-05-26 00:44:42 -07:00
Qingping Hou
60587e08c6 defaults(refactor): remove global hack in filemanagersetdefaults
also added screensaver folder setting dialog for kobo
2016-05-25 22:07:20 -07:00
Qingping Hou
82a3e0f9ad automatically adjust ev time for kobo touch 2016-05-23 23:21:14 -07:00
Qingping Hou
068cefe8fc test: flush book settings before suspend 2016-05-02 22:42:19 -07:00
Qingping Hou
f01b261188 test: add kindle init and fl tests 2016-04-30 22:41:44 -07:00
Qingping Hou
ef4004e72b test(fix): disable footer in readerlink_spec 2016-04-28 20:31:17 -07:00
Qingping Hou
7c380121ea test: more readerfooter progressbar tests 2016-04-28 01:26:10 -07:00
Qingping Hou
0f3eeb24c9 progressbar(fix): persist progressbar visibility 2016-04-28 01:25:18 -07:00
Qingping Hou
eb71d29716 kodev(minor): fix arg test 2016-04-23 21:22:57 -07:00
chrox
7071ae2b6e fix unit test of occurrences search 2016-04-23 21:53:06 +08:00
Qingping Hou
d7b1b403c1 progresswidget(fix): ignore nil self.last 2016-04-20 23:16:40 -07:00
Qingping Hou
572412b1f6 readerrolling(fix): detect end of book properly 2016-04-20 23:12:07 -07:00
Qingping Hou
c22a3747d8 fix all the tests 2016-04-19 00:01:28 -07:00
Qingping Hou
4a66036eb0 test: update test to match the new crengine typesetting 2016-04-18 23:51:06 -07:00
Frans de Jonge
5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 2016-04-16 12:37:08 +02:00
Qingping Hou
eb37d9b8b6 kobo: fix screen probe for touch 2016-04-02 23:06:09 -07:00
Qingping Hou
144fd170f1 uimanager(refactor): replace autosuspend if check with noop 2016-03-29 10:02:53 -07:00
Qingping Hou
e3137134f8 dbg(add): guard method to toggle assert at based at runtimemode 2016-03-28 23:38:25 -07:00
Zijie He
b86aa5a02b Implement auto-suspend function for Kobo. Add test case for UIManager:_checkTasks, which should not clear _task_queue_dirty bit before looping. 2016-03-28 17:53:18 -07:00
Qingping Hou
e5c1ff1ef6 test(bookmark): purge doc settings before test 2016-03-27 17:17:46 -07:00
Qingping Hou
11d5b5c0a1 fix(readerlink): restore reader view context on go back 2016-03-27 16:01:56 -07:00
Qingping Hou
2d5222ef33 readerview: add get/set methods for view context 2016-03-27 15:39:59 -07:00
Qingping Hou
f48d9bd6d9 fix(readerfooter): marker ticks initialization 2016-03-18 23:24:51 -07:00
Qingping Hou
adc7ddccfc test: start every test suit with a clean reader setting 2016-03-12 15:52:04 -08:00
Qingping Hou
c8cd1d67f5 test: more readerfooter tests 2016-03-12 01:00:52 -08:00
Zijie He
61ec784f91 Add eink_optimization_spec 2016-03-08 19:38:06 -08:00
Qingping Hou
e52c74afcc test: more uimanager scheduler test 2016-03-07 22:52:52 -08:00
Qingping Hou
b65983da1a multi-touch: add tests for gesturerange moudle 2016-03-06 22:45:40 -08:00
Qingping Hou
8190093f83 kobo: don't create FrontLightState config if it didn't exist to begin with 2016-03-02 18:25:17 +01:00
zijiehe
e84093c414 Add a flState in Kobo, and KoboPowerD:toggleFrontlight uses flState to control the light instead of intensity. 2016-02-26 15:34:23 +08:00
Qingping Hou
8c01835458 fix: only show reader status at the end of the book 2016-02-23 22:43:35 -08:00
Qingping Hou
69f9ebd528 build: fix doc generation
also moved MD5 to koreader-base/ffi
2016-02-23 22:01:12 -08:00
Qingping Hou
03e81cfa4d test: fix readerui instance reset test 2016-02-17 00:06:55 -08:00
Qingping Hou
417bb5fb14 test: kill in fly hinting event 2016-02-16 23:26:08 -08:00
Qingping Hou
5e3100874f test: purge doc settings before test 2016-02-15 22:43:47 -08:00
Qingping Hou
12c6bd7121 test: fix readerbookmark unit test 2016-02-14 23:55:32 -08:00
chrox
493c887829 fix travis testfront 2016-02-07 21:48:26 +08:00
Qingping Hou
71ef994318 test: add nickle conf spec 2016-02-03 10:35:47 -08:00
Qingping Hou
d1ca8bc494 fix(filemanager): delete document with settings 2016-01-09 12:12:10 -08:00
Qingping Hou
722eaed4b2 feat: docsettings:getSidecarDir 2016-01-09 12:12:10 -08:00
Qingping Hou
3b92bdc084 feat: support screenshot in filemanager 2016-01-03 00:47:44 -08:00
Qingping Hou
5aefb41631 fix readerfooter spec 2015-12-26 14:20:51 -08:00
Qingping Hou
ab98097e72 add tests for scheduler 2015-12-26 12:59:57 -08:00
Qingping Hou
55234ef899 fix: read stats crashes pdf/djvu documents 2015-12-25 20:57:11 -08:00
chrox
19979fb8f8 postpone loading of httpclient module in unit test 2015-10-07 23:00:49 +08:00
chrox
54f5166254 add koptinterface spec 2015-10-07 22:42:12 +08:00
chrox
429eeed372 verbose unit test log so that we have a clue when there is segfault 2015-10-07 15:14:27 +08:00
Qingping Hou
cdd17906f6 refactor: ui/font:getFace 2015-09-13 01:10:09 -07:00
chrox
f0dbd5939c fix travis build segfault hopefully 2015-09-13 03:28:17 +08:00
Frans de Jonge
6eca0be44b Spec updates for new font 2015-09-07 09:42:23 +02:00
Qingping Hou
a30fe26de0 Merge pull request #1543 from chrox/plugable-turbo
disable turbo lib by default
2015-06-03 12:47:07 -04:00
chrox
a59621953d use turbo library in coverage test 2015-06-02 21:23:30 +08:00
chrox
c7cac7b333 disable turbo lib by default 2015-06-02 13:07:17 +08:00
chrox
1fcc425eac regression test to safeguard droid sans fallback 2015-06-02 12:29:54 +08:00
chrox
a4404cfb10 Add missing urw fonts and fix unit test 2015-04-28 22:20:12 +08:00
chrox
d468b05567 Use turbo looper on Android 2015-04-28 11:06:38 +08:00
Qingping Hou
3a55edd0d5 chore: remove test tag 2015-04-27 00:46:01 -04:00
chrox
0058bc8511 Fix readerbookmark unit test 2015-04-27 11:09:28 +08:00
Qingping Hou
186673587e chore: fix some of the luacheck errors 2015-04-26 20:57:45 -04:00
chrox
932df2a2f9 Refactor out string.gsplit to util.gsplit 2015-04-22 14:27:33 +08:00
chrox
2f2611af42 fix Travis test 2015-03-21 17:02:25 +08:00
chrox
3984d5b31d disable debug in unit test 2015-03-09 20:44:37 +08:00
chrox
d08e22ec2e add simple sync service as a plugin
The 'KOSync' plugin will synchronize furthest reading progress
across different koreader devices after users registering their
devices.

The synchronizing service is open-sourced as the project
[koreader/koreader-sync-server](https://github.com/koreader/koreader-sync-server).
2015-03-09 20:20:36 +08:00
chrox
9ab6224963 add lua Spore to build REST client 2015-03-07 17:05:24 +08:00
chrox
d7faba5b5c request from async http client only accept one callback
and error should be checked in the callback
2015-03-07 11:19:43 +08:00
chrox
0191dc6530 revert busted to v1.10.0 to avoid segmentation fault in testing 2015-03-05 17:56:03 +08:00
chrox
4053b5adac fix unit test with latest busted 2015-03-03 18:00:38 +08:00
chrox
e74d1fa557 turn off debug in unit test 2015-03-02 17:24:35 +08:00
chrox
9299b9a5e8 add async http client
it uses non-blocking turbo I/O looper to process http request
so that multiple http request can be handled simultaneously and http request
won't block user input, and most importantly, in Lua's way.
2015-03-02 17:21:26 +08:00
chrox
5c9a9198fb add Document:fastDigest method to calculate document hash without performance overhead 2015-03-02 14:55:16 +08:00
chrox
07ff30f89c add md5:update and md5:sum methods 2015-03-02 14:55:16 +08:00
Qingping Hou
f1d44ec809 test: add imagewidget_spec 2014-12-18 03:33:44 -05:00
chrox
4f35834b2e wrap computation intensive functions in hook free env when makeing coverage test
so that Travis CI job won't fail because of timeout.
2014-12-03 11:01:12 +08:00
chrox
d6c4465c47 fix coverage test fails on OPDS browser module
for some reason luxl.lua has problem when being set hook for luacov
2014-12-01 14:46:17 +08:00
Frans de Jonge
47d7a48555 OPDS: refactored unit test and fixed a minor bug with undefined image_rel 2014-11-30 21:44:47 +01:00
Frans de Jonge
c25254a7ec OPDS: embryonic unit test for OPDS browser
This initial seed specifically tests against what recently broke in Gutenberg and FeedBooks.
2014-11-30 19:06:27 +01:00
chrox
fe885be563 refactoring readerbookmark to show both bookmarks and highlights
in the bookmark menu
and use binary search of the sorted bookmarks table whenever is
possible.
2014-11-27 22:01:57 +08:00
chrox
08dff3a158 turn off debug in unit test by default
Uncommnet the `DEBUG:turnOn()` line to turn it on.
2014-11-27 22:01:57 +08:00
chrox
08f0f14ba3 fix dictionary spec 2014-11-21 18:45:07 +08:00
chrox
566586619a add unit tests for readerdictionary and readerhighlight 2014-11-21 18:32:43 +08:00
chrox
033ffb1d0f update readersearch and readertoc specs as crengine is updated 2014-11-18 16:08:39 +08:00
chrox
b80dd1f966 add fulltext search for PDF documents 2014-11-17 17:58:44 +08:00
Hans-Werner Hilse
841e8bd9fa add test for md5 implementation 2014-11-11 16:24:26 +01:00
chrox
616ef3ba8e quit uimanager before run uimanager in test 2014-11-05 18:06:05 +08:00
chrox
ae1dd3b380 screenshot to PNG files by default 2014-11-05 16:58:09 +08:00
chrox
bd0975896d add fulltext search for EPUB documents 2014-11-05 12:28:28 +08:00
Hans-Werner Hilse
3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
2014-11-02 21:19:04 +01:00
Qingping Hou
df61760c82 test: add spec for Menu.itemTableFromTouchMenu 2014-10-25 19:32:30 -04:00
chrox
7c9130744c add collapsable TOC menu 2014-10-14 21:34:56 +08:00
chrox
de38ea1199 count only leaf nodes of toc tree when level is zero 2014-10-11 21:10:07 +08:00
chrox
b422eb90cc refactoring readerrolling
and fix lossing progress when switching screen mode
2014-10-10 18:14:33 +08:00
chrox
cec8ee3c29 add isChapterBegin/End API for readertoc
and add missing test epub
2014-10-07 17:44:10 +08:00
chrox
b09bb87d4e refactoring readertoc and readerfooter
so that they don't repeat themselves.
2014-10-07 17:10:48 +08:00
chrox
d0b4fa2665 refactoring unit testsuite 2014-10-07 13:06:06 +08:00
chrox
f1f8d8dc4f make coverage target for code coverage for the unit test
so that we can easily find which module needs unit test

In order to run 'make coverage' `luacov` need to be installed
with 'sudo luarocks install luacov'.
2014-10-06 21:31:08 +08:00
chrox
794baf4d8a benchmark has no specifications so won't be run by default 2014-10-06 21:22:38 +08:00
chrox
8294a629b8 treate quoted slash as plain text in attribute value 2014-09-10 13:27:14 +08:00
chrox
21dcf787da add OPDS support
This PR implements a simple OPDS browser which can be launched
from filemanager menu.
2014-09-05 21:07:43 +08:00
chrox
7048ca971b add getCoverPageImage api for CreDocument 2014-08-22 21:32:03 +08:00
chrox
b6393b543b no need of luagettext module 2014-05-30 23:22:13 +08:00
chrox
da84daf17f add cache spec 2014-05-30 23:20:55 +08:00