mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add hidden file toggle
This commit is contained in:
@@ -46,6 +46,7 @@ function FileManager:init()
|
||||
end
|
||||
end
|
||||
}
|
||||
self.file_chooser = file_chooser
|
||||
|
||||
function file_chooser:onFileSelect(file)
|
||||
showReaderUI(file)
|
||||
@@ -78,6 +79,9 @@ function FileManager:init()
|
||||
self:handleEvent(Event:new("SetDimensions", self.dimen))
|
||||
end
|
||||
|
||||
function FileManager:toggleHiddenFiles()
|
||||
self.file_chooser:toggleHiddenFiles()
|
||||
end
|
||||
|
||||
function FileManager:onClose()
|
||||
UIManager:close(self)
|
||||
|
||||
@@ -49,9 +49,17 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
widget:addToMainMenu(self.tab_item_table)
|
||||
end
|
||||
|
||||
table.insert(self.tab_item_table.main, {
|
||||
text = _("Toggle hidden files"),
|
||||
callback = function()
|
||||
self.ui:toggleHiddenFiles()
|
||||
end
|
||||
})
|
||||
|
||||
if Device:getFrontlight() ~= nil then
|
||||
ReaderFrontLight:addToMainMenu(self.tab_item_table)
|
||||
end
|
||||
|
||||
table.insert(self.tab_item_table.main, {
|
||||
text = _("Help"),
|
||||
callback = function()
|
||||
|
||||
@@ -55,6 +55,11 @@ function FileChooser:changeToPath(path)
|
||||
self:swithItemTable(nil, self:genItemTableFromPath(path))
|
||||
end
|
||||
|
||||
function FileChooser:toggleHiddenFiles()
|
||||
self.show_hidden = not self.show_hidden
|
||||
self:swithItemTable(nil, self:genItemTableFromPath(self.path))
|
||||
end
|
||||
|
||||
function FileChooser:onMenuSelect(item)
|
||||
if lfs.attributes(item.path, "mode") == "directory" then
|
||||
self:changeToPath(item.path)
|
||||
|
||||
Reference in New Issue
Block a user