Support history as default view for filemanager (#3058)

Fixes #2774

* make history view borderless
* add new menu for what to start with

Should combine nicely with #2940
This commit is contained in:
Frans de Jonge
2017-08-14 13:15:12 +02:00
committed by GitHub
parent 5e402419ed
commit 23cd585fae
5 changed files with 50 additions and 19 deletions

View File

@@ -122,8 +122,9 @@ if fontmap ~= nil then
end
-- last file
local last_file = G_reader_settings:readSetting("lastfile")
local start_with = G_reader_settings:readSetting("start_with")
-- load last opened file
local open_last = G_reader_settings:readSetting("open_last")
local open_last = start_with == "last"
if open_last and last_file and lfs.attributes(last_file, "mode") ~= "file" then
UIManager:show(retryLastFile())
last_file = nil
@@ -165,6 +166,14 @@ if ARGV[argidx] and ARGV[argidx] ~= "" then
UIManager:nextTick(function()
FileManager:showFiles(home_dir)
end)
-- always open history on top of filemanager so closing history
-- doesn't result in exit
if start_with == "history" then
local FileManagerHistory = require("apps/filemanager/filemanagerhistory")
UIManager:nextTick(function()
FileManagerHistory:onShowHist(last_file)
end)
end
end
exit_code = UIManager:run()
elseif last_file then