Skip to content

Commit

Permalink
[MenuList]
Browse files Browse the repository at this point in the history
* partialy revert aa2c1a7

[ServiceScan]
* revert 5717df8

This is needed because some subclasses of MenuList uses self.list.
  • Loading branch information
jbleyel committed Jun 23, 2023
1 parent 5717df8 commit fc611b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
14 changes: 6 additions & 8 deletions lib/python/Components/MenuList.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class MenuList(GUIComponent):

def __init__(self, menuList, enableWrapAround=None, content=eListboxPythonStringContent): # enableWrapAround is deprecated as this is now controllable in the skin and windowstyle.
GUIComponent.__init__(self)
self.menuList = menuList
self.list = menuList
self.l = content()
self.l.setList(self.menuList)
self.l.setList(self.list)
self.onSelectionChanged = []

def postWidgetCreate(self, instance):
Expand All @@ -30,16 +30,14 @@ def selectionEnabled(self, enabled):
self.instance.setSelectionEnable(enabled)

def getList(self):
return self.menuList
return self.list

def setList(self, menuList):
self.menuList = menuList
self.l.setList(self.menuList)

list = property(getList, setList)
self.list = menuList
self.l.setList(self.list)

def count(self):
return len(self.menuList)
return len(self.list)

def selectionChanged(self):
for callback in self.onSelectionChanged:
Expand Down
16 changes: 8 additions & 8 deletions lib/python/Screens/ServiceScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
class FIFOList(MenuList):
def __init__(self, len=10):
self.len = len
self.menuList = []
MenuList.__init__(self, self.menuList)
self.list = []
MenuList.__init__(self, self.list)

def addItem(self, item):
self.menuList.append(item)
self.l.setList(self.menuList[-self.len:])
self.list.append(item)
self.l.setList(self.list[-self.len:])

def clear(self):
del self.menuList[:]
self.l.setList(self.menuList)
del self.list[:]
self.l.setList(self.list)

def getCurrentSelection(self):
return self.menuList and self.getCurrent() or None
return self.list and self.getCurrent() or None

def listAll(self):
self.l.setList(self.menuList)
self.l.setList(self.list)
self.selectionEnabled(True)


Expand Down

0 comments on commit fc611b6

Please sign in to comment.