Alterations to the menu

References #1219 and #1258.
pull/1261/head
Frans de Jonge 10 years ago
parent 7a608c7933
commit 141095b0c8

@ -78,7 +78,6 @@ end
function FileSearcher:init(search_path) function FileSearcher:init(search_path)
self.path = search_path or lfs.currentdir() self.path = search_path or lfs.currentdir()
--self.path = ('/home/frans/Dropbox')
self:showSearch() self:showSearch()
end end

@ -29,17 +29,8 @@ function FileManagerMenu:init()
tools = { tools = {
icon = "resources/icons/appbar.tools.png", icon = "resources/icons/appbar.tools.png",
}, },
opdscatalog = { search = {
icon = "resources/icons/appbar.magnify.browse.png", icon = "resources/icons/appbar.magnify.browse.png",
callback = function()
self:onCloseFileManagerMenu()
local OPDSCatalog = require("apps/opdscatalog/opdscatalog")
function OPDSCatalog:onExit()
DEBUG("refresh filemanager")
filemanager:onRefresh()
end
OPDSCatalog:showCatalog()
end,
}, },
home = { home = {
icon = "resources/icons/appbar.home.png", icon = "resources/icons/appbar.home.png",
@ -124,7 +115,7 @@ function FileManagerMenu:setUpdateItemTable()
-- tools tab -- tools tab
table.insert(self.tab_item_table.tools, { table.insert(self.tab_item_table.tools, {
text = _("Change defaults file"), text = _("Advanced settings"),
callback = function() callback = function()
SetDefaults:ConfirmEdit() SetDefaults:ConfirmEdit()
end, end,
@ -133,16 +124,32 @@ function FileManagerMenu:setUpdateItemTable()
end, end,
}) })
table.insert(self.tab_item_table.tools, { table.insert(self.tab_item_table.tools, {
text = _("Search books"), text = _("OPDS catalog"),
callback = function() callback = function()
Search:getCalibre() local OPDSCatalog = require("apps/opdscatalog/opdscatalog")
if Search.metafile_1 ~= nil then function OPDSCatalog:onExit()
Search:ShowSearch() DEBUG("refresh filemanager")
else -- fallback to filename search if no calibre metadata file filemanager:onRefresh()
FileSearcher:init()
end end
OPDSCatalog:showCatalog()
end,
})
-- search tab
table.insert(self.tab_item_table.search, {
text = _("Find a book in calibre catalog"),
callback = function()
Search:getCalibre()
Search:ShowSearch()
end
})
table.insert(self.tab_item_table.search, {
text = _("Find a file"),
callback = function()
FileSearcher:init(self.ui.file_chooser.path)
end end
}) })
-- home tab -- home tab
table.insert(self.tab_item_table.home, { table.insert(self.tab_item_table.home, {
text = _("Exit"), text = _("Exit"),
@ -172,7 +179,7 @@ function FileManagerMenu:onShowMenu()
self.tab_item_table.setting, self.tab_item_table.setting,
self.tab_item_table.info, self.tab_item_table.info,
self.tab_item_table.tools, self.tab_item_table.tools,
self.tab_item_table.opdscatalog, self.tab_item_table.search,
self.tab_item_table.home, self.tab_item_table.home,
}, },
show_parent = menu_container, show_parent = menu_container,

Loading…
Cancel
Save