|
|
@ -19,6 +19,7 @@ local IconButton = require("ui/widget/iconbutton")
|
|
|
|
local InfoMessage = require("ui/widget/infomessage")
|
|
|
|
local InfoMessage = require("ui/widget/infomessage")
|
|
|
|
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
|
|
local InputContainer = require("ui/widget/container/inputcontainer")
|
|
|
|
local InputDialog = require("ui/widget/inputdialog")
|
|
|
|
local InputDialog = require("ui/widget/inputdialog")
|
|
|
|
|
|
|
|
local MultiConfirmBox = require("ui/widget/multiconfirmbox")
|
|
|
|
local PluginLoader = require("pluginloader")
|
|
|
|
local PluginLoader = require("pluginloader")
|
|
|
|
local ReaderDictionary = require("apps/reader/modules/readerdictionary")
|
|
|
|
local ReaderDictionary = require("apps/reader/modules/readerdictionary")
|
|
|
|
local ReaderUI = require("apps/reader/readerui")
|
|
|
|
local ReaderUI = require("apps/reader/readerui")
|
|
|
@ -452,6 +453,15 @@ function FileManager:tapPlus()
|
|
|
|
UIManager:close(self.file_dialog)
|
|
|
|
UIManager:close(self.file_dialog)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
text = _("Open random document"),
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
self:openRandomFile(self.file_chooser.path)
|
|
|
|
|
|
|
|
UIManager:close(self.file_dialog)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -533,6 +543,30 @@ function FileManager:setHome(path)
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function FileManager:openRandomFile(dir)
|
|
|
|
|
|
|
|
local random_file = DocumentRegistry:getRandomFile(dir, false)
|
|
|
|
|
|
|
|
if random_file then
|
|
|
|
|
|
|
|
UIManager:show(MultiConfirmBox:new {
|
|
|
|
|
|
|
|
text = T(_("Do you want to open %1?"), util.basename(random_file)),
|
|
|
|
|
|
|
|
choice1_text = _("Open"),
|
|
|
|
|
|
|
|
choice1_callback = function()
|
|
|
|
|
|
|
|
FileManager.instance:onClose()
|
|
|
|
|
|
|
|
ReaderUI:showReader(random_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
choice2_text = _("Another"),
|
|
|
|
|
|
|
|
choice2_callback = function()
|
|
|
|
|
|
|
|
self:openRandomFile(dir)
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
UIManager:close(self.file_dialog)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
UIManager:show(InfoMessage:new {
|
|
|
|
|
|
|
|
text = _("File not found"),
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function FileManager:copyFile(file)
|
|
|
|
function FileManager:copyFile(file)
|
|
|
|
self.cutfile = false
|
|
|
|
self.cutfile = false
|
|
|
|
self.clipboard = file
|
|
|
|
self.clipboard = file
|
|
|
|