X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FVideomode%2FVideoWizard.py;h=bceb6bc7e42dd2d4259a3736bf96428bc7a71153;hp=cb64f9acfb661610f549da169a31b065acff2030;hb=96ac5ba0afb7fb1ea96aee24fc497e76dc2c652b;hpb=788631e9d94a53a43fa127dcc2de4ce8fe05dca2 diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py index cb64f9a..bceb6bc 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py @@ -1,21 +1,21 @@ -from Screens.Wizard import Wizard, wizardManager, WizardSummary -import sys +from Screens.Wizard import WizardSummary +from Screens.WizardLanguage import WizardLanguage +from Screens.Rc import Rc from VideoHardware import video_hw -from Components.Pixmap import Pixmap, MovingPixmap +from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap 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 +from Tools.Directories import resolveFilename, SCOPE_PLUGINS +from Tools.HardwareInfo import HardwareInfo config.misc.showtestcard = ConfigBoolean(default = False) class VideoWizardSummary(WizardSummary): skin = """ - - + + @@ -31,20 +31,23 @@ class VideoWizardSummary(WizardSummary): def setLCDPic(self, file): self["pic"].instance.setPixmapFromFile(file) -class VideoWizard(Wizard): +class VideoWizard(WizardLanguage, Rc): skin = """ - - + + + + - - - - + + + + + """ % (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/Scart.png")) def __init__(self, session): @@ -52,13 +55,10 @@ 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) + Rc.__init__(self) self["wizard"] = Pixmap() - self["rc"] = MovingPixmap() self["portpic"] = Pixmap() - self["arrowdown"] = MovingPixmap() - self["arrowup"] = MovingPixmap() - self["arrowup2"] = MovingPixmap() self.port = None self.mode = None @@ -71,14 +71,20 @@ class VideoWizard(Wizard): return VideoWizardSummary def markDone(self): - pass + config.misc.videowizardenabled.value = 0 + config.misc.videowizardenabled.save() + configfile.save() def listInputChannels(self): + hw_type = HardwareInfo().get_device_name() list = [] for port in self.hw.getPortList(): if self.hw.isPortUsed(port): - list.append((port,port)) + descr = port + if descr == 'DVI' and hw_type == 'dm500hd': + descr = 'HDMI' + list.append((descr,port)) list.sort(key = lambda x: x[0]) print "listInputChannels:", list return list @@ -98,13 +104,15 @@ class VideoWizard(Wizard): print "inputSelect:", port modeList = self.hw.getModeList(self.selection) print "modeList:", modeList - self.hw.setMode(port = port, mode = modeList[0][0], rate = modeList[0][1][0]) + self.port = port + ratesList = self.listRates(modeList[0][0]) + self.hw.setMode(port = port, mode = modeList[0][0], rate = ratesList[0][0]) def listModes(self): list = [] print "modes for port", self.port for mode in self.hw.getModeList(self.port): - if mode[0] != "PC": + #if mode[0] != "PC": list.append((mode[0], mode[0])) print "modeslist:", list return list @@ -132,6 +140,11 @@ class VideoWizard(Wizard): print mode if mode[0] == querymode: for rate in mode[1]: + if self.port == "DVI-PC": + print "rate:", rate + if rate == "640x480": + list.insert(0, (rate, rate)) + continue list.append((rate, rate)) return list @@ -155,3 +168,16 @@ class VideoWizard(Wizard): config.misc.showtestcard.value = True else: config.misc.showtestcard.value = False + + def keyNumberGlobal(self, number): + if number in (1,2,3): + if number == 1: + self.hw.saveMode("DVI", "720p", "multi") + elif number == 2: + self.hw.saveMode("DVI", "1080i", "multi") + elif number == 3: + self.hw.saveMode("Scart", "Multi", "multi") + self.hw.setConfiguredMode() + self.close() + + WizardLanguage.keyNumberGlobal(self, number)