readergoto: show current page in input hint

pull/1853/head
Qingping Hou 8 years ago
parent 847837c5c1
commit 46ade8e795

@ -3,7 +3,6 @@ local InputDialog = require("ui/widget/inputdialog")
local UIManager = require("ui/uimanager")
local Screen = require("device").screen
local Event = require("ui/event")
local DEBUG = require("dbg")
local _ = require("gettext")
local ReaderGoto = InputContainer:new{
@ -25,23 +24,26 @@ function ReaderGoto:addToMainMenu(tab_item_table)
end
function ReaderGoto:onShowGotoDialog()
local dialog_title, goto_btn
local dialog_title, goto_btn, curr_page
if self.document.info.has_pages then
dialog_title = _("Go to Page")
goto_btn = {
text = _("Page"),
callback = function() self:gotoPage() end,
}
curr_page = self.ui.paging.current_page
else
dialog_title = _("Go to Location")
goto_btn = {
text = _("Location"),
callback = function() self:gotoPage() end,
}
-- only CreDocument has this method
curr_page = self.document:getCurrentPage()
end
self.goto_dialog = InputDialog:new{
title = dialog_title,
input_hint = "(1 - "..self.document:getPageCount()..")",
input_hint = "@"..curr_page.." (1 - "..self.document:getPageCount()..")",
buttons = {
{
{

Loading…
Cancel
Save