Commit Graph

42 Commits (90c38e2d0d162a7dd10af0ff9f169cb9dce96d06)

Author SHA1 Message Date
NiLuJe 90c38e2d0d ReadHistory: nil guard a Document instance access
We're now more careful about this, so, I suppose weird timings may mean
we might be trying to access a nil here.

Fix #7706

Guard a few other similar constructs
3 years ago
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.
3 years ago
NiLuJe d31dc1e450 FileManager modules: Slightly less hackish onSetRotationMode handlers...
And, also, rotate the parent widget (i.e., FM/RV) to avoid leaving the
user with a broken layout when they exit in a different orientation ;).
3 years ago
NiLuJe a185290549 FileManagerHistory: Handle rotation events
Fix #7518
3 years ago
poire-z 46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
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 2b9694d7d2 [fix] Ensure "Open last/previous" point to existing files (#4367) 5 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
poire-z ce910cf2e7 Disable Purge .sdr and Delete for currently opened book (#3500) 7 years ago
poire-z 2735c6d369 [fix, UX] Remove rounded corners from fullscreen History (#3256)
Prevent visibility of readers's footer edges.
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 3dd18d2a3b Fix "start with history" misalignment
due to a side effect with coverbrowser. CenterContainer is no
more needed as History is now full screen.
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
Frans de Jonge 4616339ef8 KeyValuePage: improve looks
Fixes #2578.

* key bolded
* values normally left-aligned at 50%
* allows misalignment for the sake of fitting everything on one line
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
Frans de Jonge 2c80ff7d7b FileManagerHistory: remove harmful deletion code and turn it into a feature
Fixes the problem introduced in 51327911f2 and turns it into a feature that should fix #2477
7 years ago
Hzj_jie f91ad679d9 swithItemTable -> switchItemTable 7 years ago
robert00s 09f2db3729 Fix long filename text in history textbox (#2322)
Fix long filename text in history textbox
8 years ago
robert00s 886e2d6cb1 display document metadata (#2307)
display document metadata in file manager and history menu
8 years ago
Hzj_jie 7493fc89f6 Add removed item name in "Remove this item from history" and fix wrong items deleted issue. (#2164)
* Add removed item name in "Remove this item from history".

* Fix #2162, wrong history items deleted.
8 years ago
Zijie He 667e8834ad Migrate history folder, FileManagerHistory uses own history.lua file and ReadHistory component 8 years ago
Qingping Hou 72e7cd5cf4 style: move functions around 8 years ago
Qingping Hou 11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 8 years ago
chrox a60544b1ad Koreader Ubuntu-touch port
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
9 years ago
Qingping Hou 186673587e chore: fix some of the luacheck errors 9 years ago
Frans de Jonge 7a4b737ecd Changed "delete" in history to "remove this item from history" for clarity 10 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 14e2bf3d69 refatoring: lazy loading of packages 10 years ago
Qingping Hou 18d4c7550a chore: cleanup FileManagerHistory:updateItemTable() 10 years ago
Qingping Hou 7c6790796a fix: replace showReaderUI with ReaderUI:showReader 10 years ago
chrox b7c7287bab remove more global variables 10 years ago
chrox 87e667748a add font size menu entry
It changes screen DPI and may needs to reboot the reader to take effect.
This should fix #746.
10 years ago
chrox 92219a1f1e cleanup: expand tab to 4 spaces 10 years ago
Paulo Matias e9421d0aa5 Add option for deleting history entries and refactor dialogs
- Refactor FileDialog and HightlightDialog into ButtonDialog
- Create a new ButtonDialog when a file in the History dialog is hold,
  offering an option to delete the history entry.
10 years ago
chrox e4c77c272a sort history file with modification time 11 years ago
ciro cfd1f07f0e fixed issue: https://github.com/koreader/koreader/issues/354 11 years ago
HW 2154e7e852 Further refactoring
This should finish the work to make all globals to local variables.
That allows LuaJIT to properly compile things by interning the
references to the relevant parts (rather than looking up globals
all the time which stops a trace).
11 years ago
HW ef111b99c6 Refactored to use strictly locals 11 years ago