aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/MenuList.py3
-rw-r--r--lib/python/Components/ParentalControl.py32
-rw-r--r--lib/python/Components/config.py2
-rw-r--r--lib/python/Screens/Wizard.py3
4 files changed, 23 insertions, 17 deletions
diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py
index b1b115b7..70875747 100644
--- a/lib/python/Components/MenuList.py
+++ b/lib/python/Components/MenuList.py
@@ -30,6 +30,9 @@ class MenuList(HTMLComponent, GUIComponent):
for f in self.onSelectionChanged:
f()
+ def getSelectedIndex(self):
+ return self.l.getCurrentSelectionIndex()
+
def setList(self, list):
self.list = list
self.l.setList(self.list)
diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py
index bcd788d7..b9c31c4b 100644
--- a/lib/python/Components/ParentalControl.py
+++ b/lib/python/Components/ParentalControl.py
@@ -65,14 +65,14 @@ class ParentalControl:
def isServicePlayable(self, service, callback):
if not config.ParentalControl.configured.value:
return True
- print "whitelist:", self.whitelist
- print "blacklist:", self.blacklist
- print "config.ParentalControl.type.value:", config.ParentalControl.type.value
- print "not in whitelist:", (service not in self.whitelist)
- print "checking parental control for service:", service
+ #print "whitelist:", self.whitelist
+ #print "blacklist:", self.blacklist
+ #print "config.ParentalControl.type.value:", config.ParentalControl.type.value
+ #print "not in whitelist:", (service not in self.whitelist)
+ #print "checking parental control for service:", service
if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist):
self.callback = callback
- print "service:", ServiceReference(service).getServiceName()
+ #print "service:", ServiceReference(service).getServiceName()
levelNeeded = 0
if self.serviceLevel.has_key(service):
levelNeeded = self.serviceLevel[service]
@@ -83,29 +83,29 @@ class ParentalControl:
return True
def protectService(self, service):
- print "protect"
- print "config.ParentalControl.type.value:", config.ParentalControl.type.value
+ #print "protect"
+ #print "config.ParentalControl.type.value:", config.ParentalControl.type.value
if config.ParentalControl.type.value == "whitelist":
if service in self.whitelist:
self.deleteWhitelistService(service)
else: # blacklist
if service not in self.blacklist:
self.addBlacklistService(service)
- print "whitelist:", self.whitelist
- print "blacklist:", self.blacklist
+ #print "whitelist:", self.whitelist
+ #print "blacklist:", self.blacklist
def unProtectService(self, service):
- print "unprotect"
- print "config.ParentalControl.type.value:", config.ParentalControl.type.value
+ #print "unprotect"
+ #print "config.ParentalControl.type.value:", config.ParentalControl.type.value
if config.ParentalControl.type.value == "whitelist":
if service not in self.whitelist:
self.addWhitelistService(service)
else: # blacklist
if service in self.blacklist:
self.deleteBlacklistService(service)
- print "whitelist:", self.whitelist
- print "blacklist:", self.blacklist
+ #print "whitelist:", self.whitelist
+ #print "blacklist:", self.blacklist
def getProtectionLevel(self, service):
if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist):
@@ -134,12 +134,12 @@ class ParentalControl:
# print "pin entered for service", service, "and pin was", pin
#if pin is not None and int(pin) in pinList:
if result is not None and result:
- print "pin ok, playing service"
+ #print "pin ok, playing service"
self.callback(ref = ServiceReference(service).ref)
else:
if result is not None:
Notifications.AddNotification(MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR)
- print "wrong pin entered"
+ #print "wrong pin entered"
def saveWhitelist(self):
file = open(resolveFilename(SCOPE_CONFIG, "whitelist"), 'w')
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index b255f55a..b7b3baa8 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -820,7 +820,7 @@ config = Config()
config.misc = ConfigSubsection()
class ConfigFile:
- CONFIG_FILE = resolveFilename(SCOPE_CONFIG, "config2")
+ CONFIG_FILE = resolveFilename(SCOPE_CONFIG, "settings")
def load(self):
try:
diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py
index 036c81de..8c4f8867 100644
--- a/lib/python/Screens/Wizard.py
+++ b/lib/python/Screens/Wizard.py
@@ -3,6 +3,7 @@ from Screen import Screen
import string
from Screens.HelpMenu import HelpableScreen
+from Components.config import config
from Components.Label import Label
from Components.Slider import Slider
from Components.ActionMap import HelpableActionMap, NumberActionMap
@@ -155,6 +156,7 @@ class Wizard(Screen, HelpableScreen):
def ok(self):
print "OK"
currStep = self.currStep
+
if self.showConfig:
if (self.wizard[currStep]["config"]["screen"] != None):
# TODO: don't die, if no run() is available
@@ -244,6 +246,7 @@ class Wizard(Screen, HelpableScreen):
for x in self.wizard[self.currStep]["list"]:
self.list.append((_(x[0]), None))
self["list"].l.setList(self.list)
+ self["list"].moveToIndex(0)
if self.showConfig:
self["config"].instance.setZPosition(1)