Commit Graph

68 Commits (2c1178896ce64adc19fb9a33d435194e0a8be427)

Author SHA1 Message Date
Frans de Jonge 2c1178896c
[feat] Add ReaderBack (#3821)
This implements a reasonable facsimile of going back on Android.

The back button first goes back in a history of visited pages.
When there's no history left, it closes the app.

Fixes #3816.
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
Frans de Jonge 65a63d244b
[UX] SDL2: set window title (#3784)
This initial implementation only sets the title for FileManager and ReaderUI.

Fixes #3713.
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 f6ca1c7c0a
[feat] Open with: choose which engine to use for file (#3653)
Fixes #3345

* Add SVG to MuPDF filetypes
6 years ago
poire-z 7797c2369e
credocument: deal with loadDocument() failures (#3570)
cre:loadDocument() may fail in recognizing the document format, and
koreader would previously keep calling other methods on it, which would
make crengine segfaults. We now check loadDocument success at the
various places it is called, and try to deal the best way we can when it fails.
6 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 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 17014f9281 Avoid settings double save when leaving Reader (#3131) 7 years ago
Frans de Jonge c8ab9183aa [UX] ReaderUI: save/don't save document instead of yes/no
Brings it in line with UX guidelines.
7 years ago
poire-z 031df2ffee Added PicDocument:getCoverPageImage() and :getProps()
So an image file can have a cover in coverbrowser's display.
It also allows for an alternative viewer (ImageViewer widget)
when holding on file / View full size cover.
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
poire-z 64f699ba36 Store book metadata and nb of pages in new settings
They may already be available (with other statistics stuff) under
the 'stats' key, but not if Statistics plugin is disabled. As this
plugin may be migrated to SQLite, readerui and readerfooter will now
set two new properties: doc_props (containing all and only the metadata
returned by document:getDocumentProps()) and doc_pages (updated
by readerfooter on any display or font change).

PDF document: returns additional PDF properties: Keywords
and Subject (as Description).
7 years ago
Frans de Jonge 28524a5847 ReaderUI: return to filemanager instead of quitting if no document (#2956)
This affects #2335, at least for documents covered by `validDjvuFile()` (see 76cef07c07/frontend/document/djvudocument.lua (L15-L23)). However, that's only with regard to `touch invalid.djvu` and should not affect whatever happened in the OP.
7 years ago
Hzj_jie 30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 7 years ago
Qingping Hou fd862f5e28 plugin(fix): catch plugin crash at init time 7 years ago
Qingping Hou 00cf81febc readercopt(fix): set view mode after reader is ready
Otherwise, self.xpointer might still be nil in
ReaderRolling:onChangeViewMode
7 years ago
Qingping Hou a943b73303 fix: adjust pan rate for eink and non-eink screens 7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Hzj_jie c662ca4cc8 Load plugins also in FileManager (#2426)
added is_doc_only plugin attribute
8 years ago
Qingping Hou a6c506dc10 kobolight(refactor): move into plugin & only enable for kobo 8 years ago
Qingping Hou 0c49b915de refactor: add touch zone subsystem to inputcontainer
Touch zone decouples screen size from gesture event registration.

The win here is each individual widget does not need to update
gesture range on screen rotate/resize anymore.

Another advantage is we now have a centralized ordered array to handle
all registered touch event listeners, makes it much easier to resolve
gesture range conflicts between multiple widgets.

This patch also includes the following changes:

* migrate readerpaging to use readerui's touch zone
* migrate readerfooter to use readerui's touch zone
* move inverse read direction setting to touch menu's setting tab
* moved kobolight widget from readerview into readerui
* various dead code cleanups and comments
8 years ago
chrox 9ab005a1d3 fix unit test of readerlink and readerpaging
and have more confidence with the unit testing framework.

Now `make testfront` won't retry on failure and testing files are
ordered in each run so that it's possible to reproduce testing failure.

And this patch also fix flush settings not working before suspend issue:
at some point the `FlushSettings` event is sent to `UIManager` instead
of `ReaderUI`, but `UIManager` only delegated events to active widgets
and `ReaderUI` is actually not an active widgets thus will miss the event.

This patch also add a verbose debug mode with "-v" as a switch to turn
on this mode. With verbose mode on, event handling will be logged.
8 years ago
Hzj_jie d4c31d683f Add a setting to disable save document (#2138)
* Add a setting to disable save document
* Add UI elements to control save-document settings
8 years ago
chrox 03fda94562 fix #2110 by adding disable double tap option in screen options 8 years ago
Qingping Hou f71534e399 readerfooter(fix): only populate footer info after document is loaded 8 years ago
Qingping Hou 60587e08c6 defaults(refactor): remove global hack in filemanagersetdefaults
also added screensaver folder setting dialog for kobo
8 years ago
Qingping Hou 2cf4e77ae5 readerui(chore): rename _running_instance 8 years ago
Qingping Hou 0166ff8add reader(fix): force draw info message before loading document
Since the doShowReader will run in nextTick, it will get picked up by
checkTask, which is in the beginning of next UI loop and blocks
UIManager from redrawing the screen for the info popup.
8 years ago
chrox 6e723237ba fix 'opening file' dialog not centered in landscape
by setting the timeout to 0.0 seconds so that when the screen
is turned to landscape the dialog is already closed.
8 years ago
Zijie He 667e8834ad Migrate history folder, FileManagerHistory uses own history.lua file and ReadHistory component 8 years ago
Qingping Hou 2f78493e9e minor: write reader error to stderr 8 years ago
Qingping Hou 34e0238b6f readermenu: move book status to info tab & minor cleanup 8 years ago
Qingping Hou 5e8c5243c4 uimanager: fix crash on crash.... 8 years ago
Qingping Hou 03e81cfa4d test: fix readerui instance reset test 8 years ago
Qingping Hou b63ddb8736 fix: kill in fly hinting event on document close 8 years ago
Alex Pletnev fbf98ed920 #1710 FR: Add support of statistics plugin for pdf 8 years ago
Alex Pletnev 0f9bfbf147 #1730 Create complete book feature 8 years ago
Qingping Hou 2f0544b1b7 refactor(statistics): avoid magic 0.1 schedule with PostRender event 8 years ago
Qingping Hou e2096ed8d9 doc: add documentation build infrastructure 8 years ago
Andrey Golovizin bb1d4c60b3 Choose hyphenation dict by document language 8 years ago
Qingping Hou 9c46cafc9c chore: fix luacheck warning 8 years ago
Qingping Hou 3b92bdc084 feat: support screenshot in filemanager 8 years ago
Qingping Hou 90d1101ab7 minor: quit uimanager properly on coroutine error 9 years ago
Qingping Hou 41240464ca minor: fail loudly with stack trace when doShowReader crashed 9 years ago
chrox 8b85cbf157 add support for password protected zip/cbz documents 9 years ago
chrox d08e22ec2e add simple sync service as a plugin
The 'KOSync' plugin will synchronize furthest reading progress
across different koreader devices after users registering their
devices.

The synchronizing service is open-sourced as the project
[koreader/koreader-sync-server](https://github.com/koreader/koreader-sync-server).
9 years ago
Hans-Werner Hilse 94ce08937a clean up refreshes
This is a larger clean-up of the refresh situation.
The general shift is that refreshes are now mainly triggered by
the (top-level) widgets when they get shown or closed via UIManager.

All refreshes for the widgets when they are in use were handled by
themselves before. This adds the case of showing/closing.

It is the desired result of not having UIManager:show()/:close()
do (full screen) refreshes on its own.
10 years ago
Frans de Jonge 7c01a3f2a9 Fixed spaces stripped out by Transifex in readerui.lua by using util.template 10 years ago