|
|
@ -79,39 +79,25 @@ function FileManagerHistory:addToMainMenu(tab_item_table)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function FileManagerHistory:updateItemTable()
|
|
|
|
function FileManagerHistory:updateItemTable()
|
|
|
|
function readHistDir(re)
|
|
|
|
self.hist = {}
|
|
|
|
local sorted_files = {}
|
|
|
|
|
|
|
|
for f in lfs.dir(history_dir) do
|
|
|
|
for f in lfs.dir(history_dir) do
|
|
|
|
local path = history_dir..f
|
|
|
|
local path = history_dir..f
|
|
|
|
if lfs.attributes(path, "mode") == "file" then
|
|
|
|
if lfs.attributes(path, "mode") == "file" then
|
|
|
|
table.insert(sorted_files, {
|
|
|
|
local name = DocSettings:getNameFromHistory(f)
|
|
|
|
file = f,
|
|
|
|
table.insert(self.hist, {
|
|
|
|
date = lfs.attributes(path, "modification")
|
|
|
|
date = lfs.attributes(path, "modification"),
|
|
|
|
})
|
|
|
|
text = name,
|
|
|
|
end
|
|
|
|
histfile = f,
|
|
|
|
end
|
|
|
|
callback = function()
|
|
|
|
table.sort(sorted_files, function(v1,v2) return v1.date > v2.date end)
|
|
|
|
ReaderUI:showReader(
|
|
|
|
for _, v in pairs(sorted_files) do
|
|
|
|
DocSettings:getPathFromHistory(f).. "/" .. name)
|
|
|
|
table.insert(re, {
|
|
|
|
end
|
|
|
|
dir = DocSettings:getPathFromHistory(v.file),
|
|
|
|
|
|
|
|
name = DocSettings:getNameFromHistory(v.file),
|
|
|
|
|
|
|
|
histfile = v.file,
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
table.sort(self.hist, function(v1, v2) return v1.date > v2.date end)
|
|
|
|
|
|
|
|
|
|
|
|
self.hist = {}
|
|
|
|
|
|
|
|
local last_files = {}
|
|
|
|
|
|
|
|
readHistDir(last_files)
|
|
|
|
|
|
|
|
for _,v in pairs(last_files) do
|
|
|
|
|
|
|
|
table.insert(self.hist, {
|
|
|
|
|
|
|
|
text = v.name,
|
|
|
|
|
|
|
|
histfile = v.histfile,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
ReaderUI:showReader(v.dir .. "/" .. v.name)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
self.hist_menu:swithItemTable(self.hist_menu_title, self.hist)
|
|
|
|
self.hist_menu:swithItemTable(self.hist_menu_title, self.hist)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|