New startup option: Folder shortcuts (#4220)

pull/4222/head
Robert 6 years ago committed by poire-z
parent 1d34fcbb12
commit 192bc175fc

@ -825,6 +825,7 @@ function FileManager:getStartWithMenuTable()
local start_withs = {
filemanager = {_("file browser"), _("Start with file browser")},
history = {_("history"), _("Start with history")},
folder_shortcuts = {_("folder shortcuts"), _("Start with folder shortcuts")},
last = {_("last file"), _("Start with last file")},
}
local set_sw_table = function(start_with)
@ -849,6 +850,7 @@ function FileManager:getStartWithMenuTable()
sub_item_table = {
set_sw_table("filemanager"),
set_sw_table("history"),
set_sw_table("folder_shortcuts"),
set_sw_table("last"),
}
}

@ -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()

Loading…
Cancel
Save