mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #1242 from chrox/fix_1236
fix #1236 by opening the parent directory of last used document
This commit is contained in:
@@ -45,7 +45,12 @@ function ReaderMenu:init()
|
||||
local FileManager = require("apps/filemanager/filemanager")
|
||||
FileManager:restoreScreenMode()
|
||||
if not FileManager.is_running then
|
||||
FileManager:showFiles()
|
||||
local lastdir = nil
|
||||
local last_file = G_reader_settings:readSetting("lastfile")
|
||||
if last_file then
|
||||
lastdir = last_file:match("(.*)/")
|
||||
end
|
||||
FileManager:showFiles(lastdir)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local PathChooser = require("ui/widget/pathchooser")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local Screen = require("device").screen
|
||||
local util = require("ffi/util")
|
||||
local _ = require("gettext")
|
||||
|
||||
@@ -20,6 +21,7 @@ function DownloadMgr:chooseDir()
|
||||
local download_dir = G_reader_settings:readSetting("download_dir")
|
||||
local path_chooser = PathChooser:new{
|
||||
title = self.title,
|
||||
height = Screen:getHeight(),
|
||||
path = download_dir and (download_dir .. "/..") or lastdir,
|
||||
show_hidden = G_reader_settings:readSetting("show_hidden"),
|
||||
onConfirm = function(path)
|
||||
|
||||
@@ -31,7 +31,6 @@ local FileChooser = Menu:extend{
|
||||
|
||||
function FileChooser:init()
|
||||
self.width = Screen:getWidth()
|
||||
self.height = Screen:getHeight()
|
||||
-- common dir filter
|
||||
self.dir_filter = function(dirname)
|
||||
for _, pattern in ipairs(self.exclude_dirs) do
|
||||
|
||||
Reference in New Issue
Block a user