aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorRonny Strutz <ronny.strutz@multimedia-labs.de>2005-08-28 23:13:58 +0000
committerRonny Strutz <ronny.strutz@multimedia-labs.de>2005-08-28 23:13:58 +0000
commit301bab11f8453a6899153b7be338a352803b22cb (patch)
tree5df637e4d8812cb83f5073f5160625aee65c3937 /lib/python
parent1f5b1a20e4de369c197de1dae8fcb368e3e10b26 (diff)
downloadenigma2-301bab11f8453a6899153b7be338a352803b22cb.tar.gz
enigma2-301bab11f8453a6899153b7be338a352803b22cb.zip
added setup screens
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Clock.py3
-rw-r--r--lib/python/Components/InputDevice.py4
-rw-r--r--lib/python/Components/Makefile.am3
-rw-r--r--lib/python/Components/__init__.py3
-rw-r--r--lib/python/Components/config.py39
-rw-r--r--lib/python/Screens/ChannelSelection.py8
-rw-r--r--lib/python/Screens/InfoBar.py4
-rw-r--r--lib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/Menu.py62
-rw-r--r--lib/python/Screens/Setup.py72
-rw-r--r--lib/python/Screens/TimerEdit.py2
11 files changed, 139 insertions, 63 deletions
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()
+# <item text="TV-Mode">self.setModeTV()</item>
+# <item text="Radio-Mode">self.setModeRadio()</item>
+# <item text="File-Mode">self.setModeFile()</item>
+# <item text="Scart">self.openDialog(ScartLoopThrough)</item>
+# <item text="Sleep Timer"></item>
+
mdom = xml.dom.minidom.parseString(
"""
- <menu text="Mainmenu" title="the real Mainmenu">
+ <menu text="Mainmenu" title="Mainmenu">
<item text="Standby debug">quitMainloop()</item>
- <item text="Automatic Scan">self.openDialog(ServiceScan)</item>
-
- <item text="Blub1">self.openSetup("rc")</item>
- <item text="Blub2">self.openSetup("blasel")</item>
-
- <item text="TV-Mode">self.setModeTV()</item>
- <item text="Radio-Mode">self.setModeRadio()</item>
- <item text="File-Mode">self.setModeFile()</item>
- <item text="Scart">self.openDialog(ScartLoopThrough)</item>
<item text="Timer">self.openDialog(TimerEditList)</item>
<menu text="Setup">
- <menu text="Service Organising">
+ <menu text="Service Organising -disabled-">
<item text="New Bouquets"></item>
<item text="Add to Bouquets"></item>
<item text="Edit Bouquets"></item>
</menu>
<menu text="Service Searching">
- <item text="Satelliteconfig"></item>
- <item text="Satfinder"></item>
- <item text="Rotor Control"></item>
- <item text="Edit Transponder"></item>
+ <item text="Satelliteconfig">self.openSetup("satconfig")</item>
+ <item text="Satfinder -disabled-"></item>
+ <item text="Rotor Control -disabled-"></item>
+ <item text="Edit Transponder -disabled-"></item>
<item text="Automatic Scan">self.openDialog(ServiceScan)</item>
- <item text="Automatic 'Multisat' Scan"></item>
- <item text="Manual Scan"></item>
</menu>
<menu text="System">
- <item text="Time Date"></item>
- <item text="Video Audio"></item>
- <item text="UHF Modulator"></item>
+ <item text="Timezone">self.openSetup("timezone")</item>
+ <item text="Video Audio">self.openSetup("avsetup")</item>
+ <item text="UHF Modulator">self.openSetup("rfmod")</item>
<item text="Harddisk"></item>
- <item text="Keyboard"></item>
- <item text="OSD">self.openDialog(configOSD)</item>
- <item text="Language"></item>
- <item text="LCD"></item>
+ <item text="Remote Control">self.openSetup("rc")</item>
+ <item text="Keyboard">self.openSetup("keyboard")</item>
+ <item text="OSD">self.openSetup("osd")</item>
+ <item text="LCD">self.openSetup("lcd")</item>
</menu>
<item text="Common Interface"></item>
- <item text="Parental Control"></item>
- <item text="Expert"></item>
+ <item text="Parental Control">self.openSetup("parental")</item>
+ <item text="Expert">self.openSetup("expert")</item>
</menu>
- <item text="Games"></item>
- <item text="Information"></item>
+ <item text="Games (not found)"></item>
+ <item text="Information">self.openDialog(About)</item>
<menu text="Standby">
- <item text="PowerOff"></item>
- <item text="Restart"></item>
- <item text="Standby"></item>
- <item text="Sleep Timer">self.goSetup()</item>
+ <item text="PowerOff">quitMainloop()</item>
+ <item text="Restart">quitMainloop()</item>
+ <item text="Standby">quitMainloop()</item>
</menu>
</menu>""")
@@ -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(
"""
- <setup key="rc" title="RC Menu">
- <item text="Repeat Rate">config.inputDevices.repeat</item>
- <item text="Delay Rate">config.inputDevices.delay</item>
- </setup>
+ <setupxml>
+ <setup key="rc" title="RC Menu">
+ <item text="Repeat Rate">config.inputDevices.repeat</item>
+ <item text="Delay Rate">config.inputDevices.delay</item>
+ <item text="Keymap">config.rc.map</item>
+ </setup>
+ <setup key="timezone" title="RC Menu">
+ <item text="Timezone">config.timezone.val</item>
+ </setup>
+ <setup key="avsetup" title="A/V Settings">
+ <item text="Color Format">config.av.colorformat</item>
+ <item text="Aspect Ratio">config.av.aspectratio</item>
+ <item text="TV System">config.av.tvsystem</item>
+ <item text="WSS">config.av.wss</item>
+ <item text="AC3 default">config.av.defaultac3</item>
+ <item text="VCR Switch">config.av.vcrswitch</item>
+ </setup>
+ <setup key="rfmod" title="UHF Modulator">
+ <item text="Modulator">config.rfmod.enable</item>
+ <item text="Testmode">config.rfmod.test</item>
+ <item text="Sound">config.rfmod.sound</item>
+ <item text="Soundcarrier">config.rfmod.soundcarrier</item>
+ <item text="Channel">config.rfmod.channel</item>
+ <item text="Finetune">config.rfmod.finetune</item>
+ </setup>
+ <setup key="keyboard" title="Keyboard Setup">
+ <item text="Keyboard Map">config.keyboard.keymap</item>
+ </setup>
+ <setup key="osd" title="OSD Settings">
+ <item text="Alpha">config.osd.alpha</item>
+ <item text="Brightness">config.osd.bright</item>
+ <item text="Contrast">config.osd.contrast</item>
+ <item text="Language">config.osd.language</item>
+ </setup>
+ <setup key="lcd" title="LCD Setup">
+ <item text="Brightness">config.lcd.bright</item>
+ <item text="Standby">config.lcd.standby</item>
+ <item text="Invert">config.lcd.invert</item>
+ </setup>
+ <setup key="parental" title="Parental Control">
+ <item text="Parental Lock">config.parental.lock</item>
+ <item text="Setup Lock">config.parental.setuplock</item>
+ </setup>
+ <setup key="expert" title="Expert Setup">
+ <item text="Record Splitsize">config.expert.splitsize</item>
+ <item text="Show Satposition">config.expert.satpos</item>
+ <item text="Fast zapping">config.expert.fastzap</item>
+ <item text="Skip confirmations">config.expert.skipconfirm</item>
+ <item text="Hide error windows">config.expert.hideerrors</item>
+ <item text="Auto show inforbar">config.expert.autoinfo</item>
+ </setup>
+ <setup key="satconfig" title="Sat/Dish Setup">
+ <item text="Tuner-A Control">config.sat.diseqcA</item>
+ <item text="Tuner-A Position">config.sat.posA</item>
+ <item text="Tuner-A Sat">config.sat.satA</item>
+ <item text="Tuner-B Control">config.sat.diseqcB</item>
+ <item text="Tuner-A Position">config.sat.posB</item>
+ <item text="Tuner-B Sat">config.sat.satB</item>
+ </setup>
+ </setupxml>
""")
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
})