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

88 Commits

Author SHA1 Message Date
Dobrica Pavlinušić
36486d0697 Merge pull request #383 from tigran123/rendertext
Fixes to text rendering functions and their callers.
2012-10-07 07:28:31 -07:00
Tigran Aivazian
7fe288ace3 No need for the local variable 'title' 2012-10-07 15:20:31 +01:00
Tigran Aivazian
87712cf0e4 Show the program version in the Help header.
1. On startup read the file git-rev if exists and initialize a new global
G_program_version.
2. In filechooser's help page's header show the version.
This helps to easily identify what version the user is running without
asking him to cat git-rev file manually.
2012-10-07 12:59:37 +01:00
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
2012-10-07 12:28:22 +01:00
NuPogodi
00c1f2ec9c New InfoMessage Concept
Part I (still no unireader, crereader, filesearcher & fileinfo)
2012-10-03 00:45:45 +02:00
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).
2012-09-29 19:03:29 +01:00
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.
2012-09-25 13:00:34 +01:00
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.
2012-09-25 11:08:06 +01:00
NuPogodi
6a2b0d044d filechooser: added support for calling folder info 2012-09-24 18:15:30 +03:00
Tigran Aivazian
6cd66a3e79 No need to set self.items after deleting a directory as it is
recalculated in self:setPath() anyway.
2012-09-21 08:26:13 +01:00
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).
2012-09-21 08:17:53 +01:00
Tigran Aivazian
69ac04500a Indicate in the help page that "Home" is the key to be used for exiting the application. 2012-09-19 21:45:39 +01:00
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.
2012-09-19 12:25:15 +01:00
Tigran Aivazian
c43fb549d3 Avoid writing to files when obtaining the battery level --- use pipes instead. 2012-09-18 23:36:01 +01:00
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.
2012-09-16 23:04:03 +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
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.
2012-09-09 15:08:46 +01: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
Tigran Aivazian
b96f4f509f Remove the Debug() call I added when debugging the previous issue. 2012-09-02 15:45:29 +01:00
Tigran Aivazian
2d4189fc84 Bugfix: moving files to/from clipboard works now. 2012-09-02 15:38:25 +01:00
Tigran Aivazian
7000f349c0 Allow renaming the whole file, including "extension". 2012-08-29 10:33:42 +01:00
NuPogodi
bfe8a5d84f added calculator to filechooser
closes #232
2012-08-28 23:09:28 +02:00
NuPogodi
282d8e693e improvements to rename if file browser
closes #219
2012-08-28 23:00:18 +02:00
Tigran Aivazian
8a583311c8 Trivial grammatical changes. 2012-08-27 15:11:07 +01:00
Tigran Aivazian
b605536567 Fix the "rename" function to include the file extension. 2012-08-27 14:53:26 +01:00
Tigran Aivazian
601b7b9d69 Memory leak in DrawFileItem(), found by NuPogodi. 2012-08-27 14:50:09 +01:00
Qingping Hou
7a3de8b6b7 move battery info file to /tmp 2012-08-26 00:21:48 +08:00
Qingping Hou
ad7a8d044c update self.items and self.current after file deletion 2012-06-09 18:10:05 +08:00
Kefu Chai
8665a7567f stay at current page after deletion
* prefer os.remove() to 'os.execute("rm "...)'
2012-06-09 14:46:45 +08:00
HW
0d12ff70cd rename debug() to Debug() to stop clashing with the debug submodule from Lua 2012-06-04 00:49:23 +02:00
HW
e35339a398 fixed wrong escape sequences in strings
again, LuaJIT will choke on these, Lua-5.1.n did just ignore them
2012-06-03 01:52:16 +02:00
Dobrica Pavlinusic
ae9be768ab use lfs.currentdir to specify clipboard directory
This will make clipboard usable on emulator
2012-05-28 19:35:59 +02:00
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
2012-05-28 19:19:21 +02:00
NuPogodi
cccdf42892 use new input handling to enable help page 2012-05-23 11:46:22 +02:00
Dobrica Pavlinusic
a08c35a52c added Screen:screenshot() 2012-05-19 23:04:40 +02:00
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.
2012-05-19 13:04:49 +02:00
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
2012-05-01 19:24:52 +02:00
Dobrica Pavlinusic
c688e6e20c few more places in which repeat key is useful 2012-04-27 23:35:33 +02:00
Qingping Hou
a89c88f40f add zip format support 2012-04-24 20:44:59 +08:00
Qingping Hou
dbb49505f1 add doc format support
Though I don't like doc at all.
2012-04-24 20:37:16 +08:00
Dobrica Pavlinusic
18f0cf8043 added mobi to CREReader #131 2012-04-21 14:18:23 +02:00
Qingping Hou
b8da531d8d add "searching file" message
missed in previous commit
2012-04-20 20:48:17 +08:00
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
2012-04-19 09:58:34 +08:00
Qingping Hou
3306346dba use debug to print debug info 2012-04-19 00:16:49 +08:00
Qingping Hou
8cdcca148b fix: page number calculation in file{chooser,searcher} 2012-04-18 18:37:00 +08:00
HW
57d769e0ae added wrapper function for input.waitForEvent that retries on EINTR 2012-04-12 21:00:44 +02:00
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.
2012-04-09 19:04:26 +02:00
Qingping Hou
7fdec8a980 fix: handle screen resolution correctly in filesearcher 2012-04-08 14:31:23 +08:00
Qingping Hou
1593c56803 mod: add html support in crereader 2012-04-05 10:31:31 +08:00
Qingping Hou
b09110a38d Merge branch 'djvu-highlight' into epub 2012-03-29 17:54:48 +08:00