Add new presets.lua module and dictionary presets (#13774)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

This commit is contained in:
David
2025-06-20 22:33:45 +01:00
committed by GitHub
parent 0594f619c3
commit 30499e33b0
6 changed files with 633 additions and 219 deletions

View File

@@ -260,32 +260,40 @@ You can choose an existing folder, or use a default folder named "Wikipedia" in
separator = true,
},
{
text = _("Enable Wikipedia history"),
text = _("Wikipedia lookup history"),
checked_func = function()
return not self.disable_history
end,
callback = function()
self.disable_history = not self.disable_history
G_reader_settings:saveSetting("wikipedia_disable_history", self.disable_history)
end,
},
{
text = _("Clean Wikipedia history"),
enabled_func = function()
return wikipedia_history:has("wikipedia_history")
end,
keep_menu_open = true,
callback = function(touchmenu_instance)
UIManager:show(ConfirmBox:new{
text = _("Clean Wikipedia history?"),
ok_text = _("Clean"),
ok_callback = function()
-- empty data table to replace current one
wikipedia_history:reset{}
touchmenu_instance:updateItems()
sub_item_table = {
{
text = _("Enable Wikipedia history"),
checked_func = function()
return not self.disable_history
end,
})
end,
callback = function()
self.disable_history = not self.disable_history
G_reader_settings:saveSetting("wikipedia_disable_history", self.disable_history)
end,
},
{
text = _("Clean Wikipedia history"),
enabled_func = function()
return wikipedia_history:has("wikipedia_history")
end,
keep_menu_open = true,
callback = function(touchmenu_instance)
UIManager:show(ConfirmBox:new{
text = _("Clean Wikipedia history?"),
ok_text = _("Clean"),
ok_callback = function()
-- empty data table to replace current one
wikipedia_history:reset{}
touchmenu_instance:updateItems()
end,
})
end,
},
},
separator = true,
},
{ -- setting used in wikipedia.lua