From 334a913b0ee9dfad403e27d159e0a75d16a0785a Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:54:55 +0200 Subject: [PATCH] OPDS catalog: add title Plus/Home button (#8660) --- plugins/opds.koplugin/opdsbrowser.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/opds.koplugin/opdsbrowser.lua b/plugins/opds.koplugin/opdsbrowser.lua index bba768a11..c37557e64 100644 --- a/plugins/opds.koplugin/opdsbrowser.lua +++ b/plugins/opds.koplugin/opdsbrowser.lua @@ -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