diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2010-02-25 13:44:03 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2010-02-25 13:44:03 +0100 |
| commit | 7f8ef60cd4d75bb4a453403747614700b290fab8 (patch) | |
| tree | 431fa88b21dd57be115effed9b54abc9de125248 /lib/python | |
| parent | c9656234fc321dcd39b03921bab54b8848a507a6 (diff) | |
| download | enigma2-7f8ef60cd4d75bb4a453403747614700b290fab8.tar.gz enigma2-7f8ef60cd4d75bb4a453403747614700b290fab8.zip | |
lib/python/Screens/ChannelSelection.py: [PATCH 1/3] implement a non-visual bouquet selector for bouq +/- keys
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/ChannelSelection.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 4ca6fa39..33afb3f3 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -66,6 +66,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 |
