diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-07-08 16:41:35 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-07-08 16:41:35 +0000 |
| commit | 98c4b5bb004e9297bffa8e1c3572572741fda933 (patch) | |
| tree | fcd68e1dc4f97d0778348ae54e637368a80186ae /lib/python/Screens | |
| parent | db493da3936b21410730a1c299b4c6937d56ca4e (diff) | |
| download | enigma2-98c4b5bb004e9297bffa8e1c3572572741fda933.tar.gz enigma2-98c4b5bb004e9297bffa8e1c3572572741fda933.zip | |
- skins are now loaded first and applied later
- this allows use skin information to build special eWidgets, depending on skin
- add "applet"-feature: code which is executed from skin
- example: centering of messagebox
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 7 | ||||
| -rw-r--r-- | lib/python/Screens/Menu.py | 12 | ||||
| -rw-r--r-- | lib/python/Screens/MessageBox.py | 15 | ||||
| -rw-r--r-- | lib/python/Screens/__init__.py | 2 |
4 files changed, 26 insertions, 10 deletions
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 5112a00d..ee09e577 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -6,6 +6,8 @@ from Components.Button import Button from Components.ServiceName import ServiceName from Components.EventInfo import EventInfo +from Screens.MessageBox import MessageBox + from enigma import * import time @@ -31,7 +33,7 @@ class InfoBar(Screen): "hide": self.hide, "toggleShow": self.toggleShow }) - self["okbutton"] = Button("mainMenu", [self.mainMenu]) +# self["okbutton"] = Button("mainMenu", [self.mainMenu]) self["CurrentTime"] = Clock() @@ -77,6 +79,9 @@ class InfoBar(Screen): self.servicelist.zap() def instantRecord(self): + self.session.open(MessageBox, "this would be an instant recording! do you really know what you're doing?!") + return + if self.recording != None: print "remove entry" self.session.nav.RecordTimer.removeEntry(self.recording) diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index c3809318..3b54577e 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -19,6 +19,8 @@ import xml.dom.minidom from xml.dom import EMPTY_NAMESPACE from skin import elementsWithTag +from Tools import XMLTools + # some screens def doGlobal(screen): screen["clock"] = Clock() @@ -74,13 +76,6 @@ mdom = xml.dom.minidom.parseString( </menu> </menu>""") -def getText(nodelist): - rc = "" - for node in nodelist: - if node.nodeType == node.TEXT_NODE: - rc = rc + node.data - return rc - def getValbyAttr(x, attr): for p in range(x.attributes.length): a = x.attributes.item(p) @@ -159,6 +154,7 @@ class Menu(Screen): self.session.open(clockDisplay, Clock()) def okbuttonClick(self): + print "okbuttonClick" selection = self["menu"].getCurrent() selection[1]() @@ -178,7 +174,7 @@ class Menu(Screen): def addItem(self, destList, node): ItemText = getValbyAttr(node, "text") if ItemText != "": #check for name - b = getText(node.childNodes) + b = XMLTools.mergeText(node.childNodes) if b != "": #check for function destList.append((ItemText,boundFunction(self.evalText,b))) else: diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py new file mode 100644 index 00000000..bb6318be --- /dev/null +++ b/lib/python/Screens/MessageBox.py @@ -0,0 +1,15 @@ +from Screen import Screen +from Components.ActionMap import ActionMap +from Components.Label import Label + +class MessageBox(Screen): + def __init__(self, session, text): + Screen.__init__(self, session) + + self["text"] = Label(text) + + self["actions"] = ActionMap(["OkCancelActions"], + { + "cancel": self.close + }) + diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py index fbd2c173..c91f5f57 100644 --- a/lib/python/Screens/__init__.py +++ b/lib/python/Screens/__init__.py @@ -1,4 +1,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu", - "InfoBar", "Menu", "ScartLoopThrough", "Screen", "ServiceScan", + "InfoBar", "MessageBox", "Menu", "ScartLoopThrough", "Screen", "ServiceScan", "TimerEdit"] |
