Merge pull request #1261 from Frenzie/filesearcher

Alterations to the menu
This commit is contained in:
Huang Xin
2014-11-27 07:47:31 +08:00
2 changed files with 25 additions and 19 deletions

View File

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

View File

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