|
|
|
@ -363,16 +363,31 @@ function FileManager:init()
|
|
|
|
|
|
|
|
|
|
if Device:hasKeys() then
|
|
|
|
|
self.key_events.Home = { {"Home"}, doc = "go home" }
|
|
|
|
|
if not Device:isSDL() then
|
|
|
|
|
--if not in the desktop emulator
|
|
|
|
|
--remove the old Back key to exit koreader
|
|
|
|
|
self.file_chooser.key_events.Close = nil
|
|
|
|
|
end
|
|
|
|
|
--Override the menu.lua way of handling the back key
|
|
|
|
|
self.file_chooser.key_events.Back = { {"Back"}, doc = "go back" }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:handleEvent(Event:new("SetDimensions", self.dimen))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileChooser:onBack()
|
|
|
|
|
local back_to_exit = G_reader_settings:readSetting("back_to_exit") or "prompt"
|
|
|
|
|
if back_to_exit == "always" then
|
|
|
|
|
return self:onClose()
|
|
|
|
|
elseif back_to_exit == "disable" then
|
|
|
|
|
return true
|
|
|
|
|
elseif back_to_exit == "prompt" then
|
|
|
|
|
UIManager:show(ConfirmBox:new{
|
|
|
|
|
text = _("Exit KOReader?"),
|
|
|
|
|
ok_text = _("Exit"),
|
|
|
|
|
ok_callback = function()
|
|
|
|
|
self:onClose()
|
|
|
|
|
end
|
|
|
|
|
})
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileManager:tapPlus()
|
|
|
|
|
local buttons = {
|
|
|
|
|
{
|
|
|
|
|