idea is simple: when starting long operation (page renedering) invert
box on top of screen which has relative width of this page.
This allows easy overview where in document user is, along with
indication that something is still happending.
Perfect use-case are glossy magazines pdfs which have first two
pages in hi-res graphics, so this indicator is very useful to see
that something is still happending and that reader didn't die
Also, mark pagedirty in all cases when deleting the file, to cause the screen refresh --
otherwise the message "Press 'Y' to confirm" stays there indefinitely.
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
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
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.
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
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
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
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)
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
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
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
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
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.
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)
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"
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.