Show type of entry in cut list (and also color-code them)
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index 8789e877cac291941b2a140f8d60effe0dc05d23..03fe96bb58168f401a1fcc948e193238b3b84dc3 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -1,4 +1,4 @@
-from Tools.Profile import profile, profile_final
+from Tools.Profile import profile
 profile("LOAD:ElementTree")
 import xml.etree.cElementTree
 from os import path
@@ -14,7 +14,7 @@ from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCO
 from Tools.Import import my_import
 from Tools.LoadPixmap import LoadPixmap
 
-from Tools.XMLTools import elementsWithTag, mergeText
+from Tools.XMLTools import mergeText
 
 colorNames = dict()
 
@@ -145,9 +145,13 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1)
                                }[value])
                elif attrib == "orientation": # used by eSlider
                        try:
-                               guiObject.setOrientation(
-                                       { "orVertical": guiObject.orVertical,
-                                               "orHorizontal": guiObject.orHorizontal
+                               guiObject.setOrientation(*
+                                       { "orVertical": (guiObject.orVertical, False),
+                                               "orTopToBottom": (guiObject.orVertical, False),
+                                               "orBottomToTop": (guiObject.orVertical, True),
+                                               "orHorizontal": (guiObject.orHorizontal, False),
+                                               "orLeftToRight": (guiObject.orHorizontal, False),
+                                               "orRightToLeft": (guiObject.orHorizontal, True),
                                        }[value])
                        except KeyError:
                                print "oprientation must be either orVertical or orHorizontal!"
@@ -237,7 +241,7 @@ def loadSingleSkinData(desktop, skin, path_prefix):
                        id = 0
                if id == 0: # framebuffer
                        for res in c.findall("resolution"):
-                               get_attr = c.attrib.get
+                               get_attr = res.attrib.get
                                xres = get_attr("xres")
                                if xres:
                                        xres = int(xres)
@@ -256,6 +260,7 @@ def loadSingleSkinData(desktop, skin, path_prefix):
                                #print "Resolution:", xres,yres,bpp
                                from enigma import gFBDC
                                gFBDC.getInstance().setResolution(xres, yres)
+                               desktop.resize(eSize(xres, yres))
                                if bpp != 32:
                                        # load palette (not yet implemented)
                                        pass
@@ -269,7 +274,7 @@ def loadSingleSkinData(desktop, skin, path_prefix):
                                colorNames[name] = parseColor(color)
                                #print "Color:", name, color
                        else:
-                               raise ("need color and name, got %s %s" % (name, color))
+                               raise SkinError("need color and name, got %s %s" % (name, color))
 
        for c in skin.findall("fonts"):
                for font in c.findall("font"):
@@ -330,7 +335,7 @@ def loadSingleSkinData(desktop, skin, path_prefix):
                        try:
                                style.setColor(eWindowStyleSkinned.__dict__["col" + type], color)
                        except:
-                               raise ("Unknown color %s" % (type))
+                               raise SkinError("Unknown color %s" % (type))
                                #pass
 
                        #print "  color:", type, color
@@ -370,7 +375,8 @@ def readSkin(screen, skin, names, desktop):
                        break
 
        # otherwise try embedded skin
-       myscreen = myscreen or getattr(screen, "parsedSkin", None)
+       if myscreen is None:
+               myscreen = getattr(screen, "parsedSkin", None)
 
        # try uncompiled embedded skin
        if myscreen is None and getattr(screen, "skin", None):