aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-03-30 14:23:37 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-03-30 14:23:37 +0000
commitfeba724e9e6b6f6a389530e3bb67132c0b56da1c (patch)
tree6f450fe346e12fc6db18ff5f0177843dec23595d /lib/python
parentff065cef90c4eaebb6324934df6c83772814eabe (diff)
downloadenigma2-feba724e9e6b6f6a389530e3bb67132c0b56da1c.tar.gz
enigma2-feba724e9e6b6f6a389530e3bb67132c0b56da1c.zip
allow language selection in video wizard
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py9
-rw-r--r--lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.pngbin1033 -> 291 bytes
-rw-r--r--lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.pngbin1088 -> 362 bytes
-rw-r--r--lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.pngbin1052 -> 312 bytes
-rw-r--r--lib/python/Screens/Makefile.am5
-rw-r--r--lib/python/Screens/Wizard.py38
-rw-r--r--lib/python/Screens/WizardLanguage.py37
7 files changed, 77 insertions, 12 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
index cb64f9ac..18b20f6e 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
+++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
@@ -1,4 +1,5 @@
-from Screens.Wizard import Wizard, wizardManager, WizardSummary
+from Screens.Wizard import wizardManager, WizardSummary
+from Screens.WizardLanguage import WizardLanguage
import sys
from VideoHardware import video_hw
@@ -31,7 +32,7 @@ class VideoWizardSummary(WizardSummary):
def setLCDPic(self, file):
self["pic"].instance.setPixmapFromFile(file)
-class VideoWizard(Wizard):
+class VideoWizard(WizardLanguage):
skin = """
<screen position="0,0" size="720,576" title="Welcome..." flags="wfNoBorder" >
<widget name="text" position="153,50" size="340,270" font="Regular;23" />
@@ -40,6 +41,8 @@ class VideoWizard(Wizard):
</widget>
<widget name="config" position="50,300" zPosition="1" size="440,200" transparent="1" scrollbarMode="showOnDemand" />
<widget name="wizard" pixmap="wizard.png" position="40,50" zPosition="10" size="110,174" transparent="1" alphatest="on"/>
+ <ePixmap pixmap="skin_default/button_red.png" position="40,225" zPosition="0" size="15,16" transparent="1" alphatest="on" />
+ <widget name="languagetext" position="55,225" size="95,30" font="Regular;18" />
<widget name="portpic" pixmap="%s" position="50,300" zPosition="10" size="150,150" transparent="1" alphatest="on"/>
<widget name="rc" pixmap="rc.png" position="500,600" zPosition="10" size="154,475" transparent="1" alphatest="on"/>
<widget name="arrowdown" pixmap="arrowdown.png" position="0,0" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
@@ -52,7 +55,7 @@ class VideoWizard(Wizard):
self.xmlfile = resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/videowizard.xml")
self.hw = video_hw
- Wizard.__init__(self, session, showSteps = False, showStepSlider = False)
+ WizardLanguage.__init__(self, session, showSteps = False, showStepSlider = False)
self["wizard"] = Pixmap()
self["rc"] = MovingPixmap()
self["portpic"] = Pixmap()
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png b/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png
index 715dbe48..f6fb7b7e 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png
+++ b/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png
Binary files differ
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png b/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png
index 45c397de..bab5cf0e 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png
+++ b/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png
Binary files differ
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.png b/lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.png
index 16f3849a..cfa8b10e 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.png
+++ b/lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.png
Binary files differ
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index 068ce442..4fd30a2c 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -12,4 +12,7 @@ install_PYTHON = \
Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
TimerSelection.py PictureInPicture.py TimeDateInput.py \
SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \
- SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py SessionGlobals.py LocationBox.py
+ SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py
+ SessionGlobals.py LocationBox.py WizardLanguage.py
+ #DefaultWizard.py \
+ #ServiceScanTutorial.py
diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py
index f018c3ce..206a87ce 100644
--- a/lib/python/Screens/Wizard.py
+++ b/lib/python/Screens/Wizard.py
@@ -46,6 +46,9 @@ class WizardSummary(Screen):
self["text"].setText(text)
class Wizard(Screen, HelpableScreen):
+ def createSummary(self):
+ print "WizardCreateSummary"
+ return WizardSummary
class parseWizard(ContentHandler):
def __init__(self, wizard):
@@ -54,9 +57,7 @@ class Wizard(Screen, HelpableScreen):
self.currContent = ""
self.lastStep = 0
- def createSummary(self):
- print "WizardCreateSummary"
- return WizardSummary
+
def startElement(self, name, attrs):
print "startElement", name
@@ -187,7 +188,7 @@ class Wizard(Screen, HelpableScreen):
self.lcdCallbacks = []
- self["actions"] = NumberActionMap(["WizardActions", "NumberActions"],
+ self["actions"] = NumberActionMap(["WizardActions", "NumberActions", "ColorActions"],
{
"ok": self.ok,
"back": self.back,
@@ -195,6 +196,10 @@ class Wizard(Screen, HelpableScreen):
"right": self.right,
"up": self.up,
"down": self.down,
+ "red": self.red,
+ "green": self.green,
+ "yellow": self.yellow,
+ "blue":self.blue,
"1": self.keyNumberGlobal,
"2": self.keyNumberGlobal,
"3": self.keyNumberGlobal,
@@ -206,7 +211,23 @@ class Wizard(Screen, HelpableScreen):
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
}, -1)
+
+ def red(self):
+ print "red"
+ pass
+ def green(self):
+ print "green"
+ pass
+
+ def yellow(self):
+ print "yellow"
+ pass
+
+ def blue(self):
+ print "blue"
+ pass
+
def setLCDTextCallback(self, callback):
self.lcdCallbacks.append(callback)
@@ -310,7 +331,7 @@ class Wizard(Screen, HelpableScreen):
self["list"].selectPrevious()
if self.wizard[self.currStep].has_key("onselect"):
print "current:", self["list"].current
- self.selection = self["list"].current[1]
+ self.selection = self["list"].current[-1]
#self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1]
exec("self." + self.wizard[self.currStep]["onselect"] + "()")
print "up"
@@ -326,7 +347,7 @@ class Wizard(Screen, HelpableScreen):
print "current:", self["list"].current
#self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1]
#exec("self." + self.wizard[self.currStep]["onselect"] + "()")
- self.selection = self["list"].current[1]
+ self.selection = self["list"].current[-1]
#self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1]
exec("self." + self.wizard[self.currStep]["onselect"] + "()")
print "down"
@@ -338,7 +359,7 @@ class Wizard(Screen, HelpableScreen):
self["config"].instance.moveSelection(self["config"].instance.moveUp)
elif (self.showList and len(self.wizard[self.currStep]["evaluatedlist"]) > 0):
if self.wizard[self.currStep].has_key("onselect"):
- self.selection = self["list"].current[1]
+ self.selection = self["list"].current[-1]
print "self.selection:", self.selection
exec("self." + self.wizard[self.currStep]["onselect"] + "()")
@@ -444,7 +465,8 @@ class Wizard(Screen, HelpableScreen):
else:
self["config"].l.setList([])
else:
- self["config"].hide()
+ if self.has_key("config"):
+ self["config"].hide()
else: # condition false
self.currStep += 1
self.updateValues()
diff --git a/lib/python/Screens/WizardLanguage.py b/lib/python/Screens/WizardLanguage.py
new file mode 100644
index 00000000..698d0b9f
--- /dev/null
+++ b/lib/python/Screens/WizardLanguage.py
@@ -0,0 +1,37 @@
+from Wizard import Wizard
+from Components.Label import Label
+from Components.Language import language
+
+class WizardLanguage(Wizard):
+ def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):
+ Wizard.__init__(self, session, showSteps, showStepSlider, showList, showConfig)
+
+ self["languagetext"] = Label()
+ self.updateLanguageDescription()
+
+ def red(self):
+ self.resetCounter()
+ self.languageSelect()
+
+ def languageSelect(self):
+ print "languageSelect"
+ newlanguage = language.getActiveLanguageIndex() + 1
+ if newlanguage >= len(language.getLanguageList()):
+ newlanguage = 0
+ language.activateLanguageIndex(newlanguage)
+
+ self.updateTexts()
+
+ def updateLanguageDescription(self):
+ print language.getLanguageList()[language.getActiveLanguageIndex()]
+ self["languagetext"].setText(_(language.getLanguageList()[language.getActiveLanguageIndex()][1][0]))
+
+ def updateTexts(self):
+ print "updateTexts"
+ self.updateText(firstset = True)
+ self.updateValues()
+ self.updateLanguageDescription()
+
+
+
+ \ No newline at end of file