1. Comment out re-calculation of parameters to adjust for the case when
the user changed screen orientation, because we force portrait mode on
document close. I left a comment explaining this, so we can uncomment
this code if we choose to not force portrait mode on document close in
thefuture.
2. Don't re-sort the list if the file does not exist.
This predicts the most likely scenario, namely that the user
will choose to delete this stale history entry.
And even if he chooses NOT to delete it, placing a stale entry
to the top of the list contradicts our logic because the
non-existent file was never opened.
The "Last Documents" list is re-sorted on operations that modify it,
such as deleting an entry. But opening/closing a document is also one
such operation and, therefore, requires re-sorting.
This patch changes the second argument of InfoMessage:inform() function
to be either DINFO_DELAY or DINFO_NODELAY with the following
semantics:
DINFO_DELAY - display the message and delay DINFO_DELAY ms before
returning. Save and restore the screen content.
DINFO_NODELAY - display the message and return immediately without
saving/restoring the screen content.
Also, tidy up the call to modBBox() from Shift-X command handler, it
should be unireader:modBBox() and not self:modBBox(unireader) --- there
is no need to pass the reader object to the :modBBox() method.
The functions ReturnKey() and InQuotes() are generic utility functions
and there is no reason whatsoever for them to be object methods of
FileChooser object (and in fact they are used elsewhere). We should
clearly delineate the common utility functions from object's methods
so that eventually the former could be moved to other source modules
while the latter stay close to their object's definitions.
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.
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.
1. Remove ".." entry as unnecessary waste of (rather limited) space.
Pressing KEY_BACK returns the user from this dialog, so there is no need
for the ".." entry.
2. Simplify FileHistory:init() function as it does not really need the
argument --- our history location is fixed and hardcoded.
3. Remove KEY_HOME quit key from history command handlers. Pressing Home
key too many times would cause the application to exit, which is
very annoying.
4. Show the number of items in the header next to "Last Documents".
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
- 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.