|
|
@ -345,83 +345,77 @@ local back_to_exit_str = {
|
|
|
|
always = {_("Always"), _("always")},
|
|
|
|
always = {_("Always"), _("always")},
|
|
|
|
disable ={_("Disable"), _("disable")},
|
|
|
|
disable ={_("Disable"), _("disable")},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
common_settings.back_to_exit = {
|
|
|
|
local function genGenericMenuEntry(title, setting, value, default)
|
|
|
|
text_func = function()
|
|
|
|
return {
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit") or "prompt"
|
|
|
|
text = title,
|
|
|
|
return T(_("Back to exit (%1)"),
|
|
|
|
|
|
|
|
back_to_exit_str[back_to_exit][2])
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
sub_item_table = {
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = back_to_exit_str.prompt[1],
|
|
|
|
|
|
|
|
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 = back_to_exit_str.always[1],
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
checked_func = function()
|
|
|
|
return G_reader_settings:readSetting("back_to_exit")
|
|
|
|
return G_reader_settings:readSetting(setting, default) == value
|
|
|
|
== "always"
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
callback = function()
|
|
|
|
G_reader_settings:saveSetting("back_to_exit", "always")
|
|
|
|
G_reader_settings:saveSetting(setting, value)
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = back_to_exit_str.disable[1],
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("back_to_exit")
|
|
|
|
|
|
|
|
== "disable"
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
}
|
|
|
|
G_reader_settings:saveSetting("back_to_exit", "disable")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
common_settings.back_to_exit = {
|
|
|
|
|
|
|
|
text_func = function()
|
|
|
|
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit", "prompt") -- set "back_to_exit" to "prompt"
|
|
|
|
|
|
|
|
return T(_("Back to exit: %1"), back_to_exit_str[back_to_exit][2])
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
sub_item_table = {
|
|
|
|
|
|
|
|
genGenericMenuEntry(back_to_exit_str.prompt[1], "back_to_exit", "prompt"),
|
|
|
|
|
|
|
|
genGenericMenuEntry(back_to_exit_str.always[1], "back_to_exit", "always"),
|
|
|
|
|
|
|
|
genGenericMenuEntry(back_to_exit_str.disable[1], "back_to_exit", "disable"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
common_settings.back_in_filemanager = {
|
|
|
|
common_settings.back_in_filemanager = {
|
|
|
|
text = _("Back in file browser"),
|
|
|
|
text_func = function()
|
|
|
|
|
|
|
|
local menu_info = ""
|
|
|
|
|
|
|
|
local back_in_filemanager = G_reader_settings:readSetting("back_in_filemanager", "default") -- set "back_in_filemanager" to "default"
|
|
|
|
|
|
|
|
if back_in_filemanager == "default" then
|
|
|
|
|
|
|
|
menu_info = _("back to exit")
|
|
|
|
|
|
|
|
elseif back_in_filemanager == "parent_folder" then
|
|
|
|
|
|
|
|
menu_info = _("parent folder")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return T(_("Back in file browser: %1"), menu_info)
|
|
|
|
|
|
|
|
end,
|
|
|
|
sub_item_table = {
|
|
|
|
sub_item_table = {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
text_func = function()
|
|
|
|
text_func = function()
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit") or "prompt"
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit", "prompt")
|
|
|
|
return T(_("Back to exit (%1)"),
|
|
|
|
return T(_("Back to exit (%1)"), back_to_exit_str[back_to_exit][2])
|
|
|
|
back_to_exit_str[back_to_exit][2])
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
checked_func = function()
|
|
|
|
checked_func = function()
|
|
|
|
local back_in_filemanager = G_reader_settings:readSetting("back_in_filemanager")
|
|
|
|
return G_reader_settings:readSetting("back_in_filemanager", "default") == "default"
|
|
|
|
return back_in_filemanager == nil or back_in_filemanager == "default"
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
callback = function()
|
|
|
|
G_reader_settings:saveSetting("back_in_filemanager", "default")
|
|
|
|
G_reader_settings:saveSetting("back_in_filemanager", "default")
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
genGenericMenuEntry(_("Go to parent folder"), "back_in_filemanager", "parent_folder"),
|
|
|
|
text = _("Go to parent folder"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("back_in_filemanager")
|
|
|
|
|
|
|
|
== "parent_folder"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("back_in_filemanager", "parent_folder")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
common_settings.back_in_reader = {
|
|
|
|
common_settings.back_in_reader = {
|
|
|
|
-- All these options are managed by ReaderBack
|
|
|
|
-- All these options are managed by ReaderBack
|
|
|
|
text = _("Back in reader"),
|
|
|
|
text_func = function()
|
|
|
|
|
|
|
|
local menu_info = ""
|
|
|
|
|
|
|
|
local back_in_reader = G_reader_settings:readSetting("back_in_reader", "previous_location") -- set "back_in_reader" to "previous_location"
|
|
|
|
|
|
|
|
if back_in_reader == "default" then
|
|
|
|
|
|
|
|
menu_info = _("back to exit")
|
|
|
|
|
|
|
|
elseif back_in_reader == "filebrowser" then
|
|
|
|
|
|
|
|
menu_info = _("filebrowser")
|
|
|
|
|
|
|
|
elseif back_in_reader == "previous_location" then
|
|
|
|
|
|
|
|
menu_info = _("previous location")
|
|
|
|
|
|
|
|
elseif back_in_reader == "previous_read_page" then
|
|
|
|
|
|
|
|
menu_info = _("previous read page")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return T(_("Back in reader: %1"), menu_info)
|
|
|
|
|
|
|
|
end,
|
|
|
|
sub_item_table = {
|
|
|
|
sub_item_table = {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
text_func = function()
|
|
|
|
text_func = function()
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit") or "prompt"
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit", "prompt")
|
|
|
|
return T(_("Back to exit (%1)"),
|
|
|
|
return T(_("Back to exit (%1)"), back_to_exit_str[back_to_exit][2])
|
|
|
|
back_to_exit_str[back_to_exit][2])
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
checked_func = function()
|
|
|
|
checked_func = function()
|
|
|
|
return G_reader_settings:readSetting("back_in_reader") == "default"
|
|
|
|
return G_reader_settings:readSetting("back_in_reader") == "default"
|
|
|
@ -430,34 +424,9 @@ common_settings.back_in_reader = {
|
|
|
|
G_reader_settings:saveSetting("back_in_reader", "default")
|
|
|
|
G_reader_settings:saveSetting("back_in_reader", "default")
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
genGenericMenuEntry(_("Go to file browser"), "back_in_reader", "filebrowser"),
|
|
|
|
text = _("Go to file browser"),
|
|
|
|
genGenericMenuEntry(_("Go to previous location"), "back_in_reader", "previous_location"),
|
|
|
|
checked_func = function()
|
|
|
|
genGenericMenuEntry(_("Go to previous read page"), "back_in_reader", "previous_read_page"),
|
|
|
|
return G_reader_settings:readSetting("back_in_reader") == "filebrowser"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("back_in_reader", "filebrowser")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Go to previous location"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
local back_in_reader = G_reader_settings:readSetting("back_in_reader")
|
|
|
|
|
|
|
|
return back_in_reader == "previous_location" or back_in_reader == nil
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("back_in_reader", "previous_location")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Go to previous read page"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("back_in_reader") == "previous_read_page"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("back_in_reader", "previous_read_page")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
common_settings.opening_page_location_stack = {
|
|
|
|
common_settings.opening_page_location_stack = {
|
|
|
@ -532,6 +501,7 @@ common_settings.document_auto_save = {
|
|
|
|
genAutoSaveMenuItem(false),
|
|
|
|
genAutoSaveMenuItem(false),
|
|
|
|
genAutoSaveMenuItem(5),
|
|
|
|
genAutoSaveMenuItem(5),
|
|
|
|
genAutoSaveMenuItem(15),
|
|
|
|
genAutoSaveMenuItem(15),
|
|
|
|
|
|
|
|
genAutoSaveMenuItem(30),
|
|
|
|
genAutoSaveMenuItem(60),
|
|
|
|
genAutoSaveMenuItem(60),
|
|
|
|
warn_about_auto_save and {
|
|
|
|
warn_about_auto_save and {
|
|
|
|
text = _("Important info about this auto-save option"),
|
|
|
|
text = _("Important info about this auto-save option"),
|
|
|
@ -546,36 +516,9 @@ common_settings.document_auto_save = {
|
|
|
|
common_settings.document_save = {
|
|
|
|
common_settings.document_save = {
|
|
|
|
text = _("Save document (write highlights into PDF)"),
|
|
|
|
text = _("Save document (write highlights into PDF)"),
|
|
|
|
sub_item_table = {
|
|
|
|
sub_item_table = {
|
|
|
|
{
|
|
|
|
genGenericMenuEntry(_("Prompt"), "save_document", "prompt", "prompt"), -- set "save_document" to "prompt"
|
|
|
|
text = _("Prompt"),
|
|
|
|
genGenericMenuEntry(_("Always"), "save_document", "always"),
|
|
|
|
checked_func = function()
|
|
|
|
genGenericMenuEntry(_("Disable"), "save_document", "disable"),
|
|
|
|
local setting = G_reader_settings:readSetting("save_document")
|
|
|
|
|
|
|
|
return setting == "prompt" or setting == nil
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:delSetting("save_document")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Always"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("save_document")
|
|
|
|
|
|
|
|
== "always"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("save_document", "always")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Disable"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("save_document")
|
|
|
|
|
|
|
|
== "disable"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("save_document", "disable")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -592,43 +535,10 @@ common_settings.document_end_action = {
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
separator = true,
|
|
|
|
separator = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
genGenericMenuEntry(_("Ask with popup dialog"), "end_document_action", "pop-up", "pop-up"),
|
|
|
|
text = _("Ask with popup dialog"),
|
|
|
|
genGenericMenuEntry(_("Do nothing"), "end_document_action", "nothing"),
|
|
|
|
checked_func = function()
|
|
|
|
genGenericMenuEntry(_("Book status"), "end_document_action", "book_status"),
|
|
|
|
local setting = G_reader_settings:readSetting("end_document_action")
|
|
|
|
genGenericMenuEntry(_("Delete file"), "end_document_action", "delete_file"),
|
|
|
|
return setting == "pop-up" or setting == nil
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "pop-up")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Do nothing"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "nothing"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "nothing")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Book status"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "book_status"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "book_status")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Delete file"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "delete_file"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "delete_file")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
text = _("Open next file"),
|
|
|
|
text = _("Open next file"),
|
|
|
|
enabled_func = function()
|
|
|
|
enabled_func = function()
|
|
|
@ -641,42 +551,10 @@ common_settings.document_end_action = {
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "next_file")
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "next_file")
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
genGenericMenuEntry(_("Go to beginning"), "end_document_action", "goto_beginning"),
|
|
|
|
text = _("Go to beginning"),
|
|
|
|
genGenericMenuEntry(_("Return to file browser"), "end_document_action", "file_browser"),
|
|
|
|
checked_func = function()
|
|
|
|
genGenericMenuEntry(_("Mark book as read"), "end_document_action", "mark_read"),
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "goto_beginning"
|
|
|
|
genGenericMenuEntry(_("Book status and return to file browser"), "end_document_action", "book_status_file_browser"),
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "goto_beginning")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Return to file browser"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "file_browser"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "file_browser")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Mark book as read"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "mark_read"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "mark_read")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Book status and return to file browser"),
|
|
|
|
|
|
|
|
checked_func = function()
|
|
|
|
|
|
|
|
return G_reader_settings:readSetting("end_document_action") == "book_status_file_browser"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
G_reader_settings:saveSetting("end_document_action", "book_status_file_browser")
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|