Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New startup option - Folder shortcuts #4220

Merged
merged 1 commit into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/apps/filemanager/filemanager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"),
}
}
Expand Down
15 changes: 15 additions & 0 deletions reader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down