store config in /etc/enigma2 and create the path if needed
[enigma2.git] / lib / python / Screens / Wizard.py
1 from Screen import Screen
2
3 from Screens.HelpMenu import HelpableScreen
4 from Components.Label import Label
5 from Components.ActionMap import HelpableActionMap
6 from Components.config import config, configElementBoolean
7
8 config.misc.firstrun = configElementBoolean("config.misc.firstrun", 1);
9
10 class WelcomeWizard(Screen, HelpableScreen):
11
12         skin = """
13                 <screen position="140,125" size="460,350" title="Welcome...">
14                         <widget name="text" position="20,20" size="440,300" font="Arial;30" />
15                 </screen>"""
16
17         def __init__(self, session):
18                 self.skin = WelcomeWizard.skin
19
20                 Screen.__init__(self, session)
21                 HelpableScreen.__init__(self)
22
23
24                 self["text"] = Label(_("Welcome!\n\nYou can always press the help key!\n\nPlease Note: Do a service search first!"));
25                 
26                 self["actions"] = HelpableActionMap(self, "OkCancelActions",
27                         {
28                                 "ok": (self.ok, _("Close this Screen...")),
29                         })
30
31         def ok(self):
32                 config.misc.firstrun.value = 0;
33                 config.misc.firstrun.save()
34                 self.session.close()
35
36 def listActiveWizards():
37         wizards = [ ]
38
39         if config.misc.firstrun.value:
40                 wizards.append(WelcomeWizard)
41         
42         return wizards