mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderLink: option to add location to stack on opening book (#7685)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user