From e167388e52cf6d9e053648e2848a6fb069d630b0 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Fri, 18 Feb 2022 13:37:02 +0200 Subject: [PATCH] End of document action menu: radiomark (#8812) --- .../elements/common_settings_menu_table.lua | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/ui/elements/common_settings_menu_table.lua b/frontend/ui/elements/common_settings_menu_table.lua index 0259f3da5..ca9996806 100644 --- a/frontend/ui/elements/common_settings_menu_table.lua +++ b/frontend/ui/elements/common_settings_menu_table.lua @@ -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), } }