From bc851c60af8c44be9d5b24637ce335a8abf20401 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 22 Feb 2008 01:01:44 +0000 Subject: [PATCH] add port pictures to the video wizard lcd pics don't work yet --- .../SystemPlugins/Videomode/Makefile.am | 3 +- .../SystemPlugins/Videomode/VideoHardware.py | 1 + .../SystemPlugins/Videomode/VideoWizard.py | 45 ++++++++++++++---- .../SystemPlugins/Videomode/lcd_DVI.png | Bin 0 -> 1033 bytes .../SystemPlugins/Videomode/lcd_Scart.png | Bin 0 -> 1088 bytes .../SystemPlugins/Videomode/lcd_YPbPr.png | Bin 0 -> 1052 bytes .../SystemPlugins/Videomode/videowizard.xml | 2 + 7 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png create mode 100644 lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png create mode 100644 lib/python/Plugins/SystemPlugins/Videomode/lcd_YPbPr.png diff --git a/lib/python/Plugins/SystemPlugins/Videomode/Makefile.am b/lib/python/Plugins/SystemPlugins/Videomode/Makefile.am index 412c80cd..5702a3b1 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/Videomode/Makefile.am @@ -5,4 +5,5 @@ install_PYTHON = \ plugin.py \ VideoHardware.py \ VideoWizard.py \ - videowizard.xml + videowizard.xml \ + *.png diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index 9defb9eb..177cbd09 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -153,6 +153,7 @@ class VideoHardware: # get a list with all modes, with all rates, for a given port. def getModeList(self, port): + print "getModeList for port", port res = [ ] for mode in self.modes[port]: # list all rates which are completely valid diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py index 5524dfce..b4223b5f 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py @@ -1,36 +1,61 @@ -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() @@ -42,7 +67,7 @@ class VideoWizard(Wizard): def createSummary(self): print "++++++++++++***++**** VideoWizard-createSummary" from Screens.Wizard import WizardSummary - return WizardSummary + return VideoWizardSummary def markDone(self): pass @@ -52,7 +77,8 @@ class VideoWizard(Wizard): for port in self.hw.getPortList(): if self.hw.isPortUsed(port): - list.append((port, port)) + list.append((port,port)) + print "listInputChannels:", list return list def inputSelectionMade(self, index): @@ -63,6 +89,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 @@ -76,6 +104,7 @@ class VideoWizard(Wizard): for mode in self.hw.getModeList(self.port): if mode[0] != "PC": list.append((mode[0], mode[0])) + print "modeslist:", list return list def modeSelectionMade(self, index): diff --git a/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png b/lib/python/Plugins/SystemPlugins/Videomode/lcd_DVI.png new file mode 100644 index 0000000000000000000000000000000000000000..715dbe4820ee0068d5e8231a1fcf23f0b490df72 GIT binary patch literal 1033 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wP9djW(e>JaRn+K1*0J_VnblF!Iuu8 z=b1`^{DS{8Jl$^K1>`k)x;TbZ+o7qEZOU`S!QbmP|ABIasN=JtVBA!;RK`5zS__RMuxxBEN}LH RTyG7E7f)9|mvv4FO#o5VUXB0& literal 0 HcmV?d00001 diff --git a/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png b/lib/python/Plugins/SystemPlugins/Videomode/lcd_Scart.png new file mode 100644 index 0000000000000000000000000000000000000000..45c397dea87a462174f5eda79700bf03790aaa89 GIT binary patch literal 1088 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wP9djW(e>JaRn+K1*0J_VnblF!Iuu8 z=b1`^{DS{8Jl$^K1?27Uba4!+xb@~*AQ!VC2TQ=-{|lE-3Cd`m6}Ve(%A5atcoI9i z%B(Tvc!6;P-zk#~eJ7bN{Fu5{Gj>O_ z*oBIzdu5e>D?MfGHJ1@Pv9>b%qlQ1@OV`f~^^6%x^_C0F8BaZboEptC#5QQ<|d}62BjvZR2H60wP9djW(e>JaRn+K1*0J_VnblF!Iuu8 z=b1`^{DS{8Jl$^K1>{Zfba4!+xb^0GBUgh04@w3ze9m<7gcT^NJYD@<);T3K0RU8DVUYj; literal 0 HcmV?d00001 diff --git a/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml b/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml index 5d54b2f1..681a6633 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml +++ b/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml @@ -4,6 +4,7 @@ +self["portpic"].show() self["arrowdown"].moveTo(557, 232, 1) self["arrowdown"].startMoving() self["arrowup"].moveTo(800, 232, 1) @@ -25,6 +26,7 @@ self["arrowdown"].startMoving() self["arrowup"].startMoving() self["rc"].moveTo(500, 50, 1) self["rc"].startMoving() +self["portpic"].hide() -- 2.30.2