OPDS catalog: add title Plus/Home button (#8660)

reviewable/pr8669/r1
hius07 2 years ago committed by GitHub
parent 5c39c19a73
commit 334a913b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -80,6 +80,10 @@ local OPDSBrowser = Menu:extend{
function OPDSBrowser:init()
self.item_table = self:genItemTableFromRoot()
self.catalog_title = nil
self.title_bar_left_icon = "plus"
self.onLeftButtonTap = function()
self:addNewCatalog()
end
Menu.init(self) -- call parent's init()
end
@ -265,14 +269,6 @@ function OPDSBrowser:genItemTableFromRoot()
searchable = false,
})
end
-- Show the user a list item that would let them add more items
-- to their OPDS server list.
table.insert(item_table, {
text = _("Add new OPDS catalog"),
callback = function()
self:addNewCatalog()
end,
})
return item_table
end
@ -574,6 +570,10 @@ function OPDSBrowser:updateCatalog(item_url, username, password)
local menu_table = self:genItemTableFromURL(item_url, username, password)
if #menu_table > 0 then
self:switchItemTable(self.catalog_title, menu_table)
self:setTitleBarLeftIcon("home")
self.onLeftButtonTap = function()
self:init()
end
if self.page_num <= 1 then
self:onNext()
end

Loading…
Cancel
Save