|
|
@ -20,7 +20,6 @@ local FileChooser = Menu:extend{
|
|
|
|
path = lfs.currentdir(),
|
|
|
|
path = lfs.currentdir(),
|
|
|
|
parent = nil,
|
|
|
|
parent = nil,
|
|
|
|
show_hidden = nil,
|
|
|
|
show_hidden = nil,
|
|
|
|
filter = function(filename) return true end,
|
|
|
|
|
|
|
|
exclude_dirs = {"%.sdr$"},
|
|
|
|
exclude_dirs = {"%.sdr$"},
|
|
|
|
strcoll = strcoll,
|
|
|
|
strcoll = strcoll,
|
|
|
|
collate = "strcoll", -- or collate = "access",
|
|
|
|
collate = "strcoll", -- or collate = "access",
|
|
|
@ -33,7 +32,7 @@ function FileChooser:init()
|
|
|
|
-- common dir filter
|
|
|
|
-- common dir filter
|
|
|
|
self.dir_filter = function(dirname)
|
|
|
|
self.dir_filter = function(dirname)
|
|
|
|
for _, pattern in ipairs(self.exclude_dirs) do
|
|
|
|
for _, pattern in ipairs(self.exclude_dirs) do
|
|
|
|
if dirname:match(pattern) then return end
|
|
|
|
if dirname:match(pattern) then return false end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -161,6 +160,7 @@ function FileChooser:changeToPath(path)
|
|
|
|
path = util.realpath(path)
|
|
|
|
path = util.realpath(path)
|
|
|
|
self.path = path
|
|
|
|
self.path = path
|
|
|
|
self:refreshPath()
|
|
|
|
self:refreshPath()
|
|
|
|
|
|
|
|
self:onPathChanged(path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function FileChooser:toggleHiddenFiles()
|
|
|
|
function FileChooser:toggleHiddenFiles()
|
|
|
@ -203,4 +203,8 @@ function FileChooser:onFileHold(file)
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function FileChooser:onPathChanged(path)
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return FileChooser
|
|
|
|
return FileChooser
|
|
|
|