X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6eeefece35e4269e02fdb7abab4f79d8e7b8f98b..51b1571e9e31d9f7ab1055f562a397a9bfa427ab:/lib/python/Plugins/Extensions/FritzCall/plugin.py diff --git a/lib/python/Plugins/Extensions/FritzCall/plugin.py b/lib/python/Plugins/Extensions/FritzCall/plugin.py index 816d3c35..631cb4c0 100644 --- a/lib/python/Plugins/Extensions/FritzCall/plugin.py +++ b/lib/python/Plugins/Extensions/FritzCall/plugin.py @@ -1,6 +1,6 @@ from Screens.Screen import Screen from Screens.MessageBox import MessageBox -from Components.ActionMap import NumberActionMap +from Components.ActionMap import ActionMap from Components.Label import Label from Plugins.Plugin import PluginDescriptor from Tools import Notifications @@ -13,14 +13,14 @@ from enigma import eTimer my_global_session = None -from Components.config import config, ConfigSubsection, ConfigIP, ConfigEnableDisable -from Components.ConfigList import ConfigList +from Components.config import config, ConfigSubsection, ConfigIP, ConfigEnableDisable, getConfigListEntry +from Components.ConfigList import ConfigList, ConfigListScreen config.FritzCall = ConfigSubsection() config.FritzCall.hostname = ConfigIP(default = [192,168,178,254]) -config.FritzCall.enable = ConfigEnableDisable() +config.FritzCall.enable = ConfigEnableDisable(default = False) -class FritzCallSetup(Screen): +class FritzCallSetup(ConfigListScreen, Screen): skin = """ @@ -30,7 +30,6 @@ class FritzCallSetup(Screen): def __init__(self, session, args = None): from Tools.BoundFunction import boundFunction - print "screen init" Screen.__init__(self, session) self.onClose.append(self.abort) @@ -38,31 +37,15 @@ class FritzCallSetup(Screen): self.list = [ ] self.list.append(getConfigListEntry(_("Call monitoring"), config.FritzCall.enable)) self.list.append(getConfigListEntry(_("Fritz!Box FON IP address"), config.FritzCall.hostname)) - self["config"] = ConfigList(self.list) + ConfigListScreen.__init__(self, self.list) - # DO NOT ASK. - self["setupActions"] = NumberActionMap(["SetupActions"], + # DO NOT ASK. + self["setupActions"] = ActionMap(["SetupActions"], { - "left": boundFunction(self["config"].handleKey, config.key["prevElement"]), - "right": boundFunction(self["config"].handleKey, config.key["nextElement"]), - "1": self.keyNumberGlobal, - "2": self.keyNumberGlobal, - "3": self.keyNumberGlobal, - "4": self.keyNumberGlobal, - "5": self.keyNumberGlobal, - "6": self.keyNumberGlobal, - "7": self.keyNumberGlobal, - "8": self.keyNumberGlobal, - "9": self.keyNumberGlobal, - "0": self.keyNumberGlobal, "save": self.save, "cancel": self.cancel, "ok": self.save, - }, -1) - # FIX ME. - def keyNumberGlobal(self, number): - if self["config"].getCurrent()[1].parent.enabled == True: - self["config"].handleKey(config.key[str(number)]) + }, -2) def abort(self): print "aborting"