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

438 Commits

Author SHA1 Message Date
Qingping Hou
d8542fa9f7 use last_xpointer to keep reading progress for crereader 2013-01-11 12:15:46 -05:00
Tigran Aivazian
d5d60d62b0 Merge pull request #670 from kai771/bugfix3
bugfix: when in fit-to-content-width, and you start panning, overlap should not be shown
2012-12-18 11:02:16 -08:00
kai771
6466de9390 bugfix: when in fit-to-content-width, and you start panning, overlap should not be shown 2012-12-18 18:14:17 +01:00
kai771
f8d7c07f39 bugfix: Back when link shortcut keys are shown moves to the top of the page 2012-12-18 18:12:16 +01:00
kai771
55b4ecb8e1 bugfix: when link underlines are off, bottom line should be drawn when pressing L 2012-12-14 18:37:36 +01:00
Tigran Aivazian
e3ae08c872 Crash when switching mode + other fixes
1. When switching file manager mode from restricted (formerly known as
"Beginner") to unrestricted (formerly known as "Expert" or "Advanced")
and paging down the file list KPV would crash.
2. Clear up the mess with the file manager mode --- we only need two
modes: RESTRICTED and UNRESTRICTED. When we need more we'll add them. No
need to pollute code with future "what if"s.
3. Setting file manager mode function has no place in unireader (it was
formerly needed because the event notifications was dependent on it ---
not anymore).
4. Bugfix: show the correct number of books in UNRESTRICTED file manager
mode when pressing fiveway Right key on a directory.
2012-11-28 18:56:55 +00:00
chrox
10b4804d2e cleanup: use current_memsize instead of counting cache sizes 2012-11-22 20:11:22 +08:00
{Qingping,Dave} Hou
f41d56d397 Merge pull request #626 from chrox/kopt-cache
bugfix: calculate current cache size and free oldest cache if needed
2012-11-21 21:39:17 -08:00
{Qingping,Dave} Hou
f27ee2f5fa Merge pull request #628 from tigran123/highlights
Fix deleting highlights via Shift-N + cleanup of battery logging.
2012-11-21 13:39:45 -08:00
Tigran Aivazian
fa0c08cb56 Fix deleting highlights via Shift-N
When deleting highlights the tables pointing to a highlight's page
number and sequential number within that page must be rebuilt.
The present implementation illustrates the typical use of local
functions in Lua, i.e. for this situation the lexical scope feature of
Lua's local functions is ideally suited.
2012-11-21 12:47:12 +00:00
chrox
0603dc8a38 bugfix: calculate current cache size and free oldest cache if needed
Cache ttl should not be decreased only when there is no free slot for
new cache but decreased when claiming new cache each time. Otherwise
caches will be freed altogether which obviously is not the purpose of
the cache system. This patch only free the oldest caches and make just
enough free slots for the new one.
2012-11-21 18:59:02 +08:00
Tigran Aivazian
722ddc96f9 Redraw current page on return from highlight mode
When returning from highlight mode there is no need to :goto() to the
current page (and force dummy pre-cache) --- all that is needed is the
redraw of the current page.
2012-11-21 00:02:01 +00:00
Tigran Aivazian
7cfc505d21 Remove unneeded redraw of the current page.
The function UniReader:showHighLight() internally handles all cases
where page redraw is necessary. Therefore, there is no need to redraw
the current page (much less to :goto() to it) on return from it.
2012-11-20 23:29:31 +00:00
{Qingping,Dave} Hou
c2ab146203 Merge pull request #621 from tigran123/home
Unify Home and Alt-Back commands for UniReader
2012-11-20 06:46:58 -08:00
{Qingping,Dave} Hou
b74fa0e0e2 Merge pull request #620 from tigran123/delete-bookmarks-crengine
Support deleting bookmarks in crengine
2012-11-20 06:45:42 -08:00
{Qingping,Dave} Hou
7c1cf60438 Merge pull request #618 from tigran123/rotation-mode
Cleanup the forcing of portrait mode and make FileChooser work in landscape mode
2012-11-20 06:38:04 -08:00
Tigran Aivazian
72e0a314fb Unify Home and Alt-Back commands for UniReader
The command handlers for Home and Alt-Back commands currently perform
exactly the same function (of closing the document) despite the help page
and even the Lua code suggesting otherwise, so it makes sense to merge
them into a single command handler.
2012-11-20 10:19:39 +00:00
Tigran Aivazian
7e5712946a Make bm_menu in UniReader:showBookMarks() local
We should not overwrite a global bm_menu (if it exists).
2012-11-20 09:47:53 +00:00
Tigran Aivazian
f2c161d45d Cleanup the forcing of portrait mode
1. Move the setting of G_width/G_height inside the function
Screen:setRotationMode()
2. Don't call self:clearCache() twice on closing the document (once is enough).
3. Get rid of UniReader:setRotationMode() method because
Screen:setRotationMode() is enough, as there is nothing reader- or
document-specific in this function.
2012-11-19 20:36:05 +00:00
Tigran Aivazian
93a0db59a1 Added InfoMessage:drawTopMsg() method
Displaying a pop-up window for operations like adding a bookmark seems a
bit of an overkill for simple messages like "Bookmark added" or
"Bookmark already exists". Therefore, based on the suggestion by
@dracodoc I have implemented an InfoMessage:drawTopMsg() for this
purpose which just renders the text in the top left corner on a gray
background of auto-calculated appropriate width.
2012-11-19 20:07:47 +00:00
kai771
c50b53b604 bugfix: incorrectly positioned jumps
1. In a document with different even/odd bbox, when jumping from odd to even
page, page would be incorrectly positioned.
2. When closing document in fit-to-content-width and 2-column-mode,
and opening it again, the page would not be positioned correctly if you
were not at the beginning of the page when closing.
2012-11-18 21:35:06 +01:00
kai771
f9be17ecad correction for #608. I added the line in the wrong place 2012-11-18 18:40:00 +01:00
kai771
ba90e9e97c bugfix: using bbox of previous document
If you open a document, manually set bbox, then close it and open
another one without bbox, manually set bbox of the previous bbox is
used, which is annoying. This fixes it.
2012-11-18 14:35:36 +01:00
Tigran Aivazian
8ae678ae5b Merge pull request #605 from kai771/help_bugfix
bugfix: help message too long
2012-11-18 00:47:08 -08:00
kai771
c049f26b52 bugfix: help message too long 2012-11-18 00:12:18 +01:00
kai771
dc3478f1e8 links, goto, jump history, search should also reset overlap 2012-11-17 23:55:04 +01:00
kai771
326b9065de another fixes to overlap in 2 column mode (this time with fw left/right) 2012-11-17 23:13:52 +01:00
kai771
7adb096c4d overlap bugfixes (again)
1. Fixes showing overlap when it shouldn't in 2 column mode
2. number jumps (10%, 20% etc) should reset overlap
3. jumps from TOC should reset overlap
2012-11-17 22:57:01 +01:00
Tigran Aivazian
07ff1474a3 Merge pull request #596 from kai771/emu_rotate
Implements Kindle screen rotate on emulator and forces portrait mode on doc close
2012-11-17 11:04:18 -08:00
kai771
fc604057b6 fixes a bug that dracodoc reported in #597. I missed it :( 2012-11-17 00:18:48 +01:00
kai771
eafeb2fce3 force portrait mode after closing document 2012-11-16 22:52:58 +01:00
kai771
47fd08a3a3 fixes and changes suggested by tigran123 2012-11-16 17:58:35 +01:00
kai771
2382d46c66 deleted call to :inform() 2012-11-15 22:17:25 +01:00
kai771
2b5e161575 things I missed 1 2012-11-15 21:07:53 +01:00
kai771
427f1c6a10 Overlap on/off improvement
Turning off overlap was instantly visible, but turning it back on was visible only on the next view. This makes both turning on/off overlap instantly visible. Since the result of a keypress is immediately visible, I commented out the inform message, since it's not needed anymore.
2012-11-15 20:45:54 +01:00
kai771
4c3f9fdeb7 bugfix: bottom of bbox should be respected in fit-to-content-width mode 2012-11-15 18:24:26 +01:00
Tigran Aivazian
609089629c Cleanup InfoMessage:inform() API and its usage
This patch changes the second argument of InfoMessage:inform() function
to be either DINFO_DELAY or DINFO_NODELAY with the following
semantics:

DINFO_DELAY - display the message and delay DINFO_DELAY ms before
returning. Save and restore the screen content.

DINFO_NODELAY - display the message and return immediately without
saving/restoring the screen content.

Also, tidy up the call to modBBox() from Shift-X command handler, it
should be unireader:modBBox() and not self:modBBox(unireader) --- there
is no need to pass the reader object to the :modBBox() method.
2012-11-15 13:35:41 +00:00
chrox
974a6dd066 refactoring: move function in "Shift+X" command into the modBBox method
So that other modules like koptconfig could reuse the code to have the
fuctionality of modifying the page bbox.
2012-11-15 18:00:08 +08:00
Tigran Aivazian
fd0120ad69 Bugfix: toggle popup windows don't disappear
Thanks to kai771's idea of setting the value of DINFO_TIMEOUT_FAST=1
(in defaults.lua) we can still have the same behaviour of calls to
InfoMessage:inform(..DINFO_TIMEOUT_FAST..) on both the emulator and the
Kindle without the need to manually refresh the page after the call.
Also, now we don't need to set pagedirty=true in filechooser when
displaying a popup window with DINFO_TIMEOUT_FAST flag.
Also, add space to the end of the text messages passed to :inform() for
symmetry.
2012-11-14 19:38:05 +00:00
Tigran Aivazian
4e74b70b9f Revert "Bugfix: need page redraw after DINFO_TIMEOUT_FAST"
This reverts commit 3393a4a9ea5fd41d0a97cb9e6ae2ebd00b9f03b1.
2012-11-14 19:32:02 +00:00
Tigran Aivazian
3268e487f0 Bugfix: need page redraw after DINFO_TIMEOUT_FAST
I have removed the calls to self:redrawPage() recently after the calls
to InfoMessage:inform() with DINFO_TIMEOUT_FAST because on the emulator
the screen was refreshed automatically. But not so on the real Kindle
hardware --- we have to refresh the page explicitly, otherwise the popup
window stays until one forces manual refresh via Space or turns the page
(or causes a refresh by some other way, e.g. pressing Menu twice).
This patch restores those calls to self:redrawCurrentPage().
Also, it adds space to the end of some messages for symmetry and
switches Alt-Z toggle to DINFO_TIMEOUT_FAST mode as well.
2012-11-14 19:32:02 +00:00
Tigran Aivazian
af463cd993 Merge pull request #578 from tigran123/goto-page
Optimize UniReader:redrawCurrentPage()
2012-11-14 01:47:25 -08:00
Tigran Aivazian
3fd89106bd Merge pull request #577 from tigran123/link-jumps
Add any link jump to the history.
2012-11-14 01:38:27 -08:00
Tigran Aivazian
f3c5670016 Merge pull request #571 from tigran123/bbox-fix
Don't slow down :inform() when modifying bbox (and other very minor fixes)
2012-11-14 01:37:50 -08:00
Tigran Aivazian
96da77ba96 Make the code more compact. 2012-11-13 23:34:58 +00:00
Tigran Aivazian
edb2a1f678 Optimize UniReader:redrawCurrentPage()
1. There is no need to call the :goto() method which does the extra work
of adding to jump history and (most importantly) pre-caching, which is
not relevant for the simple task of redrawing the current page.
2. The page goto "G" function can now be optimized to avoid pre-caching if
the page has not actually changed.
2012-11-13 23:14:14 +00:00
Tigran Aivazian
12e713b285 Add any link jump to the history.
Previously, if you follow a local link in the PDF file which points to a
place only one page away from the current page and then press Back it
will bring you to some random location (depending on the previous jump
history). But normally you would expect to be returned to the link's
location, regardless of its distance from the target page. This commit
fixes this problem, also raised as an issue 575.
2012-11-13 22:29:11 +00:00
kai771
77558cadd7 G_height -> height 2012-11-13 20:06:16 +01:00
kai771
1b5075ba51 clean-up 2012-11-13 18:50:07 +01:00
kai771
0f945dd9cd bugfixes for fit-to-content-width zoom mode for documents with pages of different size 2012-11-13 18:42:17 +01:00