Make VideoWizard screen automatically fit to screen
authorMike Looijmans <milo-software@users.sourceforge.net>
Sat, 31 Mar 2012 18:09:39 +0000 (20:09 +0200)
committerMike Looijmans <milo-software@users.sourceforge.net>
Sat, 31 Mar 2012 18:09:39 +0000 (20:09 +0200)
VideoWizard is the first thing to appear on a new system. Now it fills
the screen, regardless of the resolution it's in. It's a nice demonstration
of <panel> capabilities.

Moved a few summary screens to where they belong.

data/skin_default.xml
data/skin_display.xml
data/skin_display96.xml
data/skin_text.xml
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
lib/python/Screens/Wizard.py
lib/python/Screens/WizardLanguage.py

index 7168dcf..a928154 100644 (file)
@@ -1003,6 +1003,13 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
        </screen>
        <!-- Standby mode -->
        <screen name="Standby" flags="wfNoBorder" position="fill" title="Standby" />
+       <!-- Extra margin for wizard, never know how bad the TV is... -->
+       <screen name="WizardMarginsTemplate">
+               <panel position="left" size="10%,*" />
+               <panel position="right" size="8%,*" />
+               <panel position="top" size="8%,*" />
+               <panel position="bottom" size="10%,*" />
+       </screen>
        <!-- Start Wizard -->
        <screen name="StartWizard" position="fill" title="Welcome..." flags="wfNoBorder">
                <widget name="text" position="153,50" size="340,270" font="Regular;23" />
index 1ba3b78..caed5b2 100644 (file)
                <panel position="bottom" size="*,24" name="SummaryClockPanel" />
        </screen>
 
+       <screen name="WizardSummary" position="fill">
+               <widget source="text" render="Label" position="top" size="*,16" font="FdLcD;16"/>
+               <widget source="parent.list" render="Label" position="fill" font="FdLcD;12">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
+
+       <screen name="VideoWizardSummary" position="fill">
+               <widget name="text" position="top" size="*,40" font="FdLcD;12" transparent="1" />
+               <widget source="parent.list" render="Label" position="fill" font="FdLcD;14">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
+
 <!-- standby -->
        <screen name="StandbySummary" position="fill">
                <widget source="global.CurrentTime" render="Label" position="center,0" size="120,64" font="FdLcD;48" halign="center" valign="center" noWrap="1">
index d355f49..666d76f 100755 (executable)
                </widget>
        </screen>
 
+       <screen name="WizardSummary" position="fill">
+               <widget source="text" render="Label" position="top" size="*,16" font="FdLcD;16"/>
+               <widget source="parent.list" render="Label" position="fill" font="FdLcD;12">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
+
+       <screen name="VideoWizardSummary" position="fill">
+               <widget name="text" position="top" size="*,40" font="FdLcD;12" transparent="1" />
+               <widget source="parent.list" render="Label" position="fill" font="FdLcD;14">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
 <!-- standby -->
        <screen name="StandbySummary" position="0,0" size="96,64">
                <widget source="global.CurrentTime" render="Label" position="0,0" size="96,12" font="FdLcD;12" halign="center" valign="center" noWrap="1">
index 646ec2a..8016fc7 100755 (executable)
                <widget source="parent.Title" render="Label" position="0,0" size="124,40" font="Regular;16" halign="center" valign="center" />
        </screen>
 
+       <screen name="WizardSummary" position="fill">
+               <widget source="parent.list" render="Label" position="fill" font="Regular;12">
+                       <convert type="StringListSelection" />
+               </widget>
+       </screen>
+       <screen name="VideoWizardSummary" position="fill">
+               <panel name="WizardSummary" />
+       </screen>
+
 <!-- standby -->
        <screen name="StandbySummary" position="0,0" size="132,64">
                <widget source="global.CurrentTime" render="Label" position="0,0" size="120,64" font="Regular;48" halign="center" valign="center">
index 3e67f1c..cf4eafb 100644 (file)
@@ -12,27 +12,9 @@ from Tools.HardwareInfo import HardwareInfo
 config.misc.showtestcard = ConfigBoolean(default = False)
 
 class VideoWizardSummary(WizardSummary):
-       skin = (
-       """<screen name="VideoWizardSummary" position="0,0" size="132,64" id="1">
-               <widget name="text" position="6,4" size="120,40" font="Regular;12" transparent="1" />
-               <widget source="parent.list" render="Label" position="6,40" size="120,21" font="Regular;14">
-                       <convert type="StringListSelection" />
-               </widget>
-               <!--widget name="pic" pixmap="%s" position="6,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
-       </screen>""",
-       """<screen name="VideoWizardSummary" position="0,0" size="96,64" id="2">
-               <widget name="text" position="0,4" size="96,40" font="Regular;12" transparent="1" />
-               <widget source="parent.list" render="Label" position="0,40" size="96,21" font="Regular;14">
-                       <convert type="StringListSelection" />
-               </widget>
-               <!--widget name="pic" pixmap="%s" position="0,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
-       </screen>""")
-       #% (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)
                
@@ -41,22 +23,39 @@ class VideoWizardSummary(WizardSummary):
 
 class VideoWizard(WizardLanguage, Rc):
        skin = """
-               <screen position="0,0" size="720,576" title="Welcome..." flags="wfNoBorder" >
-                       <widget name="text" position="153,50" size="340,270" font="Regular;23" />
-                       <widget source="list" render="Listbox" position="200,300" size="290,200" scrollbarMode="showOnDemand" >
-                               <convert type="StringList" />
-                       </widget>
-                       <widget name="config" position="50,300" zPosition="1" size="440,200" transparent="1" scrollbarMode="showOnDemand" />
-                       <widget name="wizard" pixmap="skin_default/wizard.png" position="40,50" zPosition="10" size="110,174" transparent="1" alphatest="on"/>
-                       <ePixmap pixmap="skin_default/buttons/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" pixmaps="skin_default/rc.png,skin_default/rcold.png" position="500,50" zPosition="10" size="154,500" transparent="1" alphatest="on"/>
-                       <widget name="arrowdown" pixmap="skin_default/arrowdown.png" position="0,0" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
-                       <widget name="arrowdown2" pixmap="skin_default/arrowdown.png" position="0,0" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
-                       <widget name="arrowup" pixmap="skin_default/arrowup.png" position="-100,-100" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
-                       <widget name="arrowup2" pixmap="skin_default/arrowup.png" position="-100,-100" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
-               </screen>""" % (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/Scart.png"))
+               <screen position="fill" title="Welcome..." flags="wfNoBorder" >
+                       <panel name="WizardMarginsTemplate"/>
+                       <panel position="right" size="154,*">
+                               <widget name="rc" pixmaps="skin_default/rc.png,skin_default/rcold.png" position="top" zPosition="10" size="154,500" alphatest="on"/>
+                               <widget name="arrowdown" pixmap="skin_default/arrowdown.png" position="0,0" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
+                               <widget name="arrowdown2" pixmap="skin_default/arrowdown.png" position="0,0" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
+                               <widget name="arrowup" pixmap="skin_default/arrowup.png" position="-100,-100" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
+                               <widget name="arrowup2" pixmap="skin_default/arrowup.png" position="-100,-100" zPosition="11" size="37,70" transparent="1" alphatest="on"/>
+                       </panel>
+                       <panel position="left" size="110,*">
+                               <widget name="wizard" pixmap="skin_default/wizard.png" position="top" zPosition="10" size="110,174" alphatest="on"/>
+                               <panel position="top" size="*,30">
+                                       <ePixmap pixmap="skin_default/buttons/button_red.png" position="left" zPosition="0" size="15,16" alphatest="on" />
+                                       <widget name="languagetext" position="fill" font="Regular;18" />
+                               </panel>
+                       </panel>
+                       <panel position="left" size="10,*" />
+                       <panel position="right" size="10,*" />
+                       <panel position="fill">
+                               <widget name="text" position="top" size="*,270" font="Regular;23" valign="center" />
+                               <panel position="fill">
+                                       <panel position="left" size="150,*">
+                                               <widget name="portpic" position="top" zPosition="10" size="150,150" transparent="1" alphatest="on"/>
+                                       </panel>
+                                       <panel position="fill" layout="stack">
+                                               <widget source="list" render="Listbox" position="fill" scrollbarMode="showOnDemand" >
+                                                       <convert type="StringList" />
+                                               </widget>
+                                               <!--<widget name="config" position="fill" zPosition="1" scrollbarMode="showOnDemand" />-->
+                                       </panel>
+                               </panel>
+                       </panel>
+               </screen>"""
        
        def __init__(self, session):
                # FIXME anyone knows how to use relative paths from the plugin's directory?
index 61e1d5e..3270606 100644 (file)
@@ -16,25 +16,8 @@ from xml.sax import make_parser
 from xml.sax.handler import ContentHandler
 
 class WizardSummary(Screen):
-       skin = """
-       <screen position="0,0" size="132,64">
-               <widget source="text" render="Label" position="6,0" size="120,16" font="Regular;16" transparent="1" />
-               <widget source="parent.list" render="Label" position="6,18" size="120,46" font="Regular;12">
-                       <convert type="StringListSelection" />
-               </widget>
-       </screen>"""
-       
        def __init__(self, session, parent):
                Screen.__init__(self, session, parent)
-               
-               #names = parent.skinName
-               #if not isinstance(names, list):
-                       #names = [names]
-#                      
-               #self.skinName = [x + "_summary" for x in names ]
-               #self.skinName.append("Wizard")
-               #print "*************+++++++++++++++++****************++++++++++******************* WizardSummary", self.skinName
-                       #
                self["text"] = StaticText("")
                self.onShow.append(self.setCallback)
                
index 91fc80d..1a20197 100644 (file)
@@ -5,10 +5,9 @@ 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()
@@ -19,13 +18,12 @@ class WizardLanguage(Wizard):
                if newlanguage >= len(language.getLanguageList()):
                        newlanguage = 0
                language.activateLanguageIndex(newlanguage)
-               
                self.updateTexts()
 
        def updateLanguageDescription(self):
                print language.getLanguageList()[language.getActiveLanguageIndex()]
                self["languagetext"].setText(self.getTranslation(language.getLanguageList()[language.getActiveLanguageIndex()][1][0]))
-               
+
        def updateTexts(self):
                print "updateTexts"
                self.updateText(firstset = True)