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
* Mangle stupid defaults test so that it compares tables, and not a non-deterministic string representation of one.
It's still extremely dumb and annoying to update. (i.e., feel free to kill it with fire in a subsequent PR, I think everybody would cheer).
* Rewrite DepGraph to be deterministic
i.e., fully array based, no more hashes, which means no more pairs randomly re-ordering stuff.
Insertion order is now preserved.
Pretty sure a couple of bugs have been fixed and/or added along the way
;p.
* Resync frontend/apps/filemanager/lib/md.lua w/ upstream
And use orderedPairs in the attribute parsing code, just to make that stupid test happy.
* Allow locking the gyro to the current screen mode (i.e., orientation).
* Tweak the "sticky rota" option to work both ways
* More rotation constant usage instead of magic numbers
* landscape FM / Refactor rotation
refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode
* bump base
update luasocket, libjpeg-turbo, curl
add logging to evernote-sdk-lua
update framebuffer for proper rotation
Was correctly done when jumping bookmarks via the Bookmarks
menu and the SkimTo widget, but not from gestures.
Also prevent fillToc() on each page turn when book has no TOC.
I've played a bit with #6275, to make the iterator available for non-power users too.
this PR automate user data migration (which happens once per update). If the folder `koreader/scripts.afterupdate` contains a file `migrate` then files will be copied to internal dir preserving their relative path. Thus user data **needs** to have the same hierarchy as internal directories.
Shell scripts will be find and run if the folder `koreader/scripts.afterupdate` exists and has no `migrate file`.
In the case of `koreader/scripts.always` there's no migration available, just shell scripts.
Digging a bit seems not possible to create new directories on app internal storage (it just crashes on the emulator since API25). So very fancy extensions are not supported, but it is ok to override files and create new files if dir already exists.
Tested with:
```find scripts.afterupdate/
scripts.afterupdate/
scripts.afterupdate/data
scripts.afterupdate/data/hyph
scripts.afterupdate/data/hyph/Roman.pattern
scripts.afterupdate/data/example.css
scripts.afterupdate/migrate
```
Results:
```
06-20 16:16:33.590 3584 3597 I KOReader: after-update: running migration
06-20 16:16:33.596 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/hyph/Roman.pattern /data/user/0/org.koreader.launcher/files/data/hyph/Roman.pattern returned 0
06-20 16:16:33.600 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/example.css /data/user/0/org.koreader.launcher/files/data/example.css returned 0
06-20 16:16:33.604 3584 3597 I KOReader: command rm /data/user/0/org.koreader.launcher/files/afterupdate.marker returned 0
```
* More robust way to detect our own path on Kobo
Should take care of all the weird and interesting ways people manage to
find to break it...
NOTE: "$(dirname $(realpath "${0}"))" works, too, but I'm not sure if
really old devices ship with the realpath applet...
* Abort early if KOREADER_DIR is null
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.
Add the possibility to run *.sh scripts:
After an update of koreader all *.sh scripts in /sdcard/koreader/scripts.afterupdate
are executed.
On every start of koreader run all *.sh scripts in /sdcard/koreader/scripts.always
Err, kind of nitpick PR. Is just add some "permanent" menus other than plugins to the new "more_tools" submenu. So it will never be empty.
Follow-up: #6279
Supersedes: #5512#6092Fixes: #5461
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).
* generic Device:info() function which returns the model
* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator
* also enable fake poweroff/reboot on the emulator
* add Device.home_dir
* add Device:hasExitOptions() and update menus & comments