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 0c5f336836c886866c4b7c46539c9d25dd13d4cd..03fe96bb58168f401a1fcc948e193238b3b84dc3 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -144,23 +144,17 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1)
                                  "blend": 2,
                                }[value])
                elif attrib == "orientation": # used by eSlider
-                       if value in ("orHorizontal", "orLeftToRight"):
-                               orientation = guiObject.orHorizontal
-                               direction = guiObject.dirNormal
-                       elif value in ("orVertical", "orTopToBottom"):
-                               orientation = guiObject.orVertical
-                               direction = guiObject.dirNormal
-                       elif value == "orRightToLeft":
-                               orientation = guiObject.orHorizontal
-                               direction = guiObject.dirSwapped
-                       elif value == "orBottomToTop":
-                               orientation = guiObject.orVertical
-                               direction = guiObject.dirSwapped
-                       else:
-                               print "orientation must be one of: orTopToBottom,orBottomToTop,orLeftToRight,orRightToLeft"
-                               return
-                       guiObject.setOrientation(orientation)
-                       guiObject.setDirection(direction)
+                       try:
+                               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!"
                elif attrib == "valign":
                        try:
                                guiObject.setVAlign(
@@ -280,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"):
@@ -341,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