def onClick(self, controlId):
if controlId == self.C_CAT_CATEGORY:
cList = self.getControl(self.C_CAT_CATEGORY)
item = cList.getSelectedItem()
if item:
self.selected_category = item.getLabel()
self.category = self.selected_category
self.buttonClicked = controlId
self.close()
elif controlId == 80005:
kodi = float(xbmc.getInfoLabel("System.BuildVersion")[:4])
dialog = xbmcgui.Dialog()
if kodi < 16:
dialog.ok('TV Guide Fullscreen', 'Editing categories in Kodi %s is currently not supported.' % kodi)
else:
cat = dialog.input('Add Category', type=xbmcgui.INPUT_ALPHANUM)
if cat:
categories = set(self.categories)
categories.add(cat)
self.categories = list(set(categories))
items = list()
categories = ["All Channels"] + list(self.categories)
for label in categories:
item = xbmcgui.ListItem(label)
items.append(item)
listControl = self.getControl(self.C_CAT_CATEGORY)
listControl.reset()
listControl.addItems(items)
else:
self.buttonClicked = controlId
self.close()
评论列表
文章目录