|
|
@ -148,7 +148,6 @@ local FileChooser = Menu:extend{
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
item_func = function(item)
|
|
|
|
item_func = function(item)
|
|
|
|
item.suffix = util.getFileNameSuffix(item.text)
|
|
|
|
item.suffix = util.getFileNameSuffix(item.text)
|
|
|
|
return item
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
percent_unopened_first = {
|
|
|
|
percent_unopened_first = {
|
|
|
@ -174,7 +173,6 @@ local FileChooser = Menu:extend{
|
|
|
|
percent_finished = doc_settings:readSetting("percent_finished")
|
|
|
|
percent_finished = doc_settings:readSetting("percent_finished")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
item.percent_finished = percent_finished or 0
|
|
|
|
item.percent_finished = percent_finished or 0
|
|
|
|
return item
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
mandatory_func = function(item)
|
|
|
|
mandatory_func = function(item)
|
|
|
|
return item.opened and string.format("%d %%", 100 * item.percent_finished) or "–"
|
|
|
|
return item.opened and string.format("%d %%", 100 * item.percent_finished) or "–"
|
|
|
@ -203,7 +201,6 @@ local FileChooser = Menu:extend{
|
|
|
|
percent_finished = doc_settings:readSetting("percent_finished")
|
|
|
|
percent_finished = doc_settings:readSetting("percent_finished")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
item.percent_finished = percent_finished or 0
|
|
|
|
item.percent_finished = percent_finished or 0
|
|
|
|
return item
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
mandatory_func = function(item)
|
|
|
|
mandatory_func = function(item)
|
|
|
|
return item.opened and string.format("%d %%", 100 * item.percent_finished) or "–"
|
|
|
|
return item.opened and string.format("%d %%", 100 * item.percent_finished) or "–"
|
|
|
@ -269,7 +266,7 @@ function FileChooser:getList(path, collate)
|
|
|
|
else -- error, probably "permission denied"
|
|
|
|
else -- error, probably "permission denied"
|
|
|
|
if unreadable_dir_content[path] then
|
|
|
|
if unreadable_dir_content[path] then
|
|
|
|
-- Add this dummy item that will be replaced with a message by genItemTable()
|
|
|
|
-- Add this dummy item that will be replaced with a message by genItemTable()
|
|
|
|
table.insert(dirs, FileChooser.getListItem(path, "./.", path, lfs.attributes(path)))
|
|
|
|
table.insert(dirs, FileChooser:getListItem(path, "./.", path, lfs.attributes(path)), collate)
|
|
|
|
-- If we knew about some content (if we had come up from them
|
|
|
|
-- If we knew about some content (if we had come up from them
|
|
|
|
-- to this directory), have them shown
|
|
|
|
-- to this directory), have them shown
|
|
|
|
for k, v in pairs(unreadable_dir_content[path]) do
|
|
|
|
for k, v in pairs(unreadable_dir_content[path]) do
|
|
|
@ -307,7 +304,7 @@ function FileChooser:getListItem(dirpath, f, fullpath, attributes, collate)
|
|
|
|
item.dim = self.filemanager and self.filemanager.selected_files
|
|
|
|
item.dim = self.filemanager and self.filemanager.selected_files
|
|
|
|
and self.filemanager.selected_files[item.path]
|
|
|
|
and self.filemanager.selected_files[item.path]
|
|
|
|
if collate.item_func ~= nil then
|
|
|
|
if collate.item_func ~= nil then
|
|
|
|
item = collate.item_func(item)
|
|
|
|
collate.item_func(item)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
item.mandatory = self:getMenuItemMandatory(item, collate)
|
|
|
|
item.mandatory = self:getMenuItemMandatory(item, collate)
|
|
|
|
else -- folder
|
|
|
|
else -- folder
|
|
|
@ -317,7 +314,7 @@ function FileChooser:getListItem(dirpath, f, fullpath, attributes, collate)
|
|
|
|
item.text = item.text.."/"
|
|
|
|
item.text = item.text.."/"
|
|
|
|
item.bidi_wrap_func = BD.directory
|
|
|
|
item.bidi_wrap_func = BD.directory
|
|
|
|
if collate.can_collate_mixed and collate.item_func ~= nil then
|
|
|
|
if collate.can_collate_mixed and collate.item_func ~= nil then
|
|
|
|
item = collate.item_func(item)
|
|
|
|
collate.item_func(item)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if dirpath then -- file browser or PathChooser
|
|
|
|
if dirpath then -- file browser or PathChooser
|
|
|
|
item.mandatory = self:getMenuItemMandatory(item)
|
|
|
|
item.mandatory = self:getMenuItemMandatory(item)
|
|
|
|