2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
Commit Graph

1729 Commits

Author SHA1 Message Date
Hans-Werner Hilse
a4571c297e read global default value for using embedded stylesheets
The global configuration wasn't evaluated before.
Fixes #1364.
2014-12-19 13:58:03 +00:00
Qingping Hou
6ed8f30f35 fix: empty item_table crashes menu widget 2014-12-18 03:16:11 -05:00
chrox
b403a45228 fix OTA server broken on checking stable release 2014-12-06 20:14:10 +08:00
Hans-Werner Hilse
05503791b4 issue a full refresh when changing rotation 2014-12-05 21:25:32 +00:00
chrox
8555f24c45 make sure refresh_count is incremented by only once at most for each repaint 2014-12-04 15:46:47 +08:00
chrox
b3d79b053a workaround to fix #1340 2014-12-04 10:09:09 +08:00
chrox
d9fa97df5a fix #1336 by ignoring uncompatiable saved highlights 2014-12-04 09:13:56 +08:00
Hans-Werner Hilse
bb5254022d fix: save properly last open menu in reader
20fd6f902e missed the saving part when
renaming the configuration variable.

Fixes #1335.
2014-12-03 16:14:30 +00:00
Hans-Werner Hilse
7c1c072b21 fix for rotated document to file manager transition: do a refresh
fixes part 2 of #1333
2014-12-03 15:59:48 +00:00
chrox
b0e2ce2a8b update comment about reverting full refresh in onPanRelease 2014-12-03 18:37:00 +08:00
chrox
35545169a6 zoom mode is meaningless when reflowing, so disable zoom mode options in reflow mode 2014-12-03 16:33:21 +08:00
chrox
c43885b917 show debug info when JSON data cannot be decoded 2014-12-03 14:26:00 +08:00
chrox
846836dceb fix #1275
Full refresh when highlighting text is quite annoying, I fixed it by
using 'ui' refresh type.
And this patch also fixed a bug that after cleaning temporary highlights
the screen is not refreshed.
2014-12-03 14:06:46 +08:00
chrox
b767394fc2 fix #1150 by adding FOLLOW_LINK_TIMEOUT variable 2014-12-03 12:55:53 +08:00
chrox
ef6235e4ae fix #1305 2014-12-03 11:33:54 +08:00
chrox
6c9b7facbe fix crash when removing highlighted bookmarks in PDF 2014-12-03 11:12:15 +08:00
variousvirgil
9c69c1f14e Fix #1299 2014-12-02 20:30:55 +08:00
Hans-Werner Hilse
3d73ff5ae7 only open frontlight device on Kobo devices that actually have light 2014-12-02 11:18:19 +01:00
chrox
eea6f97796 fix #1319 2014-12-02 10:35:55 +08:00
chrox
aa9566205b fix filemanager cannot remember sorting order 2014-12-02 09:52:05 +08:00
Hans-Werner Hilse
ff0fbbdb4b fix widget closing 2014-12-01 16:21:42 +00:00
Hans-Werner Hilse
844c1babf7 UIManager:_refresh(): no more default refresh
If no refresh type is specified, don't do a refresh.
There should be now refresh types specified in all relevant places.
2014-12-01 16:03:41 +00:00
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.
2014-12-01 16:03:40 +00:00
Hans-Werner Hilse
9c4088a3ac small change of UIManager:show(): No more automatic refresh
This eliminates the API difference between the extra parameters of
UIManager:show() and setDirty(). They work the same now.
Note that this also eliminates the automatic refresh that took place
before when using show() without refresh options. It always refreshed
the full screen, which led to too big refresh regions all over the
place. Thus, refresh has now explicitly to be asked for, hopefully
encouraging to implement it in the widget that gets shown (and is
aware about the screen region it covers).

Also add an event that is triggered when a widget is closed:
CloseWidget. So a widget can implement "onCloseWidget()" to trigger
actions upon closing - most commonly, this is a refresh for the area
previously taken by the widget. That way, the widget's user does not
have to take measures to ensure that the area is refreshed later.
2014-12-01 14:42:38 +00:00
chrox
20fd6f902e fix #1175 2014-12-01 15:32:12 +08:00
Huang Xin
ddae003925 Merge pull request #1310 from hwhw/master
fixes for scrolling, fix for double-refresh, misc stuff
2014-12-01 09:56:04 +08:00
Hans-Werner Hilse
e8642fbad7 use API for refresh when closing widgets in message popups 2014-11-30 22:35:08 +00:00
Hans-Werner Hilse
1091a8a3b9 add refresh control to UIManager:close() 2014-11-30 22:35:07 +00:00
Hans-Werner Hilse
e7f7417cd3 refresh only dialog part of the screen for multi-word selection window 2014-11-30 22:33:38 +00:00
Hans-Werner Hilse
143c56c48c record ButtonDialog.dimen 2014-11-30 22:33:38 +00:00
Hans-Werner Hilse
8376e2f821 dictionary window triggers refresh itself, not via show() 2014-11-30 22:33:37 +00:00
Hans-Werner Hilse
afb59667c0 allow for more control on refreshes when show()ing widgets
for now, we have show() automatically call setDirty() for the new
widget, as before. However, now show() takes two arguments for
refresh configuration that will get passed on to setDirty().

For compatibility, the default is here in show() to do a partial
refresh. So if you want no refresh triggered (via this show() call),
add a function that doesn't return anything.
2014-11-30 22:33:36 +00:00
Frans de Jonge
47d7a48555 OPDS: refactored unit test and fixed a minor bug with undefined image_rel 2014-11-30 21:44:47 +01:00
Hans-Werner Hilse
3f9dc46315 fix dict window refresh
was still using old API
also, move this to another place.
2014-11-30 18:38:03 +00:00
Hans-Werner Hilse
c4a9903162 on finish of pan gesture when scrolling, do partial refresh
it was set to a full refresh. However, we want to behave as if in
non-scrolling mode and issue a partial refresh. That might get
updated to a full refresh if the full-refresh counter has reached
the limit - which is configurable.
2014-11-30 18:38:03 +00:00
Hans-Werner Hilse
745e3837e0 updating the screen in tap handler of readerfooter is not needed
Was a hack anyway, c.f.
https://github.com/koreader/koreader/pull/1306#discussion_r21057461

Seems to be not needed anymore. If some areas are now not refreshed
anymore, that ought to be fixed in another place.

This also gets rid of redundant screen flashes.
2014-11-30 18:38:02 +00:00
Frans de Jonge
c25254a7ec OPDS: embryonic unit test for OPDS browser
This initial seed specifically tests against what recently broke in Gutenberg and FeedBooks.
2014-11-30 19:06:27 +01:00
Hans-Werner Hilse
f02be20a65 refresh fixes for the menus
this will only refresh the areas that actually need to be refreshed.
2014-11-30 12:04:33 +00:00
Hans-Werner Hilse
6793a4fee1 reader config dialog: properly refresh config pane
This serves as a good example for the way refreshes are done:
setDirty("all", function() ... end)
* the "all" will have all widgets on screen repainted.
  In this case that is needed because the config pane has
  different sizes, covering different parts of underlying
  widgets. So they need to be repainted every time.
* the function will return the area to refresh and is evaluated
  after painting. In this example, we take the area that is covered
  by the config pane before switching it (if present at all), and
  hand it to the refresh area function as an upvalue.
  When the function is called later after painting, it will
  use that saved area and combine it with the area that is covered
  then by the widget. That way, parts that are covered no more are
  included in the refresh area, too.
2014-11-30 11:50:51 +00:00
Hans-Werner Hilse
82c26b1f18 adapt widgets to new refresh/repaint API 2014-11-30 00:17:50 +00:00
Hans-Werner Hilse
229c5ad61c change setDirty/refresh API
See documentation in the code.
In short: There is now one single method, setDirty(), that triggers
repaints and/or refreshes.
All variables in UIManager are gone - at least from an external
perspective. Everything is done through setDirty().
This also allows for easier debugging, since all requests come
in via function calls.
2014-11-30 00:15:17 +00:00
Hans-Werner Hilse
2f9386cd69 move refresh menu table out of UIManager
no need to clutter a core file of the whole UI concept with definitions
of UI elements
2014-11-30 00:15:17 +00:00
Frans de Jonge
7fd8f4d2f1 Add missing util.template definition to readerfrontlight.lua
Fixes #1302.
2014-11-29 15:45:18 +01:00
Andrey Golovizin
296f63b22a OPDS: ignore links with unknown rel values, treat empty rel as rel="subsection". 2014-11-29 11:15:41 +01:00
HW
cceac98180 Merge pull request #1298 from Frenzie/master
Language: prevent spaces from disappearing in localizations with util.template
2014-11-28 23:14:58 +01:00
Frans de Jonge
73a6f71a0b Prevent spaces from being eaten by Transifex
Fixes #1276
2014-11-28 22:38:54 +01:00
Frans de Jonge
7a87b66fa1 OPDS catalog: auto-fill http:// if no protocol given and revert #1106
This fixes #1259.
2014-11-28 21:58:19 +01:00
Huang Xin
1b07698952 Merge pull request #1296 from hwhw/imagewidget_alpha
Imagewidget alpha
2014-11-29 00:00:29 +08:00
Hans-Werner Hilse
b2e38ca80d honor alpha when painting the dog-ear bookmark icon
allows for different icons making use of that. For our current icon,
it actually doesn't.

Fixes #402
2014-11-28 15:37:12 +00:00
Hans-Werner Hilse
0c80537003 allow image widgets to do alpha-blitting
when the image (e.g. a PNG) does contain an alpha channel, that can
be honored by ImageWidget. It doesn't do so by default for compatibility
(arguably, we should change that in the future), it has to be enabled
by setting the "alpha" property to "true" (boolean, not string).
2014-11-28 15:37:11 +00:00
Hans-Werner Hilse
a82bafc63c fix handling of invalid UTF8 sequences
external data (and in bad cases our own) can contain invalid byte
sequences in UTF8 strings. A prominent example are file names.
There was a 1-off bug in calculating the allowed length for multibyte
chars, and the iterator was a bit too greedy when stumbling upon
invalid sequences, returning a single "invalid" char for a sequence
up to the point where it became invalid in calculation. Now, we present
one invalid char for the first byte of that sequence and then check
for a valid char starting with the next byte.
2014-11-28 14:52:04 +00:00
Hans-Werner Hilse
f828f6e7e4 show dictionary title in info popup when setting default dictionary 2014-11-28 13:53:42 +00:00
Hans-Werner Hilse
1156bcd057 show a popup upon making a dictionary the default dictionary 2014-11-28 13:33:04 +00:00
Huang Xin
a72bc33022 Merge pull request #1293 from Frenzie/language
Reworked several strings
2014-11-28 21:21:51 +08:00
Frans de Jonge
693fa0837e Reworked several strings
This is the remaining gruntwork of #1276. I believe that only leaves networkmgr.lua and filemanagersearch.lua, which will require a little more thought.
2014-11-28 14:10:37 +01:00
Huang Xin
e835c1e502 Merge pull request #1280 from hwhw/master
fix a case when "ip r" command fails
2014-11-28 20:19:06 +08:00
Frans de Jonge
66f04af8fb Various applications of util.template
This is the first bunch for #1276. I'd like to resolve #1281 before doing more.
2014-11-28 12:48:15 +01:00
Hans-Werner Hilse
48610006d5 fix a case when "ip r" command fails
our network manager script isn't the beauty of the code base.
However, this fixes a case where it would crash the reader when an
external command fails.

fixes #1279.
2014-11-28 10:58:54 +00:00
Frans de Jonge
cf93605d04 Change "Screen Mode" to "Orientation"
Screen mode isn't user-oriented. Orientation is.

"Page" in "Page Margin" is redundant
2014-11-28 11:32:45 +01:00
Hans-Werner Hilse
173de615db Revert "smaller viewport for Kobo H2O (bezel overlaps bottom)"
This reverts commit fc36d6db37.
2014-11-27 16:01:00 +00:00
Hans-Werner Hilse
fc36d6db37 smaller viewport for Kobo H2O (bezel overlaps bottom) 2014-11-27 15:46:03 +00:00
Hans-Werner Hilse
dacb59f6b2 move debug function handover, set viewport for Kobo Mini
in order to have debugging facilities in framebuffer:init(), we hand
over the debug function as soon as we can.

Also, set a viewport for Kobo Mini. Hopefully, it fits most people -
I can only test on my unit.
2014-11-27 15:46:03 +00:00
Hans-Werner Hilse
4a497cfcfb fix initialization order on Kobos
notably, this will set up input offsets for viewport stuff after the
input rotation has been set up.
2014-11-27 15:46:02 +00:00
chrox
ca60ceacd0 make radius field respects popout flag 2014-11-27 22:01:57 +08:00
chrox
fe885be563 refactoring readerbookmark to show both bookmarks and highlights
in the bookmark menu
and use binary search of the sorted bookmarks table whenever is
possible.
2014-11-27 22:01:57 +08:00
chrox
ac6a34ee3d fix crash on special offered Kindle 2014-11-27 22:01:57 +08:00
Hans-Werner Hilse
895b98d5be add debugging output for device initialisation 2014-11-27 10:34:16 +00:00
Hans-Werner Hilse
677871cbf7 allow emulator to specify a viewport
This allows for Viewport debugging. It is configured via an environment
variable, EMULATE_READER_VIEWPORT. It works with Lua table syntax, e.g.:
EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}"
2014-11-27 10:15:44 +00:00
Hans-Werner Hilse
bf7ea7af6d add device names as comments
we use mostly code names internally, but it is probably a good idea
to annotate the actual device names.
2014-11-27 10:14:24 +00:00
Frans de Jonge
141095b0c8 Alterations to the menu
References #1219 and #1258.
2014-11-26 18:16:54 +01:00
Hans-Werner Hilse
48ea442e28 close file descriptor of dictionary lookup pipe 2014-11-26 09:02:18 +00:00
Hans-Werner Hilse
c6d342f305 fix usage of old refresh API
standby/screensaver/USB was affected.
2014-11-26 08:25:18 +00:00
chrox
e1af7f2ed3 prompt users to long press directory to set inbox
This should fix #1233.
2014-11-25 18:19:33 +08:00
chrox
1accddb8cd fix #1236 by opening the parent directory of last used document 2014-11-25 17:49:46 +08:00
chrox
0a06041cd9 fix calculation of widget height of filechooser
the height of filechooser is provided when creating filechooser
widget since there may be no title as in filemanger which needs
a special title widget to contain filemanger menu.
2014-11-25 17:49:46 +08:00
chrox
67693367b9 init width and height of filechooser widget during init
so that everytime a filechooser is inited right dimension
size is used.
2014-11-25 16:31:03 +08:00
chrox
548e830fdc fix crash when highlighting text in EPUB documents
Since the new Screen:getSize modthod returns a regular table
instead of a Geom which is set to the dimen field of readerview,
there is no copy method in the dimen field. And we don't need to
copy dimen any more since the result won't be modified. Even the
screen page area somehow needs to be modified, the caller of this
function should make a copy of that variable by itself.
2014-11-25 11:02:33 +08:00
Hans-Werner Hilse
7da6dd28a5 handle Android app events in frontend/device code
Events have been passed to the frontend/device (or /input) code before.
Some of them have been handled in the FFI/input code, however. That
seems to be highly critical with regard to timing, though, so we just
let it enqueue the event for our code to process later. That way, a
mutex that locks the input event queue can be freed faster.
2014-11-24 21:09:28 +00:00
Hans-Werner Hilse
2775ade5d6 fix device:init() bug on Android platform 2014-11-24 08:52:01 +00:00
Hans-Werner Hilse
39d061fd3a pass device object to input FFI module
this is needed (for now) on Android, since the FFI module triggers
screen updates.
2014-11-23 12:15:19 +00:00
Hans-Werner Hilse
57a27f8f24 provide debug function to framebuffer ffi implementation 2014-11-23 12:13:34 +00:00
Hans-Werner Hilse
21ded080dd fix refactor bug: invalidate update_regions_func 2014-11-23 12:13:33 +00:00
Hans-Werner Hilse
8696ca1fa1 fix old (pre-refactor) refresh call syntax 2014-11-23 12:13:33 +00:00
Hans-Werner Hilse
22697adf20 switch from scaleByDPI() to scaleBySize() 2014-11-23 12:13:32 +00:00
Hans-Werner Hilse
63af71188a refactor refresh
Lots of the device-related distinction wandered into
base/ffi/framebuffer_<driver>. This eases the refresh logic in
UI manager, which basically only decides what kind of refresh
to trigger. The device specific configuration in the framebuffer
driver decides how to realize that whish.

screen.lua is gone, in its place is now the framebuffer driver.
The device abstraction decides what framebuffer driver to load.
2014-11-23 12:13:32 +00:00
HW
7b91935df0 Merge pull request #1230 from chrox/fix_1170
fix #1169 and #1170
2014-11-23 13:13:07 +01:00
chrox
d11dba0558 fix #1169 and #1170 2014-11-23 18:06:20 +08:00
chrox
3574865dcb fix #1166 by auto alignment of option name 2014-11-23 16:52:08 +08:00
Hans-Werner Hilse
f9f97163e8 wait for background thread before free()ing koptcontext
This should prevent freeing resources that are actually in use in
a background thread.
2014-11-22 14:44:24 +00:00
HW
9b5ff4ca41 Merge pull request #1224 from chrox/cover_60
add unit tests for readerdictionary and readerhighlight
2014-11-22 15:30:57 +01:00
Huang Xin
823147f8df Merge pull request #1225 from Frenzie/language
Refactored menu
2014-11-22 10:03:01 +08:00
Huang Xin
b6f37debeb Merge pull request #1226 from Frenzie/filesearcher
Filesearcher: added notification for no results
2014-11-22 10:02:41 +08:00
Frans de Jonge
7c01a3f2a9 Fixed spaces stripped out by Transifex in readerui.lua by using util.template 2014-11-21 17:08:55 +01:00
Frans de Jonge
da00b4b8a9 Refactored menu
While looking into #1219 I accidentally ended up refactoring some stuff.

Tested in emulator and on H2O, but be wary because I might have overlooked something.
2014-11-21 15:57:10 +01:00
chrox
566586619a add unit tests for readerdictionary and readerhighlight 2014-11-21 18:32:43 +08:00
Frans de Jonge
92f0092ad4 Filesearcher: added notification for no results 2014-11-20 22:42:51 +01:00
chrox
dbf8faa9b1 remove hardcoded footer height of reader menu 2014-11-20 18:02:50 +08:00
chrox
f52872b081 default autoscale for IconButton 2014-11-20 18:02:50 +08:00
chrox
8384eba810 consider also the screen size when scaling by DPI 2014-11-20 18:02:50 +08:00
chrox
e66801039b refactoring: reuse IconButton for config menu bar 2014-11-20 18:02:50 +08:00