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

91 Commits

Author SHA1 Message Date
hius07
684fd6c12d
Standardize select/choose to choose (#8128)
Closes #8105.
2021-08-24 22:19:07 +02:00
NiLuJe
c044480658 Don't exclude the full .kobo directory tree
Only exclude the useless/dangerous bits.
Allows getting to the Dropbox folder.

Fix #8101
2021-08-19 22:40:04 +02:00
hius07
2ab31a9a36
File browser: Settings submenu reordering (#8000) 2021-07-23 15:47:02 +02:00
zwim
48d1b23469
FileSearcher honor filemanagers sorting order (#7978) 2021-07-18 20:21:39 +02:00
NiLuJe
de6f2e84a3
FileManager/ReaderUI: Clarify the current instance accessor (#7658)
* FileManager/ReaderUI: Clarify the current instance accessor

Make it clearer that we actually store it in a *module/class* member, not an *instance* member.

Also, warn if there's a close/open mismatch.
2021-05-11 00:49:35 +02:00
NiLuJe
e7acec1526 ReaderUI: Saner FM/RD lifecycle
* Ensure that going from one to the other tears down the former and
    its plugins before instantiating the latter and its plugins.

UIManager: Unify Event sending & broadcasting
  * Make the two behave the same way (walk the widget stack from top to
    bottom), and properly handle the window stack shrinking shrinking
    *and* growing.
    Previously, broadcasting happened bottom-to-top and didn't really
    handle the list shrinking/growing, while sending only handled the list
    shrinking by a single element, and hopefully that element being the one
    the event was just sent to.

These two items combined allowed us to optimize suboptimal
refresh behavior with Menu and other Menu classes when
opening/closing a document.
e.g., the "opening document" Notification is now properly regional,
and the "open last doc" option no longer flashes like a crazy person
anymore.

Plugins: Allow optimizing Menu refresh with custom menus, too.

Requires moving Menu's close_callback *after* onMenuSelect, which, eh,
probably makes sense, and is probably harmless in the grand scheme of
things.
2021-05-05 20:37:33 +02: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
Frans de Jonge
4f7f6169a6 Change a few more directory strings to folder
Fixes <https://github.com/koreader/koreader/issues/7350>.
2021-02-28 11:20:28 +01:00
poire-z
3b89e32069 [UX] Add ToC/Bookmarks settings
- Menu widget: allow specifying the number of items per
  page and the item font size, so we can use other values
  than the default File browser ones
- Menu: fix setDirty when a border is used
- ToC: add item per page and font size settings, make
  Alternative ToC more visible (was previously
  available on long-press on Table of contents)
- Bookmarks: add item per page, font size, size reduction
- Progress bars (Skim widget and footer): allow selecting
  ToC depths from which ticks are made.
2021-02-05 23:58:32 +01:00
NiLuJe
d6cecc9ee3
Bump base to bring in a few fixes & cleanups (#6753)
* Bump base

https://github.com/koreader/koreader-base/pull/1205
https://github.com/koreader/koreader-base/pull/1206
https://github.com/koreader/koreader-base/pull/1207

* The strcoll shenanigans have been moved to ffi/util
2020-10-05 16:34:46 +02:00
Galunid
0d501f2308
[chore] Fix a few typos (#6601) 2020-08-30 05:27:17 +02:00
poire-z
85a16d0064 Open with: add Text Editor plugin 2020-08-29 20:07:26 +02:00
poire-z
5c1ccda314 FileChooser: allow traversing unreadable directories 2020-08-29 20:07:26 +02:00
Galunid
62daa7b783
Implement numeric collator (natural sorting) in file manager (#6378) 2020-07-18 13:04:39 +02: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
yparitcher
3e00e686b6
file count: Fixes #5843 (#5858) 2020-02-13 09:43:10 +01:00
Frans de Jonge
1d3842ffa0
[fix] More accurate count in FileChooser (#5846)
Fixes <https://github.com/koreader/koreader/issues/5843>.
2020-02-11 15:13:20 +01:00
Frans de Jonge
6dfe65279c
[chore] FileChooser: "traditional" for loop for ~15-25% better performance (#5827)
Apparently there's less overhead this way.

See https://github.com/koreader/koreader/pull/5819 for context.
2020-02-08 11:45:26 +01:00
Frans de Jonge
e0ce993c61
[fix] Don't waste time on dir/file attributes in subdirs (#5819)
An awful lot of effort was wasted getting attributes just for getting a count of the number of files/directories in subdirectories. Getting the count is pretty fast. Getting all the attributes is not, and in this context we don't even use the attributes.

See <https://www.mobileread.com/forums/showthread.php?t=327085> and <https://gitter.im/koreader/koreader?at=5e3ac3b9e8a838355918ba13> for discussion.
2020-02-05 19:32:07 +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
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
yparitcher
6c68df42ec [feat] Open unsupported documents as text (#5497) 2019-10-23 23:15:30 +02:00
Frans de Jonge
2c555830f9
[feat, i18n] Implement ngettext (#5257)
Fixes <https://github.com/koreader/koreader/issues/5249>.

See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html and https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html for more information.

Usage:
```lua
local T = ffiUtil.template
local _ = require("gettext")
local N_ = _.ngettext

local items_string = T(N_("1 item", "%1 items", num_items), num_items)
```
2019-08-24 23:06:06 +02:00
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.
2019-08-24 09:25:38 +02:00
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.
2019-07-20 17:36:41 +02:00
Qingping Hou
a72f8b6338 decouple UI from core document code 2018-10-14 09:14:35 -07:00
Robert
7e6802737e Sorting: adds Sort by name - mixed files and folders (#4140)
Also moves the 2 Sort by percent in a sub-menu
2018-08-10 22:26:07 +02:00
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.
2018-08-07 21:23:19 +02:00
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").
2018-08-06 20:59:01 +02:00
Robert
19b1c919d6 FileChooser, PathChooser: show current path in header (#4125) 2018-08-01 17:02:34 +02:00
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
2018-06-02 12:10:55 -04:00
Robert
fbd549bcfd
End of document action (#3943)
* End of document action

* Rev1

* Rev2

* Rev3

* File browser
2018-05-13 13:07:23 +02:00
Frans de Jonge
65a63d244b
[UX] SDL2: set window title (#3784)
This initial implementation only sets the title for FileManager and ReaderUI.

Fixes #3713.
2018-03-21 20:10:35 +01:00
Robert
39738955f3 File manager: added 'Go to letter' (#3664)
When Hold on page number, allows for inputing letters to go to file
starting with them (and not only numbers to go to page number).
2018-02-09 22:33:15 +01:00
Robert
dd00417bc8 Sort documents - open sidecar file only in percent sort (#3622) 2018-01-20 00:01:09 +01:00
Robert
6e87735b79 Filemanager - sort by percent of book (#3614) 2018-01-17 20:10:25 +01:00
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
2018-01-13 23:38:53 +01:00
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.
2017-10-21 19:09:24 +00:00
poire-z
c15915a4ee Added util.getFriendlySize() (#3381)
* Added util.getFriendlySize()

* Allow for GB
2017-10-20 15:48:32 +00:00
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.
2017-10-13 18:43:02 +02:00
Frans de Jonge
e1aa57f27e Font: unify font styling 2017-04-29 03:01:38 -07:00
Frans de Jonge
1ed0ce0c21 FileManager: fix up arrow issue 2017-02-25 15:34:28 +01:00
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.
2017-02-23 23:28:49 -08:00
Bastien Dejean
f0b63003e9 Use a smaller font to display the filename
More information regarding the file!
2017-02-20 19:39:23 +01:00
Hzj_jie
726b15ad01 More sorting orders in file manager (#2535) 2017-02-11 18:55:31 -08:00
Zijie He
b502047635 Removing metadata file instead of purging .sdr folder 2017-02-08 10:38:24 -08:00
Hzj_jie
f91ad679d9 swithItemTable -> switchItemTable 2017-02-01 06:26:06 -08:00
Qingping Hou
cb195e9ce8 feat: support disable show file name in bold
also rename show_opened_doc_in_bold setting to show_file_in_bold
2016-12-29 00:02:22 -08:00
Qingping Hou
dc2746f1d7 chore: various minor cleanups 2016-12-24 23:43:58 -08:00
Qingping Hou
36763a1ad7 feat: new setting to show opened book name in bold 2016-12-24 23:43:09 -08:00