X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/fbc79da5c84135c8a8e46060d3edc157ec85d006..788631e9d94a53a43fa127dcc2de4ce8fe05dca2:/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
index 32052e28..cb64f9ac 100644
--- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
+++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
@@ -1,45 +1,74 @@
-from Screens.Wizard import Wizard, wizardManager
+from Screens.Wizard import Wizard, wizardManager, WizardSummary
import sys
from VideoHardware import video_hw
from Components.Pixmap import Pixmap, MovingPixmap
from Components.config import config, ConfigBoolean, configfile
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
+from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
+from Tools.LoadPixmap import LoadPixmap
+
+config.misc.showtestcard = ConfigBoolean(default = False)
+
+class VideoWizardSummary(WizardSummary):
+ skin = """
+
+
+
+
+
+
+ """ #% (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/lcd_Scart.png"))
+
+ def __init__(self, session, parent):
+ WizardSummary.__init__(self, session, parent)
+ #self["pic"] = Pixmap()
+
+ def setLCDPicCallback(self):
+ self.parent.setLCDTextCallback(self.setText)
+
+ def setLCDPic(self, file):
+ self["pic"].instance.setPixmapFromFile(file)
+
class VideoWizard(Wizard):
skin = """
-
+
-
+
- """
+ """ % (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/Scart.png"))
def __init__(self, session):
# FIXME anyone knows how to use relative paths from the plugin's directory?
- self.xmlfile = sys.path[0] + "/Plugins/SystemPlugins/Videomode/videowizard.xml"
+ self.xmlfile = resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/videowizard.xml")
self.hw = video_hw
- Wizard.__init__(self, session, showSteps = False)
+ Wizard.__init__(self, session, showSteps = False, showStepSlider = False)
self["wizard"] = Pixmap()
self["rc"] = MovingPixmap()
+ self["portpic"] = Pixmap()
self["arrowdown"] = MovingPixmap()
self["arrowup"] = MovingPixmap()
self["arrowup2"] = MovingPixmap()
self.port = None
self.mode = None
+ self.rate = None
+
def createSummary(self):
print "++++++++++++***++**** VideoWizard-createSummary"
from Screens.Wizard import WizardSummary
- return WizardSummary
+ return VideoWizardSummary
def markDone(self):
pass
@@ -49,7 +78,9 @@ class VideoWizard(Wizard):
for port in self.hw.getPortList():
if self.hw.isPortUsed(port):
- list.append((port, port))
+ list.append((port,port))
+ list.sort(key = lambda x: x[0])
+ print "listInputChannels:", list
return list
def inputSelectionMade(self, index):
@@ -60,6 +91,8 @@ class VideoWizard(Wizard):
def inputSelectionMoved(self):
print "input selection moved:", self.selection
self.inputSelect(self.selection)
+ if self["portpic"].instance is not None:
+ self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + self.selection + ".png"))
def inputSelect(self, port):
print "inputSelect:", port
@@ -71,7 +104,9 @@ class VideoWizard(Wizard):
list = []
print "modes for port", self.port
for mode in self.hw.getModeList(self.port):
- list.append((mode[0], mode[0]))
+ if mode[0] != "PC":
+ list.append((mode[0], mode[0]))
+ print "modeslist:", list
return list
def modeSelectionMade(self, index):
@@ -102,6 +137,7 @@ class VideoWizard(Wizard):
def rateSelectionMade(self, index):
print "rateSelectionMade:", index
+ self.rate = index
self.rateSelect(index)
def rateSelectionMoved(self):
@@ -111,3 +147,11 @@ class VideoWizard(Wizard):
def rateSelect(self, rate):
self.hw.setMode(port = self.port, mode = self.mode, rate = rate)
+ def showTestCard(self, selection = None):
+ if selection is None:
+ selection = self.selection
+ print "set config.misc.showtestcard to", {'yes': True, 'no': False}[selection]
+ if selection == "yes":
+ config.misc.showtestcard.value = True
+ else:
+ config.misc.showtestcard.value = False