mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Adds Folder shortcuts to Plus menu (#4165)
This commit is contained in:
@@ -12,6 +12,7 @@ local FileManagerBookInfo = require("apps/filemanager/filemanagerbookinfo")
|
||||
local FileManagerConverter = require("apps/filemanager/filemanagerconverter")
|
||||
local FileManagerHistory = require("apps/filemanager/filemanagerhistory")
|
||||
local FileManagerMenu = require("apps/filemanager/filemanagermenu")
|
||||
local FileManagerShortcuts = require("apps/filemanager/filemanagershortcuts")
|
||||
local Font = require("ui/font")
|
||||
local FrameContainer = require("ui/widget/container/framecontainer")
|
||||
local HorizontalGroup = require("ui/widget/horizontalgroup")
|
||||
@@ -454,6 +455,25 @@ function FileManager:tapPlus()
|
||||
UIManager:close(self.file_dialog)
|
||||
end
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
text = _("Folder shortcuts"),
|
||||
callback = function()
|
||||
local fm_bookmark = FileManagerShortcuts:new{
|
||||
title = _("Folder shortcuts"),
|
||||
show_parent = self,
|
||||
curr_path = self.file_chooser.path,
|
||||
goFolder = function(folder)
|
||||
if folder ~= nil and lfs.attributes(folder, "mode") == "directory" then
|
||||
self.file_chooser:changeToPath(folder)
|
||||
end
|
||||
end,
|
||||
}
|
||||
UIManager:show(fm_bookmark)
|
||||
UIManager:close(self.file_dialog)
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user