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

412 Commits

Author SHA1 Message Date
kai771
326b9065de another fixes to overlap in 2 column mode (this time with fw left/right) 2012-11-17 23:13:52 +01:00
kai771
7adb096c4d overlap bugfixes (again)
1. Fixes showing overlap when it shouldn't in 2 column mode
2. number jumps (10%, 20% etc) should reset overlap
3. jumps from TOC should reset overlap
2012-11-17 22:57:01 +01:00
Tigran Aivazian
07ff1474a3 Merge pull request #596 from kai771/emu_rotate
Implements Kindle screen rotate on emulator and forces portrait mode on doc close
2012-11-17 11:04:18 -08:00
kai771
fc604057b6 fixes a bug that dracodoc reported in #597. I missed it :( 2012-11-17 00:18:48 +01:00
kai771
eafeb2fce3 force portrait mode after closing document 2012-11-16 22:52:58 +01:00
kai771
47fd08a3a3 fixes and changes suggested by tigran123 2012-11-16 17:58:35 +01:00
kai771
2382d46c66 deleted call to :inform() 2012-11-15 22:17:25 +01:00
kai771
2b5e161575 things I missed 1 2012-11-15 21:07:53 +01:00
kai771
427f1c6a10 Overlap on/off improvement
Turning off overlap was instantly visible, but turning it back on was visible only on the next view. This makes both turning on/off overlap instantly visible. Since the result of a keypress is immediately visible, I commented out the inform message, since it's not needed anymore.
2012-11-15 20:45:54 +01:00
kai771
4c3f9fdeb7 bugfix: bottom of bbox should be respected in fit-to-content-width mode 2012-11-15 18:24:26 +01:00
Tigran Aivazian
609089629c 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.
2012-11-15 13:35:41 +00:00
chrox
974a6dd066 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.
2012-11-15 18:00:08 +08:00
Tigran Aivazian
fd0120ad69 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.
2012-11-14 19:38:05 +00:00
Tigran Aivazian
4e74b70b9f Revert "Bugfix: need page redraw after DINFO_TIMEOUT_FAST"
This reverts commit 3393a4a9ea5fd41d0a97cb9e6ae2ebd00b9f03b1.
2012-11-14 19:32:02 +00:00
Tigran Aivazian
3268e487f0 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.
2012-11-14 19:32:02 +00:00
Tigran Aivazian
af463cd993 Merge pull request #578 from tigran123/goto-page
Optimize UniReader:redrawCurrentPage()
2012-11-14 01:47:25 -08:00
Tigran Aivazian
3fd89106bd Merge pull request #577 from tigran123/link-jumps
Add any link jump to the history.
2012-11-14 01:38:27 -08:00
Tigran Aivazian
f3c5670016 Merge pull request #571 from tigran123/bbox-fix
Don't slow down :inform() when modifying bbox (and other very minor fixes)
2012-11-14 01:37:50 -08:00
Tigran Aivazian
96da77ba96 Make the code more compact. 2012-11-13 23:34:58 +00:00
Tigran Aivazian
edb2a1f678 Optimize UniReader:redrawCurrentPage()
1. There is no need to call the :goto() method which does the extra work
of adding to jump history and (most importantly) pre-caching, which is
not relevant for the simple task of redrawing the current page.
2. The page goto "G" function can now be optimized to avoid pre-caching if
the page has not actually changed.
2012-11-13 23:14:14 +00:00
Tigran Aivazian
12e713b285 Add any link jump to the history.
Previously, if you follow a local link in the PDF file which points to a
place only one page away from the current page and then press Back it
will bring you to some random location (depending on the previous jump
history). But normally you would expect to be returned to the link's
location, regardless of its distance from the target page. This commit
fixes this problem, also raised as an issue 575.
2012-11-13 22:29:11 +00:00
kai771
77558cadd7 G_height -> height 2012-11-13 20:06:16 +01:00
kai771
1b5075ba51 clean-up 2012-11-13 18:50:07 +01:00
kai771
0f945dd9cd bugfixes for fit-to-content-width zoom mode for documents with pages of different size 2012-11-13 18:42:17 +01:00
Tigran Aivazian
7d52e65828 Don't slow down :inform() when modifying bbox.
1. We shouldn't delay the calls to :inform() when modifying bbox
(Shift-X) on the emulator. Otherwise, the popup window will disappear
after a very short delay.
2. Document the 'msec' parameter of :inform() method in the comments
above it in dialog.lua.
3. Get rid of some of the "polite" alternative voice messages in cases
where the default one will do perfectly.
4. Get rid of the useless "Scanning folder..." message as this operation
is fast enough to not deserve any such message.
5. Explain the reason why a directory cannot be deleted instead of just
stating this as a fact. (and get rid of those exclamation marks, no need
for shouting, the world is a noisy enough place as it is :)
2012-11-13 11:46:57 +00:00
kai771
c13fe3c517 Remove unneeded page redraws by tigran123 2012-11-11 18:38:42 +01:00
kai771
12974cffbe enable overlap in comics_mode 2012-11-11 18:31:56 +01:00
kai771
39eb6e5e29 Info_timeout in emulator and defaults.lua clean-up 2012-11-11 15:31:55 +01:00
kai771
9e9ffab969 Fixes bugs with viewport mode reported by tigran123 in #555 2012-11-10 22:04:20 +01:00
Dobrica Pavlinušić
22b3e9749c Merge pull request #555 from kai771/page_mode
Implements page mode as a toggle
2012-11-10 04:21:32 -08:00
kai771
3293acd3a3 Implements page mode as a toggle 2012-11-09 00:58:40 +01:00
chrox
2126166233 bugfix: reader chooser dialog is shown properly
When there are reader preferences table but preference for the file type
of which the file is to be opened is not available, reader chooser
should show up.
I changed `last_reader` and `default_reader` to `reader_association` and
`reader_preferences` respectively for clearness.
2012-11-07 16:52:06 +08:00
chrox
af13491b6c bugfix: redefine reader association policy
Users can still use default reader for specific type. The "Remember
this file" option will add exception to the predefined reader
preference. And exception for a document can be made with the "Alt+C"
command after opening the doc. This patch fixed the bug reported on
issue #480 by @dracodoc.
2012-11-07 14:13:47 +08:00
{Qingping,Dave} Hou
1bbd353d95 Merge pull request #549 from tigran123/batop
Make battery logging optional, disabled by default
2012-11-05 14:12:38 -08:00
Tigran Aivazian
dae7b95753 Set the message timeout for battery logging to nil.
This was set to 1 second during the testing and I forgot to reset it to
nil for the commit.
2012-11-05 20:04:15 +00:00
Tigran Aivazian
15aee5f4f2 Make battery logging optional, disabled by default
The key that toggles the battery logging is ALT+KEY_DOT and it works
both in the readers and filechooser.
2012-11-05 20:02:06 +00:00
Tigran Aivazian
60d667db63 Allow anyone to set event notifications.
1. Choosing the level of event notifications shouldn't be restricted.
2. It should sit on key E standing for "configure Event notifications"
rather than the very lengthy "change the way to Inform about events".
2012-11-05 19:13:34 +00:00
kai771
84aa00bbe4 adds DBACKGROUND_COLOR to defaults 2012-11-04 17:22:28 +01:00
kai771
255aa6c761 fixes suggested by tigran123 2012-11-04 15:51:00 +01:00
kai771
57ce4b201f separates configurable options from the code 2012-11-04 14:19:21 +01:00
Tigran Aivazian
e8840e6059 cleanup: one-line call to :inform() for ON/OFF 2012-11-03 19:52:22 +00:00
Tigran Aivazian
aeb6248424 Merge pull request #515 from kai771/rtl_mode
implements rtl_mode
2012-11-03 12:46:58 -07:00
Tigran Aivazian
108737f88e Rotate pages quietly and cleanup toggle calls
1. There is no need to inform the user about the rotation being in
progress because it never takes long enough to cause concerns.
2. Shorten the calls to InfoMessage:inform() in ON/OFF toggle
situations.
2012-11-03 08:01:58 +00:00
kai771
692f5ec454 sets pan_margin back to 5, and restores "+ margin" for y in setzoom 2012-11-02 17:10:26 +01:00
kai771
3f1c052024 Includes dpavlin's fixes from #507 and various bug fixes 2012-11-02 02:07:37 +01:00
kai771
c83b8b3c88 changes shortcut Alt-R to U 2012-11-01 18:23:38 +01:00
kai771
424e29e7e4 changes shortcut R to Alt-R 2012-11-01 17:34:33 +01:00
Tigran Aivazian
694459df64 Check for failure of io.open() 2012-11-01 12:39:59 +00:00
Tigran Aivazian
bef40656a6 Use file:lines() instead of io.lines(filename) API
This is due to a very strange quirk in Lua. If we use io.lines(filename)
API like this:

for line in io.lines(filename) do
  ....
  if something then break end
end

Then the file descriptor table is growing infinitely because the
descriptor is not closed on breaking out of io.lines() loop. So we have
to use the ordinary file api like this:

local file = io.open(filename, "r")
for line in file:lines() do
  ....
  if something then break end
end
file:close()

This way there is no file descriptor leak.
2012-11-01 11:58:02 +00:00
Tigran Aivazian
83fb0cd69b Add simple memory usage indicator.
The function memUsage() parses the file "/proc/self/status" and extracts
the sizes (in KB) of RSS, Data, Stack, Lib and TotalVM.
These are displayed when Menu button is pressed inside readers.
2012-11-01 10:58:17 +00:00