GraphMultiEpgSetup.py: Remove unused Directories.* import
[openblackhole/openblackhole-enigma2.git] / lib / python / Plugins / Extensions / GraphMultiEPG / GraphMultiEpgSetup.py
1 from Screens.Screen import Screen
2 from Screens.MessageBox import MessageBox
3 from Screens.Console import Console
4 from Components.ActionMap import ActionMap, NumberActionMap
5 from Components.Pixmap import Pixmap
6 from Components.Label import Label
7 from Components.MenuList import MenuList
8 from Components.PluginComponent import plugins
9 from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigEnableDisable, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry, ConfigNumber
10 from Components.ConfigList import ConfigList, ConfigListScreen
11
12 addnotifier = None
13
14 class GraphMultiEpgSetup(Screen, ConfigListScreen):
15         skin = """
16                 <screen name="GraphMultiEPGSetup" position="center,center" size="560,435" title="Electronic Program Guide Setup">
17                         <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
18                         <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
19                         <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
20                         <ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
21                         <widget name="canceltext" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
22                         <widget name="oktext" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
23                         <widget name="config" position="10,50" size="550,395" />
24                 </screen>"""
25
26         def __init__(self, session, args = None):
27                 Screen.__init__(self, session)
28                 self.setTitle(_("GraphMultiEpg Settings"))
29
30                 self["oktext"] = Label(_("OK"))
31                 self["canceltext"] = Label(_("Cancel"))
32
33                 self["actions"] = ActionMap(["SetupActions", "MenuActions"],
34                 {
35                         "ok": self.keySave,
36                         "save": self.keySave,
37                         "cancel": self.keyCancel,
38                         "menu": self.closeRecursive,
39                 }, -1)
40
41                 self.onChangedEntry = [ ]
42                 self.session = session
43                 self.list = []
44                 ConfigListScreen.__init__(self, self.list, session = self.session)
45                 self.createSetup()
46
47         def createSetup(self):
48                 global addnotifier
49                 self.list = [ ]
50                 self.list.append(getConfigListEntry(_("Event font size (relative to skin size)"), config.misc.graph_mepg.ev_fontsize))
51                 self.list.append(getConfigListEntry(_("Time scale"), config.misc.graph_mepg.prev_time_period))
52                 self.list.append(getConfigListEntry(_("Prime time"), config.misc.graph_mepg.prime_time))
53                 self.list.append(getConfigListEntry(_("Items per page "), config.misc.graph_mepg.items_per_page))
54                 self.list.append(getConfigListEntry(_("Items per page for list screen"), config.misc.graph_mepg.items_per_page_listscreen))
55                 self.list.append(getConfigListEntry(_("Start with list screen"), config.misc.graph_mepg.default_mode))
56                 self.list.append(getConfigListEntry(_("Skip empty services"), config.misc.graph_mepg.overjump))
57                 self.list.append(getConfigListEntry(_("Service title mode"), config.misc.graph_mepg.servicetitle_mode))
58                 self.list.append(getConfigListEntry(_("Round start time on"), config.misc.graph_mepg.roundTo))
59                 self.list.append(getConfigListEntry(_("Function of OK button"), config.misc.graph_mepg.OKButton))
60                 self.list.append(getConfigListEntry(_("Alignment of service names"), config.misc.graph_mepg.servicename_alignment))
61                 self.list.append(getConfigListEntry(_("Alignment of events"), config.misc.graph_mepg.event_alignment))
62                 self.list.append(getConfigListEntry(_("Show vertical timelines"), config.misc.graph_mepg.show_timelines))
63                 self.list.append(getConfigListEntry(_("Center time-labels and remove date"), config.misc.graph_mepg.center_timeline))
64                 self.list.append(getConfigListEntry(_("Show in extensions menu"), config.misc.graph_mepg.extension_menu))
65                 self.list.append(getConfigListEntry(_("Silently zap between bouquets"), config.misc.graph_mepg.silent_bouquet_change))
66                 if addnotifier is None:
67                         addnotifier = config.misc.graph_mepg.extension_menu.addNotifier(plugins.reloadPlugins, initial_call=False)
68
69                 self["config"].list = self.list
70                 self["config"].l.setList(self.list)