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

1313 Commits

Author SHA1 Message Date
Tigran Aivazian
f1e197cbfd For documents without TOC we need to redraw current page after showing the "No Table of Contents" message,
otherwise the message "Retrieving TOC..." will stay on the screen indefinitely.
2012-09-09 15:00:17 +01:00
{Qingping,Dave} Hou
329132d3df Merge pull request #259 from dpavlin/fileinfo_duplication
fileinfo doesn't reset results
2012-09-09 06:33:48 -07:00
{Qingping,Dave} Hou
7e20d120db Merge pull request #258 from dpavlin/cr_cache
use ldomDocCache::init to cache crengine DOM
2012-09-09 06:32:28 -07:00
Dobrica Pavlinušić
4c5f488151 Merge pull request #257 from dpavlin/master
fix crash on documents without TOC
2012-09-09 04:21:06 -07:00
Dobrica Pavlinusic
d3aa98abb9 fileinfo doesn't reset results
This affects multiple entry into fileinfo which just accumulate
information, eventually scrolling off screen
2012-09-09 13:13:12 +02:00
Dobrica Pavlinusic
3fe518979c use ldomDocCache::init to cache crengine DOM
This should improve performance of crengine #206
2012-09-09 12:58:04 +02:00
Dobrica Pavlinusic
acc61e7c07 fix crash on documents without TOC
Showing TOC on documents without one results in following error:

lua config error: ./unireader.lua:1742: attempt to get length of a nil value
2012-09-09 12:19:59 +02:00
{Qingping,Dave} Hou
9c0b59c79e Merge pull request #255 from tigran123/master
Multi-level TOC support.
2012-09-08 17:09:26 -07:00
Qingping Hou
6a1de042f4 initialize fileinfo.commands to nil 2012-09-09 08:08:48 +08:00
Tigran Aivazian
27340db68b cleanup: get rid of the variable that is no longer needed. 2012-09-09 01:00:43 +01:00
Tigran Aivazian
44df8027f7 Fix the function cleanUpTocTitle() to return a single string, so that
it can be passed as a second argument to table.insert().
2012-09-08 23:53:28 +01:00
Tigran Aivazian
e2a3f1de64 Multi-level TOC support, see issue #235 on github. 2012-09-08 23:52:04 +01:00
Tigran Aivazian
e824fb24da Correct the comment (the existing text was referring to a different file). 2012-09-08 22:21:26 +01:00
{Qingping,Dave} Hou
aa93a8f078 Merge pull request #254 from dpavlin/master
fallback to default fonts when loading reader configuration
2012-09-07 08:38:37 -07:00
Dobrica Pavlinusic
406f3d72da fallback to default fonts when loading reader configuration
Since we are adding and renaming fonts, we need to make sure that
all fonts which reader uses are defined. This allows us to add fonts
and not break when users load old configuration files

close #252
2012-09-07 16:29:52 +02:00
NuPogodi
a5496b83c6 Update helppage.lua
Fixed crash of heplpage 'cause of typo: tfont > tface
2012-09-07 15:36:38 +02:00
Qingping Hou
6c9fb8b023 fix typo in getFace 2012-09-07 12:32:19 +08:00
Qingping Hou
4199ac8e3c add missing ")" 2012-09-07 12:31:55 +08:00
{Qingping,Dave} Hou
f03e198573 Merge pull request #251 from NuPogodi/master
New menu to change font faces; new parameter to handle files; etc
2012-09-06 21:17:55 -07:00
NuPogodi
d1ae0f3999 Enter filemanager modes for beginners & advanced users
1. Added parameter that tells filemanager the way how to manage files. Those who prefer 'safe' method (default) should not select any other mode except for BEGINNERS_MODE in new menu called by Alt+M. Actually, 'safe mode' is our old version (the files are filtered on the extention-basis; one may rename the filenames, but not their extentions). The tigran's corrections de0f40ce9c
are easy to switch on by selecting mode for advanced users who understand potential danger (mostly, crashes of crereader 'cause of improper input files) and accept it.
2. New menu Font:chooseFonts() to change font faces
3. Removed duplicated code of 'make screenshot'
4. The hotkeys (Back & Home) to exit FileChooser are moved down
5. Removed outdated comments
2012-09-06 22:21:36 +03:00
NuPogodi
dddbea89df Restored proper separation of cre-documents
The decision whether ext:getReader(ftype) returns CREReader or nil for documents with improper file extentions now depends on the new parameter FileChooser.filemanager_expert_mode. Improper files are now related to CREReader only for advances users.
2012-09-06 21:45:40 +03:00
NuPogodi
b052e3207c Add global parameter filemanager_expert_mode
In order to switch between safe and advanced way for filechooser to manage files, I've introduced special parameter 'filemanager_expert_mode':
i) 'safe' means that filemanager shows only files with the reader-related extentions; make safe renaming (i.e. the extention remains the same)
ii) 'advanced': all files are available (no filtering); any renaming is allowed;
TODO: to add also 'expert' mode & use it for unstable or dangerous functions
2012-09-06 21:38:54 +03:00
NuPogodi
92545a0cc2 Message font: "cfont" > "infofont"
1. Removed useless parameter self.face
2. Changed font face from "cfont" to "infofont"
2012-09-06 21:25:47 +03:00
NuPogodi
4196d98323 Replaced: font-related 'self' parameters > local
1. Made few (font-related) self parameters to be local > now updating font faces in Font:chooseFonts() properly changes these font faces
3. Removed outdated comments; minor code cleanup: to make it more readable
2012-09-06 21:19:57 +03:00
NuPogodi
8a792d2f31 Replaced: font selection menu (new version), etc
1. New menu Font:chooseFonts() to change font faces
2. Removed duplicate of 'make screenshot'
3. Hotkeys (Back & Home) to exit are moved down, to the end of hotkey list
4. Removed outdated comments & not informative comments
2012-09-06 21:04:20 +03:00
NuPogodi
dc2fcc8654 Replace old 'Font menu'-function by new, improved version
1. Replace old function to change 'cfont' by new, improved version capable to change all font faces.
2. Remove 'make screenshot'; already added in commands.lua
2. Moved exit hotkeys (Back & Home) to the end of the hotkey list
3. Remove some outdated comments and clean a bit the code (just cosmetics to make it more readable)
2012-09-06 20:50:50 +03:00
NuPogodi
5e6a93191a Clear the code from not used parameters
1. Remove a lot of unused self parameters & commands (including 'make screenshot') 
2. Make sure adding commands only once
3. Add function to change font faces for any items enumerated in Fonts.fontmap and modify the code to recalculate the width of left column that depends on the selected font face => lface
4. Remove most of outdated comments
2012-09-06 20:35:25 +03:00
NuPogodi
cfa4afe35a Improved the method to define font face to render menu items
1. Add parameter own_glyph that defines how to render menu items:
default own_glyph = 0,	-- render menu items with default "cfont"
own_glyph = 1 => own glyphs for items like "Droid/DroidSans.ttf"
own_glyph = 2 => own glyphs for Font.fontmap._index like "ffont", "tfont", etc.
Now own font face may be used to render both types of menu items called from Font:chooseFonts() 
2. Delete some outdated comments
2012-09-06 20:24:48 +03:00
NuPogodi
bd0c180c81 Add functions to change font face for all items in Font.fontmap
1. Excluded pgfont from Font.fontmap-items; it was used in helppage.lua to render footer and just duplicated ffont
2. Fixed typo: self.cfont > "cfont" in Font:getFace()
3. 3 small functions to change font face for any member of Font.fontmap
2012-09-06 20:05:57 +03:00
NuPogodi
d58fa93285 Next tigran's requests
1. Finally, removed infomessage about redrawing page in new zoom mode
2. Prevented potentially wrong user's input of non-integer values for page numbers in the 'go to page' input box
3. Removed duplicated code to make screenshot; already included in commands.lua
2012-09-06 19:49:56 +03:00
NuPogodi
fe5d39821f Added: command 'make screenshot'
Now one may gradually remove 'make screenshot'-duplicates from other Lua-modules.
TODO: Since Shift+P is in use in inputbox to enter char 'P', one should discuss replacing Shift+P by something else, that is still free. Just an info: inputbox uses all buttons without modifiers => small characters; all buttons with Shift => CAPITALS; Alt+Q..P = digits (0..9) and etc.
2012-09-06 19:39:53 +03:00
{Qingping,Dave} Hou
093f99aaa7 Merge pull request #250 from NuPogodi/master
fix: to prevent crashes at opening wrong zips or zips with not crengine-related documents
2012-09-05 11:02:53 -07:00
NuPogodi
676a4610cf Following requests...
1. Replace hotkeys Alt+<> & Shift+<> (houpq's request)
2. Restrict maximum X/Y-panning steps by G_width/G_height, respectively.
3. Remove warning out about redrawing in new zoom mode (tigran's request)
2012-09-05 20:54:49 +03:00
NuPogodi
a1c85affd1 if the document cannot be opened, function openFile(filename) shows a warning with specified error 2012-09-05 19:53:37 +03: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
Dobrica Pavlinušić
a52ce4d22a Merge pull request #247 from NuPogodi/master
unireader: storing rcountmax; user-configurable zoom step & pan steps, etc
2012-09-04 06:28:31 -07:00
NuPogodi
1f89704b90 storing rcountmax; user-configurable zoom step & pan steps, etc
1. In order to close issue #59, I've introduced user-configurable values for panning steps - for X- & Y-axis, separately. Now panning is called by pressing fiveway without mod_keys. When one presses Shift+FW, he/she changes panning steps in the following way - Shift-Left/Right = decrease / increase X-panning step (divide or multiply on factor 2), Shift-Up/Down = increase / decrease Y-panning step. The lowest value for panning steps is set 1. Both parameters, shift_x & shift_y, are saved to local settings (i.e. history file).

2. Manual zoom step was also made user-configurable. So, instead of two old zooming functions (with fixed 10% and 20%-steps), I made one function to zoom (Shift+<>), while the other (Alt+<>) changes the zoom step downto minimum 1%. 

3. Fresh introduced function to change parameter rcountmax was added by storing rcountmax to both setting files - global settings & local ones (i.e. history file) - so that the rcountmax-priority (from low to high) is the following: default rcountmax=5 < its value in global settings < rcountmax stored for each concrete document.

3. Dirty, the extention-based hack to avoid reading not crengine-related parameters stored in history files. TODO: one has to finally introduce loadSpecialSettings() & readSpecialSettings() for PDFReader & DJVUReader and to store therein the reader-specific parameters (like globalgamma, bbox, globalzoom, globalzoom_mode; render_mode = for djvu-files only, etc.)

4. Some lua-code cosmetics (to make code more readable); for example: "self.pan_margin = settings:readSetting("pan_margin") or self.pan_margin" instead of 
"local pan_margin = settings:readSetting("pan_margin")
if pan_margin then
		self.pan_margin = pan_margin
	end"

5. Fix for the today's tigran123 fix: issue #246 (details are included). Added InfoMessage:show() to inform most impatient users that the reader tries to redraw new zoo mode.

6. The fontface for the reading info (called by 'Menu') is restored to be in accordance with original intentions and with the same fontface in crereader.lua - namely, Font:getFace("rifont", 20)

7. Moved the exit hotkeys (Alt+Back & Home) to the end of hotkey list.
2012-09-03 22:23:06 +03:00
{Qingping,Dave} Hou
f85614f1c7 Merge pull request #246 from tigran123/master
Bugfix: screen refresh needed on exit from zoom mode menu.
2012-09-03 08:51:42 -07:00
Tigran Aivazian
b70865286c Remove Debug() --- I keep forgetting to remove them before commit :) 2012-09-03 17:40:13 +01:00
Tigran Aivazian
df18cae233 Bugfix: In zoom mode menu selection we need to redraw the screen even if the selected mode is the same as the current one,
otherwise it gives an impression that the program hangs (unless the user presses Next page or does anything else that causes
screen refresh, e.g. manual screen refresh).
2012-09-03 17:34:48 +01:00
{Qingping,Dave} Hou
c9dcf5bdd2 Merge pull request #244 from tigran123/master
Minor optimization of DjVu drawPage() and set dither bits to 4 to match Kindle's screen.
2012-09-02 10:03:50 -07:00
Tigran Aivazian
af37e9f14d Comment out the setting of dithering bits because djvulibre ignores anything less than 8 bits anyway. 2012-09-02 18:57:37 +01:00
Tigran Aivazian
524c8209c0 Improve customupdate target to only include the _real_ LUA source files, not
the garbage settings.*.lua or any other small test/experimental *.lua files
that happen to be in the current directory.
2012-09-02 18:43:07 +01:00
Tigran Aivazian
95be71c1e1 Small optimization in djvu.c:drawPage() --- there is no need to create and destroy
djvu pixel format on each redraw of the page as this can be done once on open and close
of the document. Also, set dither bits to 4 to help djvulibre choose the most
optimal dithering algorithm for the Kindle. Also, make coding style of "if(" -> "if ("
consistent (both instances were used, but "if (" was more frequent).
2012-09-02 18:22:15 +01:00
{Qingping,Dave} Hou
1e45c06689 Merge pull request #243 from tigran123/master
Bugfix: moving files to/from clipboard works now.
2012-09-02 07:54:18 -07:00
Tigran Aivazian
b96f4f509f Remove the Debug() call I added when debugging the previous issue. 2012-09-02 15:45:29 +01:00
Tigran Aivazian
6f1dea294c Merge remote branch 'upstream/master' 2012-09-02 15:39:34 +01:00
Tigran Aivazian
2d4189fc84 Bugfix: moving files to/from clipboard works now. 2012-09-02 15:38:25 +01:00
Dobrica Pavlinušić
a56e49c3f3 Merge pull request #240 from tigran123/master
DjVu rendering mode and other changes.
2012-09-01 16:00:09 -07:00
Tigran Aivazian
b2e0ecb7b0 Add description of MASK ONLY djvu page rendering mode. 2012-09-01 22:21:29 +01:00