only set two pages mode for crengine in kindle dxg

This commit is contained in:
Qingping Hou
2013-07-28 02:35:46 -04:00
parent 060b8db3b1
commit a8a589c27b
2 changed files with 9 additions and 2 deletions

View File

@@ -227,6 +227,10 @@ function CreDocument:setPageMargins(left, top, right, bottom)
self._document:setPageMargins(left, top, right, bottom)
end
function CreDocument:setVisiblePageCount(new_count)
self._document:setVisiblePageCount(new_count)
end
DocumentRegistry:addProvider("txt", "application/txt", CreDocument)
DocumentRegistry:addProvider("epub", "application/epub", CreDocument)
DocumentRegistry:addProvider("html", "application/html", CreDocument)

View File

@@ -98,7 +98,7 @@ function ReaderUI:init()
ui = self
}
table.insert(self, reader_bm)
-- text highlight
-- text highlight
local highlight = ReaderHighlight:new{
dialog = self.dialog,
view = self[1],
@@ -106,7 +106,7 @@ function ReaderUI:init()
document = self.document,
}
table.insert(self, highlight)
-- dictionary
-- dictionary
local dict = ReaderDictionary:new{
dialog = self.dialog,
view = self[1],
@@ -170,6 +170,9 @@ function ReaderUI:init()
}
table.insert(self, hinter)
else
if Device:getModel() ~= "KindleDXG" then
self.document:setVisiblePageCount(1)
end
-- make sure we load document first before calling any callback
table.insert(self.postInitCallback, function()
self.document:loadDocument()