just recalc length of visible entries in movie selection
[enigma2.git] / lib / python / Components / UsageConfig.py
1 from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection
2 from enigma import Misc_Options
3 import os
4
5 def InitUsageConfig():
6         config.usage = ConfigSubsection();
7         config.usage.showdish = ConfigYesNo(default = False)
8         config.usage.multibouquet = ConfigYesNo(default = False)
9         config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
10         config.usage.e1like_radio_mode = ConfigYesNo(default = False)
11         config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
12                 ("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
13                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
14                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
15         config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
16         config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
17         config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
18         config.usage.hdd_standby = ConfigSelection(default = "120", choices = [
19                 ("0", _("no standby")), ("2", "10 " + _("seconds")), ("6", "30 " + _("seconds")),
20                 ("12", "1 " + _("minute")), ("24", "2 " + _("minutes")),
21                 ("60", "5 " + _("minutes")), ("120", "10 " + _("minutes")), ("240", "20 " + _("minutes")),
22                 ("241", "30 " + _("minutes")), ("242", "1 " + _("hour")), ("244", "2 " + _("hours")),
23                 ("248", "4 " + _("hours")) ])
24         config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
25                 ("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])
26
27         def setHDDStandby(configElement):
28                 os.system("hdparm -S" + configElement.value + " /dev/ide/host0/bus0/target0/lun0/disc")
29         config.usage.hdd_standby.addNotifier(setHDDStandby)
30
31         def set12VOutput(configElement):
32                 if configElement.value == "on":
33                         Misc_Options.getInstance().set_12V_output(1)
34                 elif configElement.value == "off":
35                         Misc_Options.getInstance().set_12V_output(0)
36         config.usage.output_12V.addNotifier(set12VOutput)