From 46ade8e795fa8c5cfdb18da4dca7b0e425f845ac Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Fri, 26 Feb 2016 00:04:21 -0800 Subject: [PATCH] readergoto: show current page in input hint --- frontend/apps/reader/modules/readergoto.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/apps/reader/modules/readergoto.lua b/frontend/apps/reader/modules/readergoto.lua index dd378bb34..ea14d6fbc 100644 --- a/frontend/apps/reader/modules/readergoto.lua +++ b/frontend/apps/reader/modules/readergoto.lua @@ -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 = { { {