New startup option: Folder shortcuts (#4220)

This commit is contained in:
Robert
2018-09-12 21:42:24 +02:00
committed by poire-z
parent 1d34fcbb12
commit 192bc175fc
2 changed files with 17 additions and 0 deletions

View File

@@ -190,6 +190,21 @@ if ARGV[argidx] and ARGV[argidx] ~= "" then
UIManager:nextTick(function()
FileManagerHistory:onShowHist(last_file)
end)
elseif start_with == "folder_shortcuts" then
local FileManagerShortcuts = require("apps/filemanager/filemanagershortcuts")
local fm_bookmark = FileManagerShortcuts:new{
title = _("Folder shortcuts"),
show_parent = FileManager,
curr_path = home_dir,
goFolder = function(folder)
if folder ~= nil and lfs.attributes(folder, "mode") == "directory" then
FileManager.instance.file_chooser:changeToPath(folder)
end
end,
}
UIManager:nextTick(function()
UIManager:show(fm_bookmark)
end)
end
end
exit_code = UIManager:run()