SystemPlugins/Videomode: show HDMI on DM500HD instead of DVI
[vuplus_dvbapp] / lib / python / Plugins / SystemPlugins / Videomode / VideoHardware.py
index 6a85c4d..adc63d2 100644 (file)
@@ -2,6 +2,7 @@ from enigma import eTimer
 from Components.config import config, ConfigSelection, ConfigSubDict, ConfigYesNo
 
 from Tools.CList import CList
+from Tools.HardwareInfo import HardwareInfo
 
 # The "VideoHardware" is the interface to /proc/stb/video.
 # It generates hotplug events, and gives you the list of 
@@ -67,7 +68,7 @@ class VideoHardware:
                else:
                        mode = config.av.videomode[port].value
                        force_widescreen = self.isWidescreenMode(port, mode)
-                       is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"]
+                       is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10")
                        is_auto = config.av.aspect.value == "auto"
                        if is_widescreen:
                                if force_widescreen:
@@ -95,6 +96,10 @@ class VideoHardware:
 
                self.readAvailableModes()
 
+               if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"):
+                       print "remove DVI-PC because of not existing modes"
+                       del self.modes["DVI-PC"]
+
                self.createConfig()
 #              self.on_hotplug.append(self.createConfig)
 
@@ -224,20 +229,27 @@ class VideoHardware:
                return res
 
        def createConfig(self, *args):
-               # create list of output ports
-               portlist = self.getPortList()
+               hw_type = HardwareInfo().get_device_name()
+               lst = []
 
-               # create list of available modes
-               config.av.videoport = ConfigSelection(choices = [(port, _(port)) for port in portlist])
                config.av.videomode = ConfigSubDict()
                config.av.videorate = ConfigSubDict()
 
+               # create list of output ports
+               portlist = self.getPortList()
                for port in portlist:
+                       descr = port
+                       if descr == 'DVI' and hw_type == 'dm500hd':
+                               descr = 'HDMI'
+                       lst.append((port, descr))
+
+                       # create list of available modes
                        modes = self.getModeList(port)
                        if len(modes):
                                config.av.videomode[port] = ConfigSelection(choices = [mode for (mode, rates) in modes])
                        for (mode, rates) in modes:
                                config.av.videorate[mode] = ConfigSelection(choices = rates)
+               config.av.videoport = ConfigSelection(choices = lst)
 
        def setConfiguredMode(self):
                port = config.av.videoport.value
@@ -283,7 +295,7 @@ class VideoHardware:
 
                force_widescreen = self.isWidescreenMode(port, mode)
 
-               is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"]
+               is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10")
                is_auto = config.av.aspect.value == "auto"
                policy2 = "policy" # use main policy