Merge commit 'origin/bug_138_networkwizard_fixes' into experimental
[enigma2.git] / lib / python / Plugins / SystemPlugins / VideoTune / plugin.py
1 from Plugins.Plugin import PluginDescriptor
2
3 def videoFinetuneMain(session, **kwargs):
4         from VideoFinetune import VideoFinetune
5         session.open(VideoFinetune)
6
7 def videoFinetuneWizard(*args, **kwargs):
8         # the way the video wizard tells this plugin that the "testcard" should be displayed is not so nice yet.
9         show_testcard = False
10         try:
11                 from Components.config import config
12                 show_testcard = config.misc.showtestcard.value
13         except KeyError:
14                 print "not showing fine-tuning wizard, config variable doesn't exist"
15         if show_testcard:
16                 from VideoFinetune import VideoFinetune
17                 config.misc.showtestcard.value = False
18                 return VideoFinetune(*args, **kwargs)
19         else:
20                 print "showtestcard is false"
21                 from Screens.Screen import Screen
22                 class Dummy(Screen):
23                         skin = "<screen></screen>"
24                         def __init__(self, session):
25                                 Screen.__init__(self, session)
26                                 self.close()
27                 return Dummy(*args, **kwargs)
28
29 def startSetup(menuid):
30         if menuid != "system": 
31                 return [ ]
32
33         return [(_("Video Fine-Tuning"), videoFinetuneMain, "video_finetune", None)]
34
35 def Plugins(**kwargs):
36         return [
37                 PluginDescriptor(name=_("Video Fine-Tuning"), description=_("fine-tune your display"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup),
38                 PluginDescriptor(name=_("Video Fine-Tuning Wizard"), where = PluginDescriptor.WHERE_WIZARD, fnc=(1, videoFinetuneWizard))
39         ]