End of document action menu: radiomark (#8812)

reviewable/pr8823/r1
hius07 2 years ago committed by GitHub
parent 8026370d5c
commit e167388e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -350,12 +350,13 @@ local back_to_exit_str = {
always = {_("Always"), _("always")},
disable ={_("Disable"), _("disable")},
}
local function genGenericMenuEntry(title, setting, value, default)
local function genGenericMenuEntry(title, setting, value, default, radiomark)
return {
text = title,
checked_func = function()
return G_reader_settings:readSetting(setting, default) == value
end,
radio = radiomark,
callback = function()
G_reader_settings:saveSetting(setting, value)
end,
@ -555,10 +556,10 @@ common_settings.document_end_action = {
end,
separator = true,
},
genGenericMenuEntry(_("Ask with popup dialog"), "end_document_action", "pop-up", "pop-up"),
genGenericMenuEntry(_("Do nothing"), "end_document_action", "nothing"),
genGenericMenuEntry(_("Book status"), "end_document_action", "book_status"),
genGenericMenuEntry(_("Delete file"), "end_document_action", "delete_file"),
genGenericMenuEntry(_("Ask with popup dialog"), "end_document_action", "pop-up", "pop-up", true),
genGenericMenuEntry(_("Do nothing"), "end_document_action", "nothing", nil, true),
genGenericMenuEntry(_("Book status"), "end_document_action", "book_status", nil, true),
genGenericMenuEntry(_("Delete file"), "end_document_action", "delete_file", nil, true),
{
text = _("Open next file"),
enabled_func = function()
@ -567,14 +568,15 @@ common_settings.document_end_action = {
checked_func = function()
return G_reader_settings:readSetting("end_document_action") == "next_file"
end,
radio = true,
callback = function()
G_reader_settings:saveSetting("end_document_action", "next_file")
end,
},
genGenericMenuEntry(_("Go to beginning"), "end_document_action", "goto_beginning"),
genGenericMenuEntry(_("Return to file browser"), "end_document_action", "file_browser"),
genGenericMenuEntry(_("Mark book as read"), "end_document_action", "mark_read"),
genGenericMenuEntry(_("Book status and return to file browser"), "end_document_action", "book_status_file_browser"),
genGenericMenuEntry(_("Go to beginning"), "end_document_action", "goto_beginning", nil, true),
genGenericMenuEntry(_("Return to file browser"), "end_document_action", "file_browser", nil, true),
genGenericMenuEntry(_("Mark book as read"), "end_document_action", "mark_read", nil, true),
genGenericMenuEntry(_("Book status and return to file browser"), "end_document_action", "book_status_file_browser", nil, true),
}
}

Loading…
Cancel
Save