The LEFT/RIGHT buttons are by default correctly bound to pageDown/pageUp in the native bindings for the screen's Renderer's eListbox instance.
The native key rebindings bind DOWN/UP to pageDown/pageUp in the eListbox.
I wanted to change that so that DOWN/UP were instead bound to the source's Sources.List.pageDown()/pageUp(). That can be done easily, simply by raising the ActionMap's priority (lowering the prio parameter value).
However, Sources.List.pageDown()/pageUp() don't actually do the function implied by their names. They simply move the selection point down and up by 10 entries, no matter what the displayed page length is (19 lines in the case of the About screens), and unlike the native pageDown/pageUp in eListbox, the "page"Up/Down in Sources.List wrap around when they are asked to "page" off the top or bottom, unlike the pagination operations on eListbox. The pageDown()/pageUp() wraparound is also implemented whether the class's self.enableWraparound is True or not.
The methods should really have the same pagination behaviour as eListbox, and implement it by having methods that are finally executed by pageUp/pageDown operations on the eListBox.
That would mean adding pageUp()/pageDown() methods to List converters like Converters.StringList.
A further bug in Converters.List is that it has two separate attributes for storing the "selectionEnabled" state: self.__selectionEnabled, which is initialised in __init__() and returned in the self.selectionEnabled property getter, and self.__selection_enabled which is updated in setSelectionEnabled() (which is the self.selectionEnabled property setter).
That means that the self.selectionEnabled property will always return False, no matter what the actual selectionEnabled state is.
There also seems to be some dead code in Converters.StringList. It implements getIndex()/setIndex() and the index property twice, the second of each overriding the first.
To test the pagination bugs in the Sources.List code, make the changes below in Screens.About.py. They leave the key bindings in place for DOWN/UP, LEFT/RIGHT and add ActionMap key bindings for CH+/- that call the List.pageDown/pageUp() methods. When the changes are in place and MENU>Information>Devices shows more than one page of information, the first press of CH+ on entering the screen appears too do nothing, the second press pages. Further presses of CH+ will eventually result in wraparound. The number needed is determined by the length of the list.
Code: Select all
diff --git a/lib/python/Screens/About.py b/lib/python/Screens/About.py
index 89c0276..f13760f 100644
--- a/lib/python/Screens/About.py
+++ b/lib/python/Screens/About.py
@@ -30,10 +30,12 @@ class AboutBase(Screen):
self.setBindings()
self["actions"] = ActionMap(
- ["SetupActions", "ColorActions"],
+ ["SetupActions", "DirectionActions"],
{
"cancel": self.close,
"ok": self.close,
+ "chplus": self.pageUp,
+ "chminus": self.pageDown,
})
@staticmethod
@@ -82,6 +84,14 @@ class AboutBase(Screen):
l[AboutBase.ENT_HEADINFOLABEL:AboutBase.ENT_HEADINFO + 1] = label, info
return tuple(l)
+ def pageUp(self):
+ if "list" in self:
+ self["list"].pageUp()
+
+ def pageDown(self):
+ if "list" in self:
+ self["list"].pageDown()
+
def setBindings(self):
actionMap = eActionMap.getInstance()
actionMap.unbindNativeKey("ListboxActions", eListbox.moveUp)