mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
OPDS catalog: add title Plus/Home button (#8660)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user