add option to select a keymap for a attached keyboard.
[enigma2.git] / lib / python / Components / SetupDevices.py
1 from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigText
2 from Components.Timezones import timezones
3 from Components.Language import language
4 from Components.Keyboard import keyboard
5
6 def InitSetupDevices():
7         
8         def timezoneNotifier(configElement):
9                 timezones.activateTimezone(configElement.index)
10                 
11         config.timezone = ConfigSubsection();
12         config.timezone.val = ConfigSelection(default = timezones.getDefaultTimezone(), choices = timezones.getTimezoneList())
13         config.timezone.val.addNotifier(timezoneNotifier)
14
15         def keyboardNotifier(configElement):
16                 keyboard.activateKeyboardMap(configElement.index)
17
18         config.keyboard = ConfigSubsection();
19         config.keyboard.keymap = ConfigSelection(default = keyboard.getDefaultKeyboardMap(), choices = keyboard.getKeyboardMaplist())
20         config.keyboard.keymap.addNotifier(keyboardNotifier)
21
22         def languageNotifier(configElement):
23                 language.activateLanguage(configElement.value)
24         
25         config.osd = ConfigSubsection()
26         config.osd.language = ConfigText(default = "en_EN");
27         config.osd.language.addNotifier(languageNotifier)
28
29         config.parental = ConfigSubsection();
30         config.parental.lock = ConfigOnOff(default = False)
31         config.parental.setuplock = ConfigOnOff(default = False)
32
33         config.expert = ConfigSubsection();
34         config.expert.satpos = ConfigOnOff(default = True)
35         config.expert.fastzap = ConfigOnOff(default = True)
36         config.expert.skipconfirm = ConfigOnOff(default = False)
37         config.expert.hideerrors = ConfigOnOff(default = False)
38         config.expert.autoinfo = ConfigOnOff(default = True)