diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-06-17 16:48:40 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-06-17 16:48:40 +0000 |
| commit | ee0903f520403c5e03caef287f813e7b062d05ab (patch) | |
| tree | 947857d4c0ee13747b403a04f06f5078319e0c80 /lib/python/Components/Sources | |
| parent | 9c3098c8667241d18d2551a9a37ce7fbce396b71 (diff) | |
| download | enigma2-ee0903f520403c5e03caef287f813e7b062d05ab.tar.gz enigma2-ee0903f520403c5e03caef287f813e7b062d05ab.zip | |
add some new (currently unused) source/renderer based elements
Diffstat (limited to 'lib/python/Components/Sources')
| -rw-r--r-- | lib/python/Components/Sources/Clock.py | 7 | ||||
| -rw-r--r-- | lib/python/Components/Sources/EventInfo.py | 2 | ||||
| -rw-r--r-- | lib/python/Components/Sources/Makefile.am | 3 | ||||
| -rw-r--r-- | lib/python/Components/Sources/MenuList.py | 40 | ||||
| -rw-r--r-- | lib/python/Components/Sources/Source.py | 3 |
5 files changed, 46 insertions, 9 deletions
diff --git a/lib/python/Components/Sources/Clock.py b/lib/python/Components/Sources/Clock.py index f840ea24..608a7190 100644 --- a/lib/python/Components/Sources/Clock.py +++ b/lib/python/Components/Sources/Clock.py @@ -6,16 +6,11 @@ from Source import Source class Clock(Source): def __init__(self): - self.changed = Event(start=self.start, stop=self.stop) + Source.__init__(self) self.clock_timer = eTimer() self.clock_timer.timeout.get().append(self.changed) - - def start(self): self.clock_timer.start(1000) - def stop(self): - self.clock_timer.stop() - def getClock(self): return time.time() diff --git a/lib/python/Components/Sources/EventInfo.py b/lib/python/Components/Sources/EventInfo.py index 724d9c1f..fc420d83 100644 --- a/lib/python/Components/Sources/EventInfo.py +++ b/lib/python/Components/Sources/EventInfo.py @@ -8,7 +8,7 @@ class EventInfo(PerServiceBase, Source): NEXT = 1 def __init__(self, navcore, now_or_next): - self.changed = Event() + Source.__init__(self) PerServiceBase.__init__(self, navcore, { iPlayableService.evUpdatedEventInfo: self.ourEvent, diff --git a/lib/python/Components/Sources/Makefile.am b/lib/python/Components/Sources/Makefile.am index 3bf75d17..9e151123 100644 --- a/lib/python/Components/Sources/Makefile.am +++ b/lib/python/Components/Sources/Makefile.am @@ -1,4 +1,5 @@ installdir = $(LIBDIR)/enigma2/python/Components/Sources install_PYTHON = \ - __init__.py Clock.py EventInfo.py Source.py + __init__.py Clock.py EventInfo.py Source.py MenuList.py + diff --git a/lib/python/Components/Sources/MenuList.py b/lib/python/Components/Sources/MenuList.py new file mode 100644 index 00000000..98764418 --- /dev/null +++ b/lib/python/Components/Sources/MenuList.py @@ -0,0 +1,40 @@ +from Source import Source +from Tools.Event import Event + +class MenuList(Source, object): + def __init__(self, list = [ ], enableWrapAround = False): + Source.__init__(self) + self.__list = list + self.onSelectionChanged = [ ] + + def setList(self, list): + self.__list = list + self.changed() + + list = property(lambda self: self.__list, setList) + + def entry_changed(self, index): + self.downstream_elements.entry_changed(self, index) + + def selectionChanged(self, index): + for x in self.onSelectionChanged: + x() + + def getCurrent(self): + return self.master and self.master.current + + current = property(getCurrent) + + def setIndex(self, index): + if self.master is not None: + self.master = index + + def getIndex(self, index): + if self.master is not None: + return self.master.index + else: + return -1 + + setCurrentIndex = setIndex + + index = property(getIndex, setIndex) diff --git a/lib/python/Components/Sources/Source.py b/lib/python/Components/Sources/Source.py index 77fcb55f..49bbdbcf 100644 --- a/lib/python/Components/Sources/Source.py +++ b/lib/python/Components/Sources/Source.py @@ -1,5 +1,6 @@ -class Source(object): +from Components.Element import Element +class Source(Element): def execBegin(self): pass |
