UX: a set of minor fixes (#10165)

- AutoFrontlight plugin: update checkmark on toggling
- KeepAlive plugin: update checkmark on toggling
- ReaderPageMap: font size menu entry
- ReaderStatus, common_settings_menu_table: book status "read" -> "finished"
reviewable/pr10167/r1
hius07 1 year ago committed by GitHub
parent 26dc43553b
commit 55f1b8c974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -408,7 +408,7 @@ function ReaderPageMap:addToMainMenu(menu_items)
}, },
{ {
text_func = function() text_func = function()
return T(_("Page labels font size (%1)"), self.label_font_size) return T(_("Page labels font size: %1"), self.label_font_size)
end, end,
enabled_func = function() return self.show_page_labels end, enabled_func = function() return self.show_page_labels end,
callback = function(touchmenu_instance) callback = function(touchmenu_instance)

@ -41,7 +41,7 @@ function ReaderStatus:onEndOfBook()
return return
end end
-- Should we start by marking the book as read? -- Should we start by marking the book as finished?
if G_reader_settings:isTrue("end_document_auto_mark") then if G_reader_settings:isTrue("end_document_auto_mark") then
self:onMarkBook(true) self:onMarkBook(true)
end end
@ -142,7 +142,7 @@ function ReaderStatus:onEndOfBook()
elseif settings == "mark_read" then elseif settings == "mark_read" then
self:onMarkBook(true) self:onMarkBook(true)
UIManager:show(InfoMessage:new{ UIManager:show(InfoMessage:new{
text = _("You've reached the end of the document.\nThe current book is marked as read."), text = _("You've reached the end of the document.\nThe current book is marked as finished."),
timeout = 3 timeout = 3
}) })
elseif settings == "book_status_file_browser" then elseif settings == "book_status_file_browser" then

@ -624,7 +624,7 @@ common_settings.document_end_action = {
}, },
genGenericMenuEntry(_("Go to beginning"), "end_document_action", "goto_beginning", nil, true), genGenericMenuEntry(_("Go to beginning"), "end_document_action", "goto_beginning", nil, true),
genGenericMenuEntry(_("Return to file browser"), "end_document_action", "file_browser", nil, true), genGenericMenuEntry(_("Return to file browser"), "end_document_action", "file_browser", nil, true),
genGenericMenuEntry(_("Mark book as read"), "end_document_action", "mark_read", nil, true), genGenericMenuEntry(_("Mark book as finished"), "end_document_action", "mark_read", nil, true),
genGenericMenuEntry(_("Book status and return to file browser"), "end_document_action", "book_status_file_browser", nil, true), genGenericMenuEntry(_("Book status and return to file browser"), "end_document_action", "book_status_file_browser", nil, true),
} }
} }

@ -116,13 +116,14 @@ end
function AutoFrontlightWidget:addToMainMenu(menu_items) function AutoFrontlightWidget:addToMainMenu(menu_items)
menu_items.auto_frontlight = { menu_items.auto_frontlight = {
text = _("Auto frontlight"), text = _("Auto frontlight"),
callback = function() callback = function(touchmenu_instance)
UIManager:show(ConfirmBox:new{ UIManager:show(ConfirmBox:new{
text = T(_("Auto frontlight detects the brightness of the environment and automatically turn on and off the frontlight.\nFrontlight will be turned off to save battery in bright environment, and turned on in dark environment.\nDo you want to %1 it?"), text = T(_("Auto frontlight detects the brightness of the environment and automatically turn on and off the frontlight.\nFrontlight will be turned off to save battery in bright environment, and turned on in dark environment.\nDo you want to %1 it?"),
AutoFrontlight.enabled and _("disable") or _("enable")), AutoFrontlight.enabled and _("disable") or _("enable")),
ok_text = AutoFrontlight.enabled and _("Disable") or _("Enable"), ok_text = AutoFrontlight.enabled and _("Disable") or _("Enable"),
ok_callback = function() ok_callback = function()
self:flipSetting() self:flipSetting()
touchmenu_instance:updateItems()
end end
}) })
end, end,

@ -13,17 +13,19 @@ local menuItem = {
local disable local disable
local enable local enable
local function showConfirmBox() local function showConfirmBox(touchmenu_instance)
UIManager:show(ConfirmBox:new{ UIManager:show(ConfirmBox:new{
text = _("The system won't sleep while this message is showing.\n\nPress \"Stay alive\" if you prefer to keep the system on even after closing this notification. *This will drain the battery*.\n\nIf KOReader terminates before \"Close\" is pressed, please start and close the KeepAlive plugin again to ensure settings are reset."), text = _("The system won't sleep while this message is showing.\n\nPress \"Stay alive\" if you prefer to keep the system on even after closing this notification. *This will drain the battery*.\n\nIf KOReader terminates before \"Close\" is pressed, please start and close the KeepAlive plugin again to ensure settings are reset."),
cancel_text = _("Close"), cancel_text = _("Close"),
cancel_callback = function() cancel_callback = function()
disable() disable()
PluginShare.keepalive = false PluginShare.keepalive = false
touchmenu_instance:updateItems()
end, end,
ok_text = _("Stay alive"), ok_text = _("Stay alive"),
ok_callback = function() ok_callback = function()
PluginShare.keepalive = true PluginShare.keepalive = true
touchmenu_instance:updateItems()
end, end,
}) })
end end
@ -54,9 +56,9 @@ else
return { disabled = true, } return { disabled = true, }
end end
menuItem.callback = function() menuItem.callback = function(touchmenu_instance)
enable() enable()
showConfirmBox() showConfirmBox(touchmenu_instance)
end end
local KeepAlive = WidgetContainer:extend{ local KeepAlive = WidgetContainer:extend{

Loading…
Cancel
Save