Commit Graph

193 Commits (e7acec15261927eb5380813d85786b7b3108fc12)

Author SHA1 Message Date
Frans de Jonge 6ed58346a1
[i18n] Add translator notes (#5250)
Thanks to <https://github.com/koreader/koreader/pull/5237> we can now  extract the knowledge currently embedded in Transifex and put it directly in our source. This positively affects <https://github.com/koreader/koreader/issues/3754>.

Translation instructions and knowledge that comes out of localization-related questions should be preserved in the source, because Transifex is too ephemeral. For example, the links from <https://github.com/koreader/koreader/pull/2290> are no longer accessible. Even when they are, it's quite useful to have this information around while dealing with the code as well, and I also hope it'll be informative to contributors who seldom visit Transifex.

This commit also makes a few minor changes to obviate the need for comments where possible.
5 years ago
Robert dc6d4085ea Fix: Unable to hold top right corner in FileManager (#5248)
Close: #5247
5 years ago
Robert 5245bc88ff [UX] Add horizontal edge gestures (#5179) 5 years ago
NiLuJe affc0f48de
Go Big or Go Home! (#5163)
* Tweak goHome to assume sane-ish defaults if no custom home dir is set (re #5154)
* If we're already in Home, make goHome send us to the first page.
5 years ago
Robert 39bf5a4677 [feat] File manager - add option to view unsupported files (#5129)
New option to show all files (also not supported by KOReader) in file manager. Default this option is disabled.
5 years ago
Frans de Jonge 986b44f9f8 [fix] FileManager: Empty clipboard after paste 5 years ago
NiLuJe 2a91b2b038 Go back to "UI" refreshes in the FM (#4903)
Going with partial ends up being problematic on REAGL devices in a
number of different ways.

On Kindle (at least pre EPDCv2), it's slightly flickery because of the
whitespace and the boldface.
On Kobo, it's slow when anything else tries to queue an update (i.e.,
flashing the chevrons).
Which is a non-issue on the Forma because then it's fast when using
pageturns to navigate, but, still :D.

The obvious downside is we lose the automatic flash after n refresh,
which is potentially annoying on older, non-reagl devices.
It's not really on issue on REAGL devices, especially on EPDCv2.
5 years ago
Frans de Jonge 8466af2c5b
[UX] Gesture manager: corner gestures (#4878)
Adds configuration to the top corners as well as the additional gestures hold and two-finger tap.

Deprecates `DTAP_ZONE_FLIPPING` and `DTAP_ZONE_BOOKMARK`.

Fixes #4877.
5 years ago
Frans de Jonge 151aedb038 [chore] Bring file manager plugin loading in line with reader
This allows for simple testing if self.ui.plugin_name is loaded without complex additional methods in, e.g., PluginLoader.
5 years ago
Frans de Jonge bae83ad663
[UX] Gesture manager: add action - folder shortcuts (#4733)
See #4727.
5 years ago
Frans de Jonge 2ba480b41d
[UX] Gesture manager: add action - file search (#4720)
Also makes it callable from the reader.

Fixes #4717.
5 years ago
NiLuJe 812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
5 years ago
poire-z ed8f87f9f4 Fix diagonal refresh not working in TOC and History
By delegating diagonal swipe handling to GestureManager only
when the Menu or FileChooser instance is the FileManager one.
6 years ago
poire-z 2b9694d7d2 [fix] Ensure "Open last/previous" point to existing files (#4367) 6 years ago
Qingping Hou a72f8b6338 decouple UI from core document code 6 years ago
onde2rock 4d424cdc58 [Key navigation] The back key can be used to go to the parent folder. (#4264)
The menu to select this behavior is under "gear">"Navigation"
It default to the current behavior named "default"
6 years ago
Robert dc5a479b66 Gesture manager (initial) (#4240)
Manager supports separate gestures for the file manager and the reader. Gestures from the manager have a higher priority than built-in gestures.

Settings available in Gear -> Device -> Gesture manager
6 years ago
Robert 192bc175fc New startup option: Folder shortcuts (#4220) 6 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
Robert 5c22e0c8d7 Adds Folder shortcuts to Plus menu (#4165) 6 years ago
Robert 225b5d417d Adds ReaderDeviceStatus: low battery alarm (#4144) 6 years ago
Frans de Jonge 5fb0f6efc1 FileManager typography: dashes to en-dashes (#4151) 6 years ago
Robert 7e6802737e Sorting: adds Sort by name - mixed files and folders (#4140)
Also moves the 2 Sort by percent in a sub-menu
6 years ago
alethiophile 637abfdf84 Various changes to sorting (#4067)
Don't consider sidecar file when sorting by access time.
Rename 'sort by title' to 'sort by filename':
This is in accordance with the actual function of the code, which
uses filename rather than title as specified in file metadata.
6 years ago
Robert 19b1c919d6 FileChooser, PathChooser: show current path in header (#4125) 6 years ago
Frans de Jonge a0825ecf03 [fix] Don't crash when trying to go to deleted folders (#4110) 6 years ago
Robert e5a33ac6d9 Add "Open random document" to Plus menu (#4103) 6 years ago
poire-z 6877ade4fd
Remove cre cache file when deleting a book (#4022)
Store the cache file path in book settings, so we can
delete it too when deleting the book.
6 years ago
NiLuJe 5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

i.e., everything that does an invert
Plus a few other things that refresh small UI elements onTap
Re #3130

* Tweak refreshtype for a number of widgets:
  * Fix iconbutton dimen
  * Make touchmenu flash on close & initial menu popup. Full-screen on close.
  * Use flashing updates when opening/closing dictionary popup. Full-screen on close.
  * Switch FileManager to partial.
    It's mostly text, and we want flash promotion there.
  * Make configdialog & menu flash on exit
  * Make FLWidget flash on close
  * virtualkeyboard: flash on layout change & popup.
  * Potentially not that great workaround to ensure we actually see the
highlights in the FM's chevrons
  * Flash when closing BookStatus Widget
  * Optimize away a quirk of the dual "fast" update in touchmenu

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

* Kindle: Handle *all* fonts via EXT_FONT_DIR instead of bind mounts insanity

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
6 years ago
onde2rock 5aacc761e1 [UX] Implement back_to_exit option (#3838)
Also goes back to File Manager as default view first.
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 5e47a83e6a
UIManager: avoid painting widgets covered by a full screen widget (#3770)
Navigating the TOC, viewing a full screen image, browsing
reading stats... would call paintTo() on ReaderUI (so, asking
the engine to render the page) or FileManager (so, rendering cover
images) even though their content is hidden.
Widgets registering to UIManager have to explicitely states
they cover the full screen (UIManager can't know, parts of their
dimen may be transparent, e.g. if it is a CenterContainer).
6 years ago
onde2rock e8aab49ee9 Kindle4NT improvements (#3745)
* [device][kindle4] add fake event to kindle4

* modify focusmanager to allow for more complex layout

The focusmanager now naviguate the layout by avoiding nil value
instead of relying on table lenght. It should be completely backward
compatible

* add Dpad naviguation to the touchmenu

* fix crash because virtualkeyboard on non touch device

the kindle4NT has no keyboard nor touch, the fix open the virtual
keyboard so koreader dont crash but it's not useable

* Enable device with keys to use the touchmenu

* Don't get stuck in reader progress statistics plugin

* [underlinecontainer] Fix and remove unused function

References #1898.
6 years ago
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
6 years ago
Frans de Jonge f6ca1c7c0a
[feat] Open with: choose which engine to use for file (#3653)
Fixes #3345

* Add SVG to MuPDF filetypes
6 years ago
Robert 6e87735b79 Filemanager - sort by percent of book (#3614) 6 years ago
Robert a66d657195 Update History and Last open document when move (cut and paste) file (#3607) 6 years ago
Robert d5d12998f6 Fix folder path truncation in filemanager with utf8 chars (#3599) 6 years ago
Robert d163f8281d Menu: configure number of items per page, wrap entries (#3589)
Configure number of items per page (from 6 to 24) - default is 14
Allow filenames to wrap so that we can see the full name
Used by File browser, History, Search Result, Bookmarks, Table of contents (only single line), File chooser, OPDS catalog
6 years ago
Robert 22a8cfde7c Fix missing createFolder() function and fix KOReader File Browser is no longer tappable (#3576) 6 years ago
Robert 6f41cecab2 Add info when copy or cut file (#3571) 6 years ago
Robert 227584de22 New option - create new directory (#3555) 6 years ago
Robert 79517eb166 Truncate path in filemanager (#3565) 6 years ago
Robert 1d1b005b1a
copying file with .sdr (#3563) 6 years ago
Robert b855eff1b9
Remove not empty folder (#3562) 6 years ago
poire-z 17bbf68dac [Fix] actually use 'reverse_collate' saved setting (#3532) 7 years ago
poire-z 591dc2119c FileBrowser: optimize 'change page to show last file'
This feature, introduced some days ago, was actually
doing 2 updateItems calls: the initial one, and a second
to switch to focused_file page (cheap with classic display mode,
less cheap with CoverBrowser modes).
This change allows doing that in a single call.
7 years ago
poire-z 29707bd664 FileBrowser: change page to show last file or previous subdir (#3351)
When going from reader to filemanager, we are in the directory
containing the last_file. With this, we will also be on the page
showing this file.
When in filemanager and going up (".."), we will also be on the
page containing the directory we came from.
7 years ago
Frans de Jonge 0d7999e7a5 [fix] Add hold_callback to IconButton (#3271)
Also fix path display update.

Fixes #3270.
7 years ago
Robert af356a819b [fix] Avoid crash when set home (#3269) 7 years ago
Frans de Jonge 0fc5a378bc [UX] Add home button (#3263)
Tap to go HOME. Hold to set current folder as HOME. When no HOME is set yet tap also asks to set current folder as HOME.

See https://github.com/koreader/koreader/issues/2957#issuecomment-308513062

Closes #3200.
7 years ago
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
7 years ago
poire-z 4d18ac1100 Some History fixes and enhancements (#3247)
Made the onHold buttons table similar to the one of File browser.
Added "Purge .sdr" and "Delete" to these buttons.
Moved the purgeSettings and removeFileFromHistoryIfWanted
logic into filemanagerutil functions.
Stay on the same page when manipulating history (previously, we were
always put back on first page).
Really keep deleted files in history (unless setting says otherwise).
Show deleted files in grey or dimmed in classic History and all
CoverBrowser display modes.
7 years ago
poire-z d4fd0b9428 frontlight on kobo: a few fixes (#3163)
* frontlight on kobo: a few fixes

Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.

* Ensure untoggle works when starting with light off
7 years ago
poire-z 9c08236b70 Update 'lastfile' if autoremove_deleted_items_from_history
For people who set autoremove_deleted_items_from_history to true,
file is removed from history when Deleted or 'Purge .sdr'. This also
update lastfile to the new top in history if needed.
7 years ago
poire-z 3cf419defa Purge .sdr: also remove .old backup file
Otherwise, this .old backup is used when re-opening the document,
and we could never reset docsettings.
7 years ago
Frans de Jonge 6bdb96c0f8 [UX] FileManager: add ConfirmBox for purge .sdr
Notified of destructive action without confirmation in https://www.mobileread.com/forums/showthread.php?p=3566978#post3566978
7 years ago
Frans de Jonge 23cd585fae Support history as default view for filemanager (#3058)
Fixes #2774

* make history view borderless
* add new menu for what to start with

Should combine nicely with #2940
7 years ago
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).
7 years ago
Hzj_jie 30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 7 years ago
poire-z 9e346f5559 Allow wikipedia lookup from filemanager
Also allow taking screenshot when on dictionary window.
7 years ago
Qingping Hou 23c2955500 chore: style cleanup for infomessage 7 years ago
Frans de Jonge e1aa57f27e Font: unify font styling 7 years ago
Qingping Hou fd862f5e28 plugin(fix): catch plugin crash at init time 7 years ago
Frans de Jonge 9b2128ecb8 FileConverter added with local Markdown to HTML conversion (#2737)
* FileConverter added with local Markdown to HTML conversion
7 years ago
Frans de Jonge 1c25d0fd1b Language: improve confirmboxes
Generic "OK" buttons should be avoided. Thanks to @lightonflux for pointing this out https://github.com/koreader/koreader/issues/2555#issuecomment-291039945
7 years ago
Frans de Jonge da3ff5e336 History: add 'autoremove_deleted_items_from_history' setting 7 years ago
Frans de Jonge 6458c8e9eb File Manager: rename to "KOReader File Browser" and add up arrow to ".."
This should make it clearer to new users what's going on. Fixes #2529.
7 years ago
Frans de Jonge fed22b509d FileManager: rename hasSidecarDir to hasSidecarFile
Fixes #2550

Cf. b502047635
7 years ago
Zijie He 4f1cabcdbc Improve several outputs 7 years ago
Hzj_jie 726b15ad01 More sorting orders in file manager (#2535) 7 years ago
Zijie He faaca028e7 Remove empty sidecar folder 7 years ago
Zijie He b502047635 Removing metadata file instead of purging .sdr folder 7 years ago
Hzj_jie f91ad679d9 swithItemTable -> switchItemTable 7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Hzj_jie 5bda44473d Add dictionary to filemanager 7 years ago
robert00s ae9261b685 Fix #2440 7 years ago
Hzj_jie c662ca4cc8 Load plugins also in FileManager (#2426)
added is_doc_only plugin attribute
7 years ago
Robert 93e075feb6 Adding the buttondialogtitle widget and show long filename in filemanager (#2414) 8 years ago
poire-z 949e5ba54d FileManager: added button to purge sidecar directory (#2391)
Also move its sidecar directory when moving a file.
8 years ago
Qingping Hou 88ab21c62c minor: change setting names for home_dir_name 8 years ago
Bastien Dejean b3d58fba00 Don't try to set the value of fm_screen_mode
I'm not sure what the original intention was, but in practice, the user
experience regarding the way this setting is saved is horrible: it seems
to change randomly and once the orientation is changed from portrait to
landscape, the only way to fix it is to edit `settings.reader.lua`.
8 years ago
Bastien Dejean 58b6c94a8d Generalize and consolidate tildify
- Don't do any substitution unless `home_dir_name` exists.

- Don't rely on `gsub` because it might interpret some characters in
  `home_dir` as magical (and might also replace a match not starting at
  the beginning of `path`).
8 years ago
Bastien Dejean 283a113aaa Handle corner case in tildify 8 years ago
Bastien Dejean 2f5935411a Replace the home dir by ~ in the FM's current path
This mirrors the well known shell convention and release the user from
a needlessly verbose description of the current path.
8 years ago
Bastien Dejean 83f18d6d77 Properly spell the title of the file manager
Us humans can handle spaces in titles.
8 years ago
robert00s 886e2d6cb1 display document metadata (#2307)
display document metadata in file manager and history menu
8 years ago
Huang Xin b8f23d162d filemanager(fix): refresh banner in filemanager insteand of TextWidget 8 years ago
Hzj_jie 400e63a463 Resolve review comments 8 years ago
Hzj_jie 493ff00609 Add path in file manager 8 years ago
Qingping Hou 2e417cfbd8 filemanager(refactor): use purge method from docsettings 8 years ago
Huang Xin f718b0669f Merge pull request #2045 from koreader/defaults
defaults(refactor): remove global hack in filemanagersetdefaults
8 years ago
Qingping Hou ac03cd241f fm(fix): close filemanager before showReader
This removes filemanager from UI widget stack so it does not listen
to events sent to the reader. Before this patch, screenshot event will
be sent to filemanager.
8 years ago
Qingping Hou 60587e08c6 defaults(refactor): remove global hack in filemanagersetdefaults
also added screensaver folder setting dialog for kobo
8 years ago
chrox 92184f0199 fix #1985 by always return to the parent dir of current doc in the FileManager 8 years ago
Frans de Jonge 5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 8 years ago
zijiehe 8861365264 Add rename function for filemanager 8 years ago
Qingping Hou 6a6469fa09 more luacheck fixes 8 years ago
Qingping Hou fb0606aa9c style(FM): rename internal only method into function 8 years ago
Qingping Hou 34515484d1 fix: remove invalid setDirty in FileManager:restoreScreenMode 8 years ago