Kill getDiskSizeInfo() function.
Instead of making an extra function call, packing return values in key'd
values of a table and then use two table indexing operations, just call
util.df(".") directly from FileInfo:formatDiskSizeInfo() and use its two
return values appropriately.
Make only Back (not Home) return from Search Results.
It is best to restrict Home to only exit from the application (or
perhaps also for closing the document, though even this is doubtful) and
not use it in any other context, because otherwise pressing Home too
many times may inadvertently exit the application and annoy the user.
It is a bad practice to let user try various keys in different contexts
and hope that one of them may work.
Merge pull request #366 from tigran123/master

Kill getDiskSizeInfo() function and make only Back (not Home) return from Search.
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.
Merge pull request #368 from tigran123/master

Kill "Retrieving TOC..." message and simplify code.
Small typo that wasted millions of instructions.
Now that #define CRENGINE_DEBUG is handled correctly, all those pesky
messages from crengine are gone and so the performance of crereader
should be much better --- remember that under some circumstances
crengine generates literally THOUSANDS of debug messages per second
(e.g. when complaining about corrupt TOC nodes and there are _plenty_ of
fb2 files out there which have an invalid structure).
Change print() to Debug for "Unknown direction!" message.
Merge pull request #369 from tigran123/master

Small typo that wasted millions of instructions...
Prevent crash when opening stale history entry.
This fixes the issue #370 raised by dracodoc.
When the user removes or renames the book which was previously opened
and tries to open it again via (now stale) history entry we are passing
the filename of a non-existent file to the format-specific
:openDocument() method and the behaviour depends on the format. For PDF
and DjVu files it is okay --- they just return an error, but for the
crengine files (ebooks) we get a coredump.
Anyway, the proper solution is to not attempt to open a non-existent
file but give a more meaningful message (than, for example:
"ddjvu: **Unrecognized DjVu Me" for DjVu case) which informs the user
that the history entry is stale. If he has valuable data in it (such as
highlights, etc) he can save them, otherwise he can delete the history
entry there and then.
Tidy up the previous commit.
I didn't realize that the voice message is optional, so the last
argument can be deleted, i.e. in this case the voice message can be the
same as the text one.
Merge pull request #371 from tigran123/master

Prevent crash when opening a stale history entry
First stage of improving the DjVu status info.
Display DjVu info in the status line.
The DjVu info shown in the status line includes:
1. Physical page dimensions.
2. Current value of gamma and (in square brackets) the value of the
display for which the page was designed.
3. Page resolution (in dpi).
4. Page type.
For the end-user probably the most useful bit is the page type as it
helps him decide which rendering mode to choose for this page (and also
explains why he can't see anything on the page --- e.g. when rendering
some COMPOUND or PHOTO pages in B&W mode). For the developer the
physical page dimensions are also interesting as they allow to estimate
the amount of time needed for page decoding and cache efficiency.
Decrease the step for gamma to 10%.
The current step of 25% forward and 20% backward is too big and does not
let us come close enough to the design value of 2.2 for most djvu files.
With 10% step we can get much closer.
Merge pull request #374 from tigran123/djvu-menu-info

Display DjVu info in the status line.
Fixed search with empty pattern (from NuPogodi).
Merge pull request #375 from tigran123/nupogodi

Fixed search in history with empty pattern (from NuPogodi).
reset screen offsets after pre-cache

Code which tried to restore offsets didn't do anything since old and
self point to same values
move page to center if it's smaller than screen

Code used to center page top-left which is somewhat confusing when
document is narrower than screen, and it appears flush left instead
of margins distibuted equally on both sides
paintRect should support negative x and y

without this page, highlights which land outside of page in negative
direction will core-dump reader