From 468f9d6d40262c6cc75a06afd2dfa232bd91bfd9 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sun, 28 Oct 2007 09:22:33 +0000 Subject: parental control: automatically wrap to validation pin entry in pin changing dialog when 4 figures were entered leave dialog when 4 figures were entered in the validation pin entry --- lib/python/Components/ConfigList.py | 4 ++++ lib/python/Components/config.py | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py index 7ed6031a..47b577e2 100644 --- a/lib/python/Components/ConfigList.py +++ b/lib/python/Components/ConfigList.py @@ -48,6 +48,10 @@ class ConfigList(HTMLComponent, GUIComponent, object): def getCurrentIndex(self): return self.l.getCurrentSelectionIndex() + def setCurrentIndex(self, index): + if self.instance is not None: + self.instance.moveSelectionTo(index) + def invalidateCurrent(self): self.l.invalidateEntry(self.l.getCurrentSelectionIndex()) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index a872c300..de06871a 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -328,6 +328,8 @@ class ConfigSequence(ConfigElement): self.default = default self.value = copy.copy(default) + + self.endNotifier = [] def validate(self): max_pos = 0 @@ -344,6 +346,8 @@ class ConfigSequence(ConfigElement): num += 1 if self.marked_pos >= max_pos: + for x in self.endNotifier: + x(self) self.marked_pos = max_pos - 1 if self.marked_pos < 0: @@ -357,6 +361,9 @@ class ConfigSequence(ConfigElement): if self.marked_pos >= total_len: self.marked_pos = total_len - 1 + + def addEndNotifier(self, notifier): + self.endNotifier.append(notifier) def handleKey(self, key): if key == KEY_LEFT: -- cgit v1.2.3