Commit Graph

85 Commits (c7b4cf71f808a40d2461bac4e02bf8d2d4127327)

Author SHA1 Message Date
Tigran Aivazian c7b4cf71f8 Fix the kerning logic in text size/rendering.
1. Fix the functions sizeUtf8Text(), renderUtf8Text() and
renderUtf8TextWidth() to have a meaningful test whether to kern or not
(the current code is meaningless as it contains the `else` clause that is never
executed).
2. Whitespace changes to filechooser.lua
12 years ago
NuPogodi 00c1f2ec9c New InfoMessage Concept
Part I (still no unireader, crereader, filesearcher & fileinfo)
12 years ago
Tigran Aivazian 1a3371c5bf Two fixes from NuPogodi
1. ATM, the footers in selectmenu.lua & helppage.lua are left-adjusted,
these also contain the prompt for users how to call help
(selectmenu.lua) and how to go back (helppage.lua). By minor correction
to function DrawFooter() in filechooser.lua, one may readily make the
rest footers to look in a similar way.
2. When writing the code of inputbox.lua, I (NuPogodi) left the wrong
command to delete the 1st entry in the math function list
(called in calculator mode by pressing Alt-M).
12 years ago
Tigran Aivazian 385f74222a Create static directories at build, not runtime.
Instead of calling lfs.mkdir() to create "./history" and "./screenshots"
at runtime it is easier to create them at package build time.
I hesitated whether to add "./clipboard" to this list but decided
against it as we can perhaps change current directory and then
all the code manipulating clipboard would break, so I left it as is.
12 years ago
Tigran Aivazian 864be87fc2 Tidy up BatteryLevel() function.
1. Remove assert() around io.popen() as this function never fails, even
when opening a pipe to a non-existent program.
2. Remove the second assert() as well, because it is not wise to fail the whole
application just because we don't know or cannot ascertain the battery
level.
3. Guard against the failure of gasgauge-info (e.g. on emulator where it
does not exist, so, effectively "fails") by checking what we read from
the pipe and return "?" if need be.
12 years ago
NuPogodi 6a2b0d044d filechooser: added support for calling folder info 12 years ago
Tigran Aivazian 6cd66a3e79 No need to set self.items after deleting a directory as it is
recalculated in self:setPath() anyway.
12 years ago
Tigran Aivazian b2f4d358ae Bugfix for deleting a directory:
After a directory is deleted it is still shown in the filemanager
list, so you can accidentally delete another directory as all the
pointers after the previously deleted entry are wrong (shifted by one).
12 years ago
Tigran Aivazian 69ac04500a Indicate in the help page that "Home" is the key to be used for exiting the application. 12 years ago
Tigran Aivazian c57c319656 When user presses BACK in the filemanager it should NOT exit the program, only HOME should do so.
Otherwise too many times one accidentally exits from KPV.
12 years ago
Tigran Aivazian c43fb549d3 Avoid writing to files when obtaining the battery level --- use pipes instead. 12 years ago
Tigran Aivazian 1694fc5b0a Stop filling up crash.log with INFO messages about battery charge every couple of seconds.
Every write to a flash device shortens its life.
12 years ago
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")
12 years ago
Tigran Aivazian 2c6dfae807 Shorten various messages --- otherwise they are NOT SHOWN at all.
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.
12 years ago
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
12 years ago
Tigran Aivazian b96f4f509f Remove the Debug() call I added when debugging the previous issue. 12 years ago
Tigran Aivazian 2d4189fc84 Bugfix: moving files to/from clipboard works now. 12 years ago
Tigran Aivazian 7000f349c0 Allow renaming the whole file, including "extension". 12 years ago
NuPogodi bfe8a5d84f added calculator to filechooser
closes #232
12 years ago
NuPogodi 282d8e693e improvements to rename if file browser
closes #219
12 years ago
Tigran Aivazian 8a583311c8 Trivial grammatical changes. 12 years ago
Tigran Aivazian b605536567 Fix the "rename" function to include the file extension. 12 years ago
Tigran Aivazian 601b7b9d69 Memory leak in DrawFileItem(), found by NuPogodi. 12 years ago
Qingping Hou 7a3de8b6b7 move battery info file to /tmp 12 years ago
Qingping Hou ad7a8d044c update self.items and self.current after file deletion 12 years ago
Kefu Chai 8665a7567f stay at current page after deletion
* prefer os.remove() to 'os.execute("rm "...)'
12 years ago
HW 0d12ff70cd rename debug() to Debug() to stop clashing with the debug submodule from Lua 12 years ago
HW e35339a398 fixed wrong escape sequences in strings
again, LuaJIT will choke on these, Lua-5.1.n did just ignore them
12 years ago
Dobrica Pavlinusic ae9be768ab use lfs.currentdir to specify clipboard directory
This will make clipboard usable on emulator
12 years ago
NuPogodi 944a3b5b05 NuPogodi code drop from 2012-05-27
- zip files don't require double extensions any more
- filechooser has 'H' shortcut to display keys
- new function for files and folders (^ == shift)
	^N - new folder
	Del - delete document/folder
	^C - copy file into clipboard
	^X - cut (move) file to clipboard
	^V - paste files from clipboard
	^R - rename file
- configurable keyboard for input box
12 years ago
NuPogodi cccdf42892 use new input handling to enable help page 12 years ago
Dobrica Pavlinusic a08c35a52c added Screen:screenshot() 12 years ago
NuPogodi 3a76ec91fd integrate rest of @NuPogodi changes #166
- long lines (filenames in 'Document Info') are now splitted in more
  human-readable way (by spaces, dots, slashes or some other characters
- see screenshot)
- the selection of fonts in filemanager (key 'F' or 'Aa') looks now more
  user-friendly
- fixed too long strings in most menues (TOC, Bookmarks, Fonts...) and
  in the popup with the reading progress (called by key 'Menu')
- the position inside the cr-documents (epub, mobi...) now remain nearly
  the same after rescaling the document (i.e. changing the font face,
  size, boldface and interline distance)
- when you open TOC-menu or Fonts Menu, it highlights the current item
  (i.e. current chapter and current fontface).
- i've a bit changed the way to read the battery level values, it might
  now work even without Amazon Kindle framework.
12 years ago
Dobrica Pavlinusic ba19ab7029 added .prc as alternative extension for mobi
This was reported by @valex in post at forum:
http://www.mobileread.com/forums/showpost.php?p=2064360&postcount=340
12 years ago
Dobrica Pavlinusic c688e6e20c few more places in which repeat key is useful 12 years ago
Qingping Hou a89c88f40f add zip format support 12 years ago
Qingping Hou dbb49505f1 add doc format support
Though I don't like doc at all.
12 years ago
Dobrica Pavlinusic 18f0cf8043 added mobi to CREReader #131 12 years ago
Qingping Hou b8da531d8d add "searching file" message
missed in previous commit
12 years ago
Qingping Hou e282179793 fix bug in addJump and addBookmark
Pointed out by kljohann, thanks.
Now addJump and addBookmark get notes
from specified pageno/xpointer instead
of current page.

* also fixed bug in page number counting
  in cre.cpp
12 years ago
Qingping Hou 3306346dba use debug to print debug info 12 years ago
Qingping Hou 8cdcca148b fix: page number calculation in file{chooser,searcher} 12 years ago
HW 57d769e0ae added wrapper function for input.waitForEvent that retries on EINTR 12 years ago
HW ec2eda0c05 switched font handling to only work with external fonts
now you can use a environment variable, FONTDIR, to point
to a font dir. Otherwise, "./fonts" is used by default.
Subdirectories are indexed.
12 years ago
Qingping Hou 7fdec8a980 fix: handle screen resolution correctly in filesearcher 12 years ago
Qingping Hou 1593c56803 mod: add html support in crereader 12 years ago
Qingping Hou b09110a38d Merge branch 'djvu-highlight' into epub 12 years ago
Qingping Hou 4821f10dda half done demo for crengine 12 years ago
Qingping Hou eac9893958 fix: add KEY_LPGFWD and KEY_LPGBCK to filechooser 12 years ago
traycold bfcad367bb using font module for getting fonts (commit f95231d789)
renamed function names using camelCase (issue #62)
12 years ago