reenable PC mode video selection for dvi ports in the video wizard
[enigma2.git] / lib / python / Plugins / SystemPlugins / Videomode / plugin.py
index 3536ca66ae1fd3fbad557716522cb459d7c17e28..115e81f77a38f887611b0391857fef18aa8ce8b3 100644 (file)
@@ -1,12 +1,13 @@
 from Screens.Screen import Screen
 from Plugins.Plugin import PluginDescriptor
 from Screens.Screen import Screen
 from Plugins.Plugin import PluginDescriptor
-
+from Components.SystemInfo import SystemInfo
 from Components.ConfigList import ConfigListScreen
 from Components.ConfigList import ConfigListScreen
-from Components.config import getConfigListEntry, config
-from Components.config import config
+from Components.config import getConfigListEntry, config, ConfigBoolean
 
 from VideoHardware import video_hw
 
 
 from VideoHardware import video_hw
 
+config.misc.videowizardenabled = ConfigBoolean(default = True)
+
 class VideoSetup(Screen, ConfigListScreen):
        def __init__(self, session, hw):
                Screen.__init__(self, session)
 class VideoSetup(Screen, ConfigListScreen):
        def __init__(self, session, hw):
                Screen.__init__(self, session)
@@ -60,16 +61,36 @@ class VideoSetup(Screen, ConfigListScreen):
                        self.list.append(getConfigListEntry(_("Mode"), config.av.videomode[config.av.videoport.value]))
                        self.list.append(getConfigListEntry(_("Refresh Rate"), config.av.videorate[config.av.videomode[config.av.videoport.value].value]))
 
                        self.list.append(getConfigListEntry(_("Mode"), config.av.videomode[config.av.videoport.value]))
                        self.list.append(getConfigListEntry(_("Refresh Rate"), config.av.videorate[config.av.videomode[config.av.videoport.value].value]))
 
+               port = config.av.videoport.value
+               if port not in config.av.videomode:
+                       mode = None
+               else:
+                       mode = config.av.videomode[port].value
+
+               # some modes (720p, 1080i) are always widescreen. Don't let the user select something here, "auto" is not what he wants.
+               force_wide = self.hw.isWidescreenMode(port, mode)
+
+               if not force_wide:
+                       self.list.append(getConfigListEntry(_("Aspect Ratio"), config.av.aspect))
+
+               if force_wide or config.av.aspect.value in ["16_9", "16_10"]:
+                       self.list.append(getConfigListEntry(_("Display 4:3 content as"), config.av.policy_43))
+               elif config.av.aspect.value == "4_3":
+                       self.list.append(getConfigListEntry(_("Display 16:9 content as"), config.av.policy_169))
+
 #              if config.av.videoport.value == "DVI":
 #                      self.list.append(getConfigListEntry(_("Allow Unsupported Modes"), config.av.edid_override))
                if config.av.videoport.value == "Scart":
                        self.list.append(getConfigListEntry(_("Color Format"), config.av.colorformat))
 #              if config.av.videoport.value == "DVI":
 #                      self.list.append(getConfigListEntry(_("Allow Unsupported Modes"), config.av.edid_override))
                if config.av.videoport.value == "Scart":
                        self.list.append(getConfigListEntry(_("Color Format"), config.av.colorformat))
-                       self.list.append(getConfigListEntry(_("Aspect Ratio"), config.av.aspectratio))
                        if level >= 1:
                                self.list.append(getConfigListEntry(_("WSS on 4:3"), config.av.wss))
                        if level >= 1:
                                self.list.append(getConfigListEntry(_("WSS on 4:3"), config.av.wss))
+                               if SystemInfo["ScartSwitch"]:
+                                       self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch))
 
                if level >= 1:
                        self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
 
                if level >= 1:
                        self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
+                       if SystemInfo["CanDownmixAC3"]:
+                               self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3))
 
                self["config"].list = self.list
                self["config"].l.setList(self.list)
 
                self["config"].list = self.list
                self["config"].l.setList(self.list)
@@ -188,6 +209,6 @@ def Plugins(**kwargs):
 #              PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart),
                PluginDescriptor(name=_("Video Setup"), description=_("Advanced Video Setup"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup) 
        ]
 #              PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart),
                PluginDescriptor(name=_("Video Setup"), description=_("Advanced Video Setup"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup) 
        ]
-       if config.misc.firstrun.value:
+       if config.misc.videowizardenabled.value:
                list.append(PluginDescriptor(name=_("Video Wizard"), where = PluginDescriptor.WHERE_WIZARD, fnc=(0, VideoWizard)))
        return list
                list.append(PluginDescriptor(name=_("Video Wizard"), where = PluginDescriptor.WHERE_WIZARD, fnc=(0, VideoWizard)))
        return list