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

115 Commits

Author SHA1 Message Date
kai771
424e29e7e4 changes shortcut R to Alt-R 2012-11-01 17:34:33 +01:00
kai771
a127ec2c47 implements rtl_mode 2012-10-31 21:45:23 +01:00
chrox
2fd933abc9 remove extension.lua and implement getReaderByType in readerchooser.lua 2012-10-22 22:04:09 +08:00
Tigran Aivazian
9bd6a4c63a Delete Alt-R command in picviewer and crereader 2012-10-20 13:56:41 +01:00
Tigran Aivazian
ffaa770434 Switch crengine to Alt-K/L keys.
I have switched unireader from Alt-Up/Down to Alt-K/L but forgot to do
the same for crengine.
2012-10-15 21:25:31 +01:00
Tigran Aivazian
e0777b6ed2 Cleanup: use local variable bm. 2012-10-15 21:16:37 +01:00
Tigran Aivazian
19fa375a1e Delete the correct command group
By mistake I deleted the Alt-K/L (bookmark cycling) command group
instead of Alt-H/J (TOC cycling) group.
2012-10-15 21:11:19 +01:00
Tigran Aivazian
cd5324c141 Use Alt-H/J and Alt-K/L instead of Alt-fiveway
On Kindle (unlike the emulator) the Alt + fiveway keys don't work, so I
have substituted them with Alt-H/J and Alt-K/L.
2012-10-15 15:22:09 +01:00
Dobrica Pavlinušić
9d9fdf3ce2 Merge pull request #444 from tigran123/toc-cycle
Add TOC entry cycle via Alt-Left/Alt-Right keys.
2012-10-15 06:22:06 -07:00
Dobrica Pavlinušić
9fa47dcd2a Merge pull request #439 from houqp/master
add bookmark jumping feature
2012-10-15 06:20:35 -07:00
Tigran Aivazian
e63a6cb8fe Use MOD_ALT modifier when deleting a group 2012-10-15 11:54:38 +01:00
Tigran Aivazian
50d7594d7f Add TOC cycling via Alt-Left/Alt-Right
When pressing Alt-Left/Alt-Right keys the jump is made to the
previous/next TOC entry respectively.
The jump is NOT recorded in the jump history.
2012-10-15 11:45:30 +01:00
Qingping Hou
857cd74ad3 don't treat bookmark cycling as random browsing
refer to discussion in #439, in short, don't add
jump target to jump history when using bookmark
jumping feature
2012-10-14 19:34:55 -04:00
Qingping Hou
cfbe9456ba change bookmark jumping key binding to Alt-UP/DOWN 2012-10-14 14:26:12 -04:00
Qingping Hou
b2d1302b85 remove redundant vars in bookmark jumping feature 2012-10-14 14:21:56 -04:00
Qingping Hou
a360cfbb17 add bookmark jumping shortcuts 2012-10-14 14:40:57 +08:00
Dobrica Pavlinusic
d64a4fb7a1 remove SHift+L binding since crengine always draws links 2012-10-13 15:12:06 +02:00
Dobrica Pavlinusic
3c755cbc2e added clearSelection used by crengine 2012-10-11 19:30:27 +02:00
Dobrica Pavlinusic
eb450f262f take into account just section links 2012-10-11 19:28:55 +02:00
Dobrica Pavlinusic
60e01c8636 getPageLinks implementation for crengine formats 2012-10-11 19:27:31 +02:00
Tigran Aivazian
0de624a7ea Rename dim_overlap -> show_overlap_enable
The new name is more intuitive.
2012-10-08 14:59:32 +01:00
Tigran Aivazian
cd48bc4d8b Add dim_overlap configurable
On request of users (dracodoc, kai771 et al.) I have added a new command
`O` which toggles the display (via dimmed box) of the page overlap
areas. This setting is saved on a per-book basis, i.e. is specific to
the book, which is the desired behaviour as one wants dimming on some
books (math, physics, etc) but not others (fiction).
2012-10-08 12:48:01 +01:00
NuPogodi
55f4c278b7 Switch to new InfoMessage API from NuPogodi.
Convert the three files crereader.lua filehistory.lua fileinfo.lua to
use the new InfoMessage:inform() API.
2012-10-05 10:59:37 +01:00
Tigran Aivazian
f2443a7d33 Kill "Retrieving TOC..." message and simplify code.
After some consideration I believe that it is best to get rid of
"Retrieving TOC..." message altogether on the following grounds:
1. The code in unireader.lua/crereader.lua that has to deal with this
specifically can be removed.
2. The fillToc() is a data manipulation function and ought not to touch
graphical state.
3. The files for which retrieving TOC can take a long time are
_exceptionally_ rare (only two are known to me --- both are my own
editions with detailed morphological tags which require massive
hierarchical TOC for quick navigation)
4. Users are going to be confused when they press Menu for the first
time and see "Retrieving TOC..." staying on the screen until they press
Menu again.
2012-10-03 23:05:53 +01:00
Tigran Aivazian
8107d84e9e Cleanup crereader fonts initialization.
Don't try to register the two fonts Dingbats.cff and StandardSymL.cff
with crengine because it will reject them anyway. But we cannot simply
remove these two fonts because they are used internally by mupdf to
emulate "builtin" fonts which are mandated by Adobe PDF specification to
be present in every valid implementation.
2012-10-03 17:30:57 +01:00
Tigran Aivazian
93e946b0a4 Undoing previous commit to crereader.lua by NuPogodi
The subject says it all (undoing accidental commit by a fellow
collaborator).
2012-09-28 17:52:05 +01:00
NuPogodi
f872473604 Replace outdated messages by InfoMessage:inform() 2012-09-28 15:00:40 +03:00
Tigran Aivazian
850a777760 On pressing Back crereader loses last position
This fix makes the behaviour of Back command handler in crereader
identical with that in unireader, i.e. the last position is saved in
Jump History when pressing Back, so you can return to it by pressing
Shift-Back enough times.
Also, with this change we would need to handle the need for redrawing
the current page because the :addJump() method can force the call to
fillToc() (if TOC is not already present) and this will display
"Retrieving TOC..." message which will need clearing away.
2012-09-27 13:10:28 +01:00
Tigran Aivazian
df65245e70 Bug in CREReader:ZipContentExt().
Even after restoring to the previous version, this function had a slight
bug that would cause a crash on valid .zip files (e.g.
mupdf-thirdparty.zip in kindlepdfviewer make tree). The reason is
because the value of s may be not nil, but the string.match() would
return nil and so string.lower() would get nil as an argument and crash.
So, we have to guard against this carefully.
2012-09-25 17:06:49 +01:00
Tigran Aivazian
504425cd89 Fix for the issue #314 introduced by a commit in #310
When I rewrote the function CREReader:ZipContentExt() I lost
the code path leading to "Error unzipping file." message.
This was now restored, plus two required changes:
1. There is no need to surround io.popen() with assert() as it
never fails, not even if the command is non-existent. Besides,
even if it did, crashing the whole viewer just because for
some reason we can't unzip the file is not a good idea.
2. The "while tmp" after tmp=assert() assignment is meaningless.
Even after removing assert() it is still meaningless because io.popen()
can never return nil, oddly enough.
2012-09-25 11:55:16 +01:00
NuPogodi
9403d1c120 remove self:redrawCurrentPage() in CREReader:gotoTocEntry(entry) 2012-09-25 02:21:19 +03:00
Tigran Aivazian
43cbcbf319 Rewrite CREReader:ZipContentExt() function.
Technically, the only serious problem in this function was the code:
 local tmp = assert(io.popen('unzip -l \"'..fname..'\"', "r"))
 while tmp do
         s = tmp:read("*line")
         if i > 3 then tmp:close(); break; end
         i = i + 1
 end
It is meaningless to evaluate the truth of the return value of assert()
and the above code gives the impression that it relies on the
(undocumented and unreliable) fact that after tmp:close() tmp will be
nil, even though in actual fact it does because it breaks out of the
loop.
However, having looked at the function I saw that the whole thing
can be rewritten in a much simpler way:

 local tmp = assert(io.popen('unzip -l \"'..fname..'\" | head -4 | tail -1', "r"))
 s = tmp:read("*line")
 tmp:close()
2012-09-24 20:07:23 +01:00
NuPogodi
7b7ba80f6e crereader: piping in function ZipContentExt(...)
Avoid writing/reading from/to temporary file
2012-09-24 18:07:41 +03:00
Tigran Aivazian
2c021d9d4e Corrected the showMenu() function to belong to the right object!
UniReader -> CREReader in crereader.lua.
2012-09-22 18:33:09 +01:00
Tigran Aivazian
a9f4dd3b1f The second part of the TOC/crereader fix.
Redraw the current page when selecting a TOC entry.
Otherwise the correct page is shown only after the next Menu press
or anything else that does current page redraw, e.g. Shift-R.
2012-09-22 10:51:00 +01:00
Tigran Aivazian
de96f30eff Prove CREReader:showMenu() method because the generic
UniReader:showMenu() method invokes :cleanCache() method which is
non-existent for CREReader object and causes a crash if you press C
after pressing Menu while viewing any of crereader-handled files (fb2,
epub, etc.)
2012-09-22 09:40:13 +01:00
Tigran Aivazian
1c32a24450 1. Shorten the "No TOC" message to be displayable.
2. Get rid of the calls to self:fillToc() from the places in the code which cannot affect TOC.
I assume the reason for these calls is that they are needed in the original CoolReader application
(because there the TOC displays the virtual "page numbers") and were brought over to our crengine.lua
during the port.
2012-09-10 23:12:09 +01:00
Tigran Aivazian
253a0829ff No need to initialize oldname = self:FullFileName() twice when renaming a file --- one initialization is enough.
(and, while at it, replaced references to a non-existent word "extention" with the proper English "extension")
2012-09-10 18:17:50 +01:00
Qingping Hou
1eb7162796 set crengine cache size in lua code 2012-09-10 21:45:05 +08:00
Dobrica Pavlinusic
2332691bb0 replaced showInfoMsgWithDelay with InfoMessage:show in crereader 2012-09-09 21:41:35 +02:00
NuPogodi
fe2363b29f fix: to prevent crash opening wrong zips and zips with improper content
if the file with zip-extention is not valid zip or it contains the improper entry (not crengine-related files), function CREReader:open(filename) return false, "the error description"
2012-09-05 19:49:43 +03:00
NuPogodi
a2f7f62a3d crereader: remove not crengine-related 'M'-hotkey
Since I've added new unireader-hotkey that calls menu with zoom-modes, one has to remove it from crereader.lua. Done...
2012-09-01 13:01:17 +03:00
NuPogodi
4d6b03052a crereader: some corrections
1. Improved the method to restore position in document after rescaling font face, size, weight, interline spacing,  etc.
2. Fixed rotation functions inherited from unireader.lua
3. Removed hotkey for the function of manual cropping inherited from unireader.lua; reason: not crengine-related
4. Added fast navigation functions via Shift+fiveway: jump to previous / next TOC-entry; scroll 10 pages backwards / forward
2012-08-31 20:41:36 +03:00
Dobrica Pavlinusic
bc0a911e7e showInfoMsgWithDelay with number of results 2012-08-28 22:14:57 +02:00
Dobrica Pavlinusic
7d10a636e7 correctly return first search position and refresh screen 2012-08-28 21:56:46 +02:00
Dobrica Pavlinusic
adf0b42e5b coolreader search highlight
This is rough port of Android code, but seems to work
2012-08-28 20:56:05 +02:00
Qingping Hou
2dfbf3177f revert shift+page turn bindings
previously, they are overwritten by mistakes
2012-06-06 20:43:11 +08:00
Qingping Hou
dec86586e8 bug fix in CREReader:prevBookMarkedPage
handle two more corner situations
2012-06-06 20:16:40 +08:00
Qingping Hou
8ef6eb8b73 bug fix in CREReader:prevBookMarkedPage 2012-06-06 19:52:41 +08:00
Qingping Hou
d0e7f2240d add bookmark navigation function to crereader 2012-06-06 16:21:25 +08:00