|
|
|
@ -103,17 +103,23 @@ function filemanagerutil.setStatus(file, status)
|
|
|
|
|
doc_settings:flush()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Generate all book status file dialog buttons in a row
|
|
|
|
|
function filemanagerutil.genStatusButtonsRow(file, caller_callback, current_status)
|
|
|
|
|
local status = current_status or filemanagerutil.getStatus(file)
|
|
|
|
|
local function genStatusButton(to_status)
|
|
|
|
|
local status_text = {
|
|
|
|
|
function filemanagerutil.statusToString(status)
|
|
|
|
|
local status_to_text = {
|
|
|
|
|
new = _("Unread"),
|
|
|
|
|
reading = _("Reading"),
|
|
|
|
|
abandoned = _("On hold"),
|
|
|
|
|
complete = _("Finished"),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return status_to_text[status]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Generate all book status file dialog buttons in a row
|
|
|
|
|
function filemanagerutil.genStatusButtonsRow(file, caller_callback, current_status)
|
|
|
|
|
local status = current_status or filemanagerutil.getStatus(file)
|
|
|
|
|
local function genStatusButton(to_status)
|
|
|
|
|
return {
|
|
|
|
|
text = status_text[to_status] .. (status == to_status and " ✓" or ""),
|
|
|
|
|
text = filemanagerutil.statusToString(to_status) .. (status == to_status and " ✓" or ""),
|
|
|
|
|
id = to_status, -- used by covermenu
|
|
|
|
|
enabled = status ~= to_status,
|
|
|
|
|
callback = function()
|
|
|
|
|