[UX] Implement back_to_exit option (#3838)

Also goes back to File Manager as default view first.
This commit is contained in:
onde2rock
2018-04-09 09:22:16 +02:00
committed by Frans de Jonge
parent ab712f1a29
commit 5aacc761e1
6 changed files with 69 additions and 7 deletions

View File

@@ -125,6 +125,48 @@ if Device:isAndroid() then
table.insert(common_settings.screen.sub_item_table, require("ui/elements/screen_fullscreen_menu_table"))
end
if Device:hasKeys() then
common_settings.navigation = {
text = _("Navigation"),
sub_item_table = {
{
text = _("Back key to exit KOReader"),
sub_item_table = {
{
text = _("Prompt"),
checked_func = function()
local setting = G_reader_settings:readSetting("back_to_exit")
return setting == "prompt" or setting == nil
end,
callback = function()
G_reader_settings:saveSetting("back_to_exit", "prompt")
end,
},
{
text = _("Always"),
checked_func = function()
return G_reader_settings:readSetting("back_to_exit")
== "always"
end,
callback = function()
G_reader_settings:saveSetting("back_to_exit", "always")
end,
},
{
text = _("Disable"),
checked_func = function()
return G_reader_settings:readSetting("back_to_exit")
== "disable"
end,
callback = function()
G_reader_settings:saveSetting("back_to_exit", "disable")
end,
},
},
},
}
}
end
common_settings.document = {
text = _("Document"),
sub_item_table = {