Add path in file manager

pull/2129/head
Hzj_jie 8 years ago
parent ef260f053a
commit 493ff00609

@ -63,6 +63,10 @@ function FileManager:init()
face = Font:getFace("tfont", 24),
text = self.title,
},
TextWidget:new{
face = Font:getFace("infofont", 18),
text = self.root_path,
},
VerticalSpan:new{ width = Screen:scaleBySize(10) }
}
@ -88,6 +92,11 @@ function FileManager:init()
}
self.file_chooser = file_chooser
function file_chooser:onPathChanged(path) -- luacheck: ignore
FileManager.instance.banner[2].text = path
return true
end
function file_chooser:onFileSelect(file) -- luacheck: ignore
FileManager.instance:onClose()
local ReaderUI = require("apps/reader/readerui")

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

Loading…
Cancel
Save