ReaderLink: option to add location to stack on opening book (#7685)

pull/7785/head
yparitcher 3 years ago committed by GitHub
parent d5a2df3c04
commit b30e366ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,6 +90,12 @@ function ReaderLink:init()
self.ui:registerPostInitCallback(function()
self.ui.menu:registerToMainMenu(self)
end)
if G_reader_settings:isTrue("opening_page_location_stack") then
-- Add location at book opening to stack
self.ui:registerPostReadyCallback(function()
self:addCurrentLocationToStack()
end)
end
-- For relative local file links
local directory, filename = util.splitFilePathName(self.ui.document.file) -- luacheck: no unused
self.document_dir = directory

@ -436,6 +436,15 @@ if Device:hasKeys() then
end,
}
end
common_settings.opening_page_location_stack = {
text = _("Add opening page to location history"),
checked_func = function()
return G_reader_settings:isTrue("opening_page_location_stack")
end,
callback = function()
G_reader_settings:flipNilOrFalse("opening_page_location_stack")
end,
}
-- Auto-save settings: default value, info text and warning, and menu items
if G_reader_settings:hasNot("auto_save_settings_interval_minutes") then

@ -60,6 +60,7 @@ local order = {
"android_back_button",
"----------------------------",
"invert_page_turn_buttons",
"opening_page_location_stack",
},
network = {
"network_wifi",

@ -100,6 +100,7 @@ local order = {
"----------------------------",
"invert_page_turn_gestures",
"invert_page_turn_buttons",
"opening_page_location_stack",
},
network = {
"network_wifi",

Loading…
Cancel
Save