X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FChannelSelection.py;h=912d67843dadfd08e2142dd237594ba5b7797175;hp=c07e34954e4955bc1922e11d764475e460ce5286;hb=b72c9852440926ac82fd4ca3186278edd7167427;hpb=c4d7f98e70694e471409cda6de03d0f3b5816f27 diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py old mode 100644 new mode 100755 index c07e349..912d678 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -65,6 +65,24 @@ class BouquetSelector(Screen): def cancelClick(self): self.close(False) +class SilentBouquetSelector: + def __init__(self, bouquets, enableWrapAround=False, current=0): + self.bouquets = [b[1] for b in bouquets] + self.pos = current + self.count = len(bouquets) + self.enableWrapAround = enableWrapAround + + def up(self): + if self.pos > 0 or self.enableWrapAround: + self.pos = (self.pos - 1) % self.count + + def down(self): + if self.pos < (self.count - 1) or self.enableWrapAround: + self.pos = (self.pos + 1) % self.count + + def getCurrent(self): + return self.bouquets[self.pos] + # csel.bouquet_mark_edit values OFF = 0 EDIT_BOUQUET = 1