bugfix: wait only when the bgthread is running
When the bgthread has finished, do the fgthread's reflow.
Merge pull request #583 from chrox/kopt-threads

bugfix: wait only when the bgthread is running
Bugfix: need page redraw after DINFO_TIMEOUT_FAST
I have removed the calls to self:redrawPage() recently after the calls
to InfoMessage:inform() with DINFO_TIMEOUT_FAST because on the emulator
the screen was refreshed automatically. But not so on the real Kindle
hardware --- we have to refresh the page explicitly, otherwise the popup
window stays until one forces manual refresh via Space or turns the page
(or causes a refresh by some other way, e.g. pressing Menu twice).
This patch restores those calls to self:redrawCurrentPage().
Also, it adds space to the end of some messages for symmetry and
switches Alt-Z toggle to DINFO_TIMEOUT_FAST mode as well.
Revert "Bugfix: need page redraw after DINFO_TIMEOUT_FAST"

This reverts commit 3393a4a9ea5fd41d0a97cb9e6ae2ebd00b9f03b1.
Bugfix: toggle popup windows don't disappear
Thanks to kai771's idea of setting the value of DINFO_TIMEOUT_FAST=1
(in defaults.lua) we can still have the same behaviour of calls to
InfoMessage:inform(..DINFO_TIMEOUT_FAST..) on both the emulator and the
Kindle without the need to manually refresh the page after the call.
Also, now we don't need to set pagedirty=true in filechooser when
displaying a popup window with DINFO_TIMEOUT_FAST flag.
Also, add space to the end of the text messages passed to :inform() for
symmetry.
Merge pull request #585 from tigran123/fast1

Bugfix: toggle popup windows don't disappear
bugfix: change the default word spacing for koptreader
Because in most Chinese docs there is very small spacing between
characters compared to the word spacing in English docs. The previous
default is ideal for English documents but is too large for
Chinese docs so that it will be impossible to read reflowed
Chinese pages without changing in to a smaller value. I decrease the
default value a little in this patch so that both English and Chinese
documents will have a satisfatory reflow by default although it's better
to switch it to large for English doc and change it to small for Chinese
doc.
Merge pull request #586 from chrox/master

bugfix: change the default word spacing for koptreader
refactoring: move function in "Shift+X" command into the modBBox method
So that other modules like koptconfig could reuse the code to have the
fuctionality of modifying the page bbox.
add function to log page reflow duration
Merge pull request #589 from chrox/kopt-reflowlog

add function to log page reflow duration
Merge pull request #588 from chrox/modbbox-method

refactoring: move function in "Shift+X" command into the modBBox method
Cleanup InfoMessage:inform() API and its usage
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.
Merge pull request #590 from tigran123/inform2

Cleanup InfoMessage:inform() API and its usage