add plugin (3g-modem-manager)
[vuplus_dvbapp] / lib / python / Plugins / SystemPlugins / Videomode / plugin.py
index 1b820fb..e7805fc 100644 (file)
@@ -3,16 +3,19 @@ from Plugins.Plugin import PluginDescriptor
 from Components.SystemInfo import SystemInfo
 from Components.ConfigList import ConfigListScreen
 from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider
 from Components.SystemInfo import SystemInfo
 from Components.ConfigList import ConfigListScreen
 from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider
+from Components.Sources.StaticText import StaticText
 
 from VideoHardware import video_hw
 
 config.misc.videowizardenabled = ConfigBoolean(default = True)
 
 class VideoSetup(Screen, ConfigListScreen):
 
 from VideoHardware import video_hw
 
 config.misc.videowizardenabled = ConfigBoolean(default = True)
 
 class VideoSetup(Screen, ConfigListScreen):
+
        def __init__(self, session, hw):
                Screen.__init__(self, session)
        def __init__(self, session, hw):
                Screen.__init__(self, session)
-               self.skinName = "Setup"
-               self.setup_title = "Videomode Setup"
+               # for the skin: first try VideoSetup, then Setup, this allows individual skinning
+               self.skinName = ["VideoSetup", "Setup" ]
+               self.setup_title = _("A/V Settings")
                self.hw = hw
                self.onChangedEntry = [ ]
 
                self.hw = hw
                self.onChangedEntry = [ ]
 
@@ -30,18 +33,15 @@ class VideoSetup(Screen, ConfigListScreen):
                                "save": self.apply,
                        }, -2)
 
                                "save": self.apply,
                        }, -2)
 
-               from Components.Label import Label
-               self["title"] = Label(_("A/V Settings"))
-
-               self["oktext"] = Label(_("OK"))
-               self["canceltext"] = Label(_("Cancel"))
-
-               from Components.Pixmap import Pixmap
-               self["ok"] = Pixmap()
-               self["cancel"] = Pixmap()
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("OK"))
 
                self.createSetup()
                self.grabLastGoodMode()
 
                self.createSetup()
                self.grabLastGoodMode()
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(self.setup_title)
 
        def startHotplug(self):
                self.hw.on_hotplug.append(self.createSetup)
 
        def startHotplug(self):
                self.hw.on_hotplug.append(self.createSetup)
@@ -95,11 +95,11 @@ class VideoSetup(Screen, ConfigListScreen):
                                        self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch))
 
                if level >= 1:
                                        self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch))
 
                if level >= 1:
-                       self.list.append(getConfigListEntry(_("AC3 default"), config.av.defaultac3))
+                       self.list.append(getConfigListEntry(_("Dolby Digital default"), config.av.defaultac3))
                        if SystemInfo["CanDownmixAC3"]:
                        if SystemInfo["CanDownmixAC3"]:
-                               self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3))
+                               self.list.append(getConfigListEntry(_("Dolby Digital downmix"), config.av.downmix_ac3))
                        self.list.extend((
                        self.list.extend((
-                               getConfigListEntry(_("General AC3 Delay"), config.av.generalAC3delay),
+                               getConfigListEntry(_("General Dolby Digital Delay"), config.av.generalAC3delay),
                                getConfigListEntry(_("General PCM Delay"), config.av.generalPCMdelay)
                        ))
 
                                getConfigListEntry(_("General PCM Delay"), config.av.generalPCMdelay)
                        ))
 
@@ -218,7 +218,7 @@ def startSetup(menuid):
        if menuid != "system": 
                return [ ]
 
        if menuid != "system": 
                return [ ]
 
-       return [(_("A/V Settings") + "...", videoSetupMain, "av_setup", 40)]
+       return [(_("A/V Settings"), videoSetupMain, "av_setup", 40)]
 
 def VideoWizard(*args, **kwargs):
        from VideoWizard import VideoWizard
 
 def VideoWizard(*args, **kwargs):
        from VideoWizard import VideoWizard
@@ -227,8 +227,8 @@ def VideoWizard(*args, **kwargs):
 def Plugins(**kwargs):
        list = [
 #              PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart),
 def Plugins(**kwargs):
        list = [
 #              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(name=_("Video Setup"), description=_("Advanced Video Setup"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=startSetup) 
        ]
        if config.misc.videowizardenabled.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, needsRestart = False, fnc=(0, VideoWizard)))
+       return list