diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-07-29 01:09:09 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-07-29 01:09:09 +0000 |
| commit | d5e22a275d2ecdf3205bfefa927be6e125ac27b8 (patch) | |
| tree | 91b5fda2f2dacce923ec56ea52fecad6f94de873 /lib/python | |
| parent | 1d9b83e416ec6471e53844c80626dbf22a411e90 (diff) | |
| download | enigma2-d5e22a275d2ecdf3205bfefa927be6e125ac27b8.tar.gz enigma2-d5e22a275d2ecdf3205bfefa927be6e125ac27b8.zip | |
- add movie selector
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Components/MovieList.py | 89 | ||||
| -rw-r--r-- | lib/python/Components/__init__.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 8 | ||||
| -rw-r--r-- | lib/python/Screens/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Screens/MovieSelection.py | 29 | ||||
| -rw-r--r-- | lib/python/Screens/__init__.py | 4 |
7 files changed, 129 insertions, 7 deletions
diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index d9b3890e..7d35f561 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -6,4 +6,4 @@ install_DATA = \ Clock.py HTMLSkin.py ServiceList.py VariableText.py \ ConfigList.py Header.py ServiceName.py VariableValue.py \ EventInfo.py Label.py ServiceScan.py VolumeBar.py \ - GUIComponent.py MenuList.py TextInput.py __init__.py + GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py new file mode 100644 index 00000000..4144353e --- /dev/null +++ b/lib/python/Components/MovieList.py @@ -0,0 +1,89 @@ +from HTMLComponent import * +from GUIComponent import * + +from enigma import eListboxPythonMultiContent, eListbox, gFont + +from enigma import eServiceReference, eServiceCenter, \ + eServiceCenterPtr, iListableServicePtr, \ + iStaticServiceInformationPtr + + + +RT_HALIGN_LEFT = 0 +RT_HALIGN_RIGHT = 1 +RT_HALIGN_CENTER = 2 +RT_HALIGN_BLOCK = 4 + +RT_VALIGN_TOP = 0 +RT_VALIGN_CENTER = 8 +RT_VALIGN_BOTTOM = 16 + +RT_WRAP = 32 + + +# +# | name of movie | +# +def MovieListEntry(serviceref, serviceHandler): + res = [ serviceref ] + + info = iStaticServiceInformationPtr() + + if serviceHandler.info(serviceref, info): + # ignore service which refuse to info + del info + return + + res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref))) + res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "Toller Film")) + res.append((0, 50, 200, 20, 1, RT_HALIGN_LEFT, "Aufgenommen: irgendwann")) + res.append((200, 50, 200, 20, 1, RT_HALIGN_RIGHT, "1232MB")) + + return res + +class MovieList(HTMLComponent, GUIComponent): + def __init__(self, root): + GUIComponent.__init__(self) + self.l = eListboxPythonMultiContent() + self.load(root) + self.l.setList(self.list) + self.l.setFont(0, gFont("Arial", 30)) + self.l.setFont(1, gFont("Arial", 18)) + + def getCurrent(self): + return self.l.getCurrentSelection() + + def GUIcreate(self, parent): + self.instance = eListbox(parent) + self.instance.setContent(self.l) + self.instance.setItemHeight(75) + + def GUIdelete(self): + self.instance.setContent(None) + self.instance = None + + def load(self, root): + # this lists our root service, then building a + # nice list + + self.list = [ ] + + serviceHandler = eServiceCenterPtr() + eServiceCenter.getInstance(serviceHandler) + list = iListableServicePtr() + + if serviceHandler.list(root, list): + raise "listing of movies failed" + + movieList = [ ] + while 1: + s = eServiceReference() + if list.getNext(s): + del s + del list + break + movieList.append(s) + + # now process them... + for ref in movieList: + self.list.append(MovieListEntry(ref, serviceHandler)) diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py index d7cd406b..9f15abd4 100644 --- a/lib/python/Components/__init__.py +++ b/lib/python/Components/__init__.py @@ -3,5 +3,5 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo", "GUIComponent", "GUISkin", "HTMLComponent", "HTMLSkin", "Header", "Label", "MenuList", "PerServiceDisplay", "ProgressBar", "ServiceList", "ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar", - "components", "config", "TimerList", "TimeInput" ] + "components", "config", "TimerList", "TimeInput", "MovieList" ] diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index f89eba0f..be6b65c9 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -7,6 +7,7 @@ from Components.ServiceName import ServiceName from Components.EventInfo import EventInfo from Screens.MessageBox import MessageBox +from Screens.MovieSelection import MovieSelection from enigma import * @@ -31,7 +32,8 @@ class InfoBar(Screen): "zapDown": self.zapDown, "instantRecord": self.instantRecord, "hide": self.hide, - "toggleShow": self.toggleShow + "toggleShow": self.toggleShow, + "showMovies": self.showMovies, }) # self["okbutton"] = Button("mainMenu", [self.mainMenu]) @@ -100,4 +102,6 @@ class InfoBar(Screen): epg = ev # fix me, description. self.recording = self.session.nav.recordWithTimer(time.time(), time.time() + 30, serviceref, epg, "instant record") - + + def showMovies(self): + self.session.open(MovieSelection) diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index e9eeec29..0da3f515 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -3,4 +3,4 @@ installdir = $(LIBDIR)/enigma2/python/Screens install_DATA = \ ChannelSelection.py ClockDisplay.py ConfigMenu.py InfoBar.py Menu.py \ MessageBox.py ScartLoopThrough.py Screen.py ServiceScan.py TimerEdit.py \ - __init__.py + MovieSelection.py __init__.py diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py new file mode 100644 index 00000000..f5f26528 --- /dev/null +++ b/lib/python/Screens/MovieSelection.py @@ -0,0 +1,29 @@ +from Screen import Screen +from Components.Button import Button +from Components.ServiceList import ServiceList +from Components.ActionMap import ActionMap +from Components.MovieList import MovieList + +from enigma import eServiceReference + +class MovieSelection(Screen): + def __init__(self, session): + Screen.__init__(self, session) + + self.movemode = False + self.bouquet_mark_edit = False + + self["list"] = MovieList(eServiceReference("2:0:1:0:0:0:0:0:0:0:/")) + + #self["okbutton"] = Button("ok", [self.channelSelected]) + + self["actions"] = ActionMap(["OkCancelActions"], + { + "cancel": self.close, + "ok": self.movieSelected, + }) + self["actions"].csel = self + + def movieSelected(self): +# self.session.nav.playService(self["list"].getCurrent()) + self.close() diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py index c91f5f57..d24aa003 100644 --- a/lib/python/Screens/__init__.py +++ b/lib/python/Screens/__init__.py @@ -1,4 +1,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu", - "InfoBar", "MessageBox", "Menu", "ScartLoopThrough", "Screen", "ServiceScan", + "InfoBar", "MessageBox", "Menu", "MovieSelection", + "ScartLoopThrough", "Screen", "ServiceScan", "TimerEdit"] - |
