From 301bab11f8453a6899153b7be338a352803b22cb Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Sun, 28 Aug 2005 23:13:58 +0000 Subject: added setup screens --- lib/python/Components/Clock.py | 3 +- lib/python/Components/InputDevice.py | 4 +- lib/python/Components/Makefile.am | 3 +- lib/python/Components/__init__.py | 3 +- lib/python/Components/config.py | 39 ++++++++++++------ lib/python/Screens/ChannelSelection.py | 8 ++-- lib/python/Screens/InfoBar.py | 4 +- lib/python/Screens/Makefile.am | 2 +- lib/python/Screens/Menu.py | 62 ++++++++++++++--------------- lib/python/Screens/Setup.py | 72 +++++++++++++++++++++++++++++++--- lib/python/Screens/TimerEdit.py | 2 +- 11 files changed, 139 insertions(+), 63 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/Clock.py b/lib/python/Components/Clock.py index 3beed551..eba5ea27 100644 --- a/lib/python/Components/Clock.py +++ b/lib/python/Components/Clock.py @@ -21,7 +21,8 @@ class Clock(HTMLComponent, GUIComponent, VariableText): # "funktionalitaet" def doClock(self): t = time.localtime() - self.setText("%2d:%02d:%02d" % (t[3], t[4], t[5])) + #HACK use timezone settings + self.setText("%2d:%02d:%02d" % (t[3] + 2, t[4], t[5])) # realisierung als GUI def createWidget(self, parent): diff --git a/lib/python/Components/InputDevice.py b/lib/python/Components/InputDevice.py index 599dff34..eb88e650 100644 --- a/lib/python/Components/InputDevice.py +++ b/lib/python/Components/InputDevice.py @@ -17,8 +17,8 @@ class inputDevices: def InitInputDevices(): config.inputDevices = ConfigSubsection(); - config.inputDevices.repeat = configElement("config.inputDevices.repeat", ConfigSlider, 3); - config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 3); + config.inputDevices.repeat = configElement("config.inputDevices.repeat", ConfigSlider, 5, ""); + config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 4, ""); #this instance anywhere else needed? iDevices = inputDevices(); diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 969077aa..88118ebf 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -6,6 +6,5 @@ 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 MovieList.py \ + GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py \ InputDevice.py ServicePosition.py - diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py index 8453ced5..fb9eeaa4 100644 --- a/lib/python/Components/__init__.py +++ b/lib/python/Components/__init__.py @@ -3,5 +3,6 @@ __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", "MovieList", "ServicePosition" ] + "components", "config", "TimerList", "TimeInput", "MovieList", + "InputDevice", "ServicePosition" ] diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 10296437..15119617 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1,15 +1,31 @@ # temp stuff :) class configBoolean: - def __init__(self, reg): - self.reg = reg - self.val = 0 + def __init__(self, parent): + self.parent = parent + self.val = parent.value + self.vals = parent.vals + + def handleKey(self, key): + if key == 1: + self.val = self.val - 1 + if key == 2: + self.val = self.val + 1 + + if self.val < 0: + self.val = 0 + +# if self.val > 1: +# self.val = 1 - def toggle(self): - self.val += 1 - self.val %= 3 + def __call__(self): #needed by configlist - def __str__(self): - return ("NO", "YES", "MAYBE")[self.val] + print len(self.vals) + print self.val + + if(self.val > (len(self.vals) - 1)): + self.val = len(self.vals) - 1 + + return ("text",self.vals[self.val]) class configValue: def __init__(self, obj): @@ -48,7 +64,6 @@ class ConfigSlider: if self.val > 10: self.val = 10 - def __call__(self): #needed by configlist return ("slider", self.val * 10) @@ -57,10 +72,12 @@ class ConfigSubsection: pass class configElement: - def __init__(self, configPath, control, defaultValue): + def __init__(self, configPath, control, defaultValue, vals): self.configPath = configPath - self.value = 0 #read from registry else use default +# self.value = 0 #read from registry else use default + self.value = defaultValue #read from registry else use default self.controlType = control + self.vals = vals self.notifierList = [ ] def addNotifier(self, notifier): self.notifierList.append(notifier); diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 3155c44d..e421c5c9 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -55,10 +55,10 @@ class ChannelSelection(Screen): ## FIXME self.__marked = [ ] - self["key_red"] = Button("red") - self["key_green"] = Button("green") - self["key_yellow"] = Button("yellow") - self["key_blue"] = Button("blue") + self["key_red"] = Button("All") + self["key_green"] = Button("ARD") + self["key_yellow"] = Button("ZDF") + self["key_blue"] = Button("Custom") self["list"] = ServiceList() self["list"].setRoot(eServiceReference("""1:0:1:0:0:0:0:0:0:0:(type == 1)""")) diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 0ead7221..44484a51 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -106,8 +106,8 @@ class InfoBar(Screen): quitMainloop() def instantRecord(self): - self.session.open(MessageBox, "this would be an instant recording! do you really know what you're doing?!") - return + #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" diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 9250018e..e645997d 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 \ - MovieSelection.py Setup.py __init__.py + MovieSelection.py SetupRCU.py Setup.py __init__.py diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index fd2f2761..11b265e3 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -12,6 +12,8 @@ from Components.Label import Label from Components.ProgressBar import ProgressBar from ConfigMenu import * +from About import * + from TimerEdit import * from enigma import quitMainloop @@ -27,56 +29,50 @@ def doGlobal(screen): screen["clock"] = Clock() +# self.setModeTV() +# self.setModeRadio() +# self.setModeFile() +# self.openDialog(ScartLoopThrough) +# + mdom = xml.dom.minidom.parseString( """ - + quitMainloop() - self.openDialog(ServiceScan) - - self.openSetup("rc") - self.openSetup("blasel") - - self.setModeTV() - self.setModeRadio() - self.setModeFile() - self.openDialog(ScartLoopThrough) self.openDialog(TimerEditList) - + - - - - + self.openSetup("satconfig") + + + self.openDialog(ServiceScan) - - - - - + self.openSetup("timezone") + self.openSetup("avsetup") + self.openSetup("rfmod") - - self.openDialog(configOSD) - - + self.openSetup("rc") + self.openSetup("keyboard") + self.openSetup("osd") + self.openSetup("lcd") - - + self.openSetup("parental") + self.openSetup("expert") - - + + self.openDialog(About) - - - - self.goSetup() + quitMainloop() + quitMainloop() + quitMainloop() """) @@ -142,7 +138,7 @@ class Menu(Screen): self.session.open(dialog) def openSetup(self, dialog): - self.session.open(setup, dialog) + self.session.open(Setup, dialog) def addMenu(self, destList, node): MenuTitle = getValbyAttr(node, "text") diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py index de27ff5e..a694ab16 100644 --- a/lib/python/Screens/Setup.py +++ b/lib/python/Screens/Setup.py @@ -4,6 +4,7 @@ from Components.config import config #global config instance from Components.config import configEntry from Components.config import configBoolean from Components.ConfigList import ConfigList +from Components.Label import Label import xml.dom.minidom from xml.dom import EMPTY_NAMESPACE @@ -13,10 +14,66 @@ from Tools import XMLTools setupdom = xml.dom.minidom.parseString( """ - - config.inputDevices.repeat - config.inputDevices.delay - + + + config.inputDevices.repeat + config.inputDevices.delay + config.rc.map + + + config.timezone.val + + + config.av.colorformat + config.av.aspectratio + config.av.tvsystem + config.av.wss + config.av.defaultac3 + config.av.vcrswitch + + + config.rfmod.enable + config.rfmod.test + config.rfmod.sound + config.rfmod.soundcarrier + config.rfmod.channel + config.rfmod.finetune + + + config.keyboard.keymap + + + config.osd.alpha + config.osd.bright + config.osd.contrast + config.osd.language + + + config.lcd.bright + config.lcd.standby + config.lcd.invert + + + config.parental.lock + config.parental.setuplock + + + config.expert.splitsize + config.expert.satpos + config.expert.fastzap + config.expert.skipconfirm + config.expert.hideerrors + config.expert.autoinfo + + + config.sat.diseqcA + config.sat.posA + config.sat.satA + config.sat.diseqcB + config.sat.posB + config.sat.satB + + """) def getValbyAttr(x, attr): @@ -66,7 +123,9 @@ class Setup(Screen): print "request setup for " + setup - entries = setupdom.childNodes + xmldata = setupdom.childNodes[0] + + entries = xmldata.childNodes list = [] @@ -83,6 +142,9 @@ class Setup(Screen): self["config"] = ConfigList(list) + self["ok"] = Label("OK") + self["cancel"] = Label("Cancel") + self["actions"] = ActionMap(["SetupActions"], { "cancel": self.close, diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index f8c9f207..173b1ba2 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -64,7 +64,7 @@ class TimerEditList(Screen): self["actions"] = ActionMap(["OkCancelActions"], { - "ok": self.openEdit, +# "ok": self.openEdit, "cancel": self.close }) -- cgit v1.2.3