|
|
|
@ -812,10 +812,11 @@ Tap a book in the search results to open it.]]),
|
|
|
|
|
for id, common_setting in pairs(dofile("frontend/ui/elements/common_info_menu_table.lua")) do
|
|
|
|
|
self.menu_items[id] = common_setting
|
|
|
|
|
end
|
|
|
|
|
-- insert common exit for filemanager
|
|
|
|
|
-- insert common exit
|
|
|
|
|
for id, common_setting in pairs(dofile("frontend/ui/elements/common_exit_menu_table.lua")) do
|
|
|
|
|
self.menu_items[id] = common_setting
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not Device:isTouchDevice() then
|
|
|
|
|
-- add a shortcut on non touch-device
|
|
|
|
|
-- because this menu is not accessible otherwise
|
|
|
|
@ -924,20 +925,14 @@ function FileManagerMenu:exitOrRestart(callback, force)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileManagerMenu:onShowMenu(tab_index)
|
|
|
|
|
function FileManagerMenu:genMenu(tab_index)
|
|
|
|
|
if self.tab_item_table == nil then
|
|
|
|
|
self:setUpdateItemTable()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not tab_index then
|
|
|
|
|
if tab_index == nil then
|
|
|
|
|
tab_index = G_reader_settings:readSetting("filemanagermenu_tab_index") or 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local menu_container = CenterContainer:new{
|
|
|
|
|
ignore = "height",
|
|
|
|
|
dimen = Screen:getSize(),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local main_menu
|
|
|
|
|
if Device:isTouchDevice() or Device:hasDPad() then
|
|
|
|
|
local TouchMenu = require("ui/widget/touchmenu")
|
|
|
|
@ -945,7 +940,6 @@ function FileManagerMenu:onShowMenu(tab_index)
|
|
|
|
|
width = Screen:getWidth(),
|
|
|
|
|
last_index = tab_index,
|
|
|
|
|
tab_item_table = self.tab_item_table,
|
|
|
|
|
show_parent = menu_container,
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
local Menu = require("ui/widget/menu")
|
|
|
|
@ -953,14 +947,23 @@ function FileManagerMenu:onShowMenu(tab_index)
|
|
|
|
|
title = _("File manager menu"),
|
|
|
|
|
item_table = Menu.itemTableFromTouchMenu(self.tab_item_table),
|
|
|
|
|
width = Screen:getWidth() - (Size.margin.fullscreen_popout * 2),
|
|
|
|
|
show_parent = menu_container,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
main_menu.close_callback = function()
|
|
|
|
|
self:onCloseFileManagerMenu()
|
|
|
|
|
end
|
|
|
|
|
return main_menu
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileManagerMenu:onShowMenu(tab_index, main_menu)
|
|
|
|
|
if main_menu == nil then
|
|
|
|
|
main_menu = self:genMenu(tab_index)
|
|
|
|
|
end
|
|
|
|
|
local menu_container = CenterContainer:new{
|
|
|
|
|
ignore = "height",
|
|
|
|
|
dimen = Screen:getSize(),
|
|
|
|
|
}
|
|
|
|
|
main_menu.show_parent = menu_container
|
|
|
|
|
menu_container[1] = main_menu
|
|
|
|
|
-- maintain a reference to menu_container
|
|
|
|
|
self.menu_container = menu_container
|
|
|
|
@ -1022,8 +1025,8 @@ function FileManagerMenu:onSetDimensions(dimen)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileManagerMenu:onMenuSearch()
|
|
|
|
|
self:onShowMenu()
|
|
|
|
|
self.menu_container[1]:onShowMenuSearch()
|
|
|
|
|
local main_menu = self:genMenu()
|
|
|
|
|
main_menu:onShowMenuSearch()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function FileManagerMenu:registerToMainMenu(widget)
|
|
|
|
|