mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
New startup option: Folder shortcuts (#4220)
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
}
|
||||
|
||||
15
reader.lua
15
reader.lua
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user