hide certain directories in FileManager

The exclude pattern should be editable by users in the future.
This commit is contained in:
chrox
2013-02-19 21:30:35 +08:00
parent f542ffbf57
commit 905b315c81
2 changed files with 12 additions and 3 deletions

View File

@@ -78,6 +78,7 @@ function showReader(file, pass)
end
function showHomePage(path)
local exclude_dirs = {"%.sdr$"}
local FileManager = FileChooser:new{
title = "FileManager",
path = path,
@@ -85,7 +86,13 @@ function showHomePage(path)
height = Screen:getHeight(),
is_borderless = true,
has_close_button = false,
filter = function(filename)
dir_filter = function(dirname)
for _, pattern in ipairs(exclude_dirs) do
if dirname:match(pattern) then return end
end
return true
end,
file_filter = function(filename)
if DocumentRegistry:getProvider(filename) then
return true
end