Commit Graph

42 Commits (37a01100b7a4733ae26871c4d929114aff8ea143)

Author SHA1 Message Date
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

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

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
poire-z d6d49a64a7 [RTL UI] use auto or LTR text direction in some specific cases
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).

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

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

Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.
4 years ago
Frans de Jonge da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

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

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
Frans de Jonge 57ce8dc574
[UX] Gesture manager: add action - show dictionary/Wikipedia (#4699)
References #4687.
5 years ago
poire-z 335a513826 [chore] cleanup multi-lines translatable strings
Revert 9971eb85 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)
5 years ago
poire-z 850be52177
Keep some menus open when Tap or Hold (#4189)
TouchMenu: added options to menu items with the following defaults:
    keep_menu_open = false
    hold_keep_menu_open = true
So, default for Tap callback is to close menu, and for Hold callback
to keep menu open.
In both cases, provide the TouchMenu instance as the 1st argument to
the callback functions (instead of a refresh_menu_func I added in #3941)
so the callback can do more things, like closing, refreshing,
changing menu items text and re-ordering...

ReaderZooming: show symbol for default (like it was done for
ReaderFont, ReaderHyphenation...)
TextEditor plugin: update the previously opened files list in real
time, so the menu can be kept open and used as the TextEditor main
interface.
SSH plugin: keep menu open and update the Start/Stop state in real time
ReadTimer plugin: tried to do what feels right (but I don't use it)

Also remove forgotten cp in the move/paste file code
6 years ago
poire-z 1d18b01cf7
PathChooser: clearer usage and behaviour (#4133)
Explicit new options: select_directory, select_file, show_files.
With select_directory, show an entry to select current directory
(so, removed undocumented hack "hold on .. to select current
directory").
6 years ago
poire-z 9971eb8533 Fix untranslatable strings (#4132)
Some problem somewhere with [[...]] strings starting with a
leading newline. Should probably be allowed, but for now
fix the few such cases to allow them being translated.
6 years ago
Robert d4ebcd26c9 [Minor] make "Keep this directory" translatable (#4090) 6 years ago
onde2rock e502bf04d3 [feat, UX] Support the virtualKeyboard on non touch-device (#3796)
* [VirtualKeyboard] Add support for keynaviguation

Also rename the variable "layout" to "keyboard_layout" because conflict
with the layout from the focusmanager

* Make the goto dialog compatible with key naviguation

My solution is to change the order of the widget. The last one will the
virtualkeybard so it catch all the keybinding, and below it, make the
dialog "is_always_active = true" so it can receive touch event.

* Correctly show the virtual keyboard on dpad devices

* change the order to call the virtualKeyboard so it end up on top

* Handle the multi input dialog

* Support reopening the virtualKeyboard by the Press key

* add check focusmanager

* Fix https://github.com/koreader/koreader/issues/3797

* MultiInputDialog : Now work on non touch-device

* Set the virtualkeyboard to be a modal widget

* Fix the layout in multiinputwidget

* Fix for the various combination of
hasKeys,hasDpad,isTouchDevice

* [Focusmanager] Better handling of malformed layout
6 years ago
poire-z 50a96ce2b2 Fix some texts (#3769) 6 years ago
poire-z b46628c08c
new option: Save Wikipedia EPUB in current book directory (#3762)
Also uses PathChooser (instead of InputDialog) in 'Set Wikipedia
Save as EPUB directory'. When setting not yet set, propose to
create and use ~/Wikipedia/ .
6 years ago
poire-z e7377cd20e Dict & wiki history: use filename when no book title (#3635) 6 years ago
poire-z 775b7a364f Wikipedia: show images and allow interrupting queries
Reword some english messages
6 years ago
poire-z 70f2aa09ea Adds Wikipedia history (#3549)
Just like Dictionary lookup history.
Also changed Disable to Enable in some menu items to be more positive.
6 years ago
poire-z 5d2bebcc0b Added Dictionary settings and Wikipedia settings menus (#3121)
Also removed OPDS `download_dir` from the candidates to Wikipedia
"Save as EPUB" dir.
7 years ago
Huang Xin 8938786472 [fix] stop propagation of tap events when triggering reader menu (#2934)
* [fix] stop propagation of tap events
when triggering reader menu
And also get rid of unnecessary screen refreshes on Kindle Voyage.
The "progress" window for dict lookup is also eliminated as most of the time dict lookup is an instant process, and the "progress" window is preserved for wikipedia lookup as it may take longer time to show the result window.

* [up] add an option to disable dictionary fuzzy search

* [fix] tidy up require

* [fix] fix read settings
7 years ago
poire-z 9e346f5559 Allow wikipedia lookup from filemanager
Also allow taking screenshot when on dictionary window.
7 years ago
Frans de Jonge e8721887ba InputContainer: add cancel_text and ok_text
Makes it easier to comply with UX style.

* Change "OK" to "Search dictionary" in Dictionary lookup to comply with UX style
* Change "OK" to "Search all text" in Fulltext search to comply with UX style

Tacked on but highly related:

* change "OK" to "Search Wikipedia" in Wikipedia lookup to comply with UX style
* change "OK" to "Set default" in ConfigDialog to comply with UX style

Chore:

* fixed up order of requires
7 years ago
Frans de Jonge a970a1f034 MenuSorter: fix outside testability (for potential unit tests) 7 years ago
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
7 years ago
Frans de Jonge 5b20106db7 MenuSorter: initial implementation
* Menus are now sanely configurable
* Custom separator placement for clearer menus
7 years ago
Frans de Jonge d1785e1863 Reorganize menus
* Replace "home" (exit) menu with hamburger
* Discard pokeball and put items in hamburger
* Introduce search menu in reader

Cf. #2562
7 years ago
poire-z 2ded2bce5e Wikipedia: save full page as epub (html, with optional images)
Also for the current text-only wikipedia full page: replace
the ==s in section titles with some unicode symbols for a better
visual feeling of hierarchy. These same symbols are also used
in the .epub.
Both can be disabled by adding ["wikipedia_prettify"] = false
to settings.reader.lua

readerhighlight: close ButtonTable (like other buttons do) when looking
up wikipedia, otherwise if we save as epub, and swtich to new document,
this ButtonTable will never be closed and stays in UI.
7 years ago
robert00s fe5379814d Ask for connection when clicking on Wikipedia 7 years ago
poire-z 130f7b0773 wikipedia: fix languages rotation and query
Fix innacurate language query and rotation when back from nested lookups.
More informative lookup message (langage used, search or full page)
Allow for screen refresh with diagonal swipe (like in readerpaging).
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
poire-z 1708fd5e1c Dictionary and wikipedia enhancements (#2393)
Stardict:
- remove duplicate results
- better cleaning of selection
- append results from a 2nd query of a 2nd set of dictionaries
  in data/dict_ext/

Wikipedia:
- use the search API for better results
- allow viewing the full page content of a result in a bigger window
- allow queries for multiple languages
- available languages can be set in settings.reader.lua :
    ["wikipedia_languages"] = {"en", "fr", "it"}
- "Wikipedia lookup" added to Tools menu

For both:
- allow selection of multiple words for a new lookup (so one can
  actually browse wikipedia)
- allow continuous reading with Tap
- display "current result / total number of results"

Details in #2393
8 years ago
robert00s 683b0381bf Patch for wikipedia language (#2304)
* smarter language detection for wikipedia

new order:
* check language for document
* check global language setting
* check language for lookup phrase

Fix: https://github.com/koreader/koreader/issues/1844
8 years ago
Qingping Hou 59c17ef420 minor: more luacheck fixes 8 years ago
Qingping Hou 9bd2d42834 build: enforce luacheck in travis build 8 years ago
chrox f2d38336c1 fix #1642 GFW block in China may also cause Network unavailable error 9 years ago
chrox 82393f0ed3 fix loading frontend/JSON.lua for json.lua on Kindle
The VFAT file system of `/mnt/us` is case insensitive so that
require("json") from Spore which intends to load luajson module in
rock directory actually will load `frontend/JSON.lua`, the two JSON
parser libraries have slightly different APIs.

This patch remove the pure Lua JSON library in favor of `luajson` which
uses LPeg pattern marching backend for better performance.
9 years ago
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.
10 years ago
chrox 6b2768f801 fix cannot set default dictionary 10 years ago
chrox 506bf96379 add menu entry to lookup input word in dictionary
This should close #971.
10 years ago
chrox f575797b01 use original lookup word in wikipedia lookup 10 years ago
chrox a275a8cc89 strip punctuations in word before wikipedia lookup 10 years ago
chrox 557c29a7d9 prompt users to turn on Wifi in OTA update and Wikipedia lookup 10 years ago
chrox 7b10d66e1b enable Wikipedia support
Since wikipedia server is language specific we should first detect
language of the text by querying Google Translate. Make sure you have
access to both Google Translate and Wikipedia service to use this
function.
10 years ago