From 13e74ce7d8fcccc12bed3ce65c4f35987f206799 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 3 Mar 2006 02:00:18 +0000 Subject: [PATCH] delete characters in the InputBox with mute key --- data/keymap.xml | 20 +++++++++++++++++++- lib/python/Components/Input.py | 4 ++++ lib/python/Screens/ChannelSelection.py | 2 +- lib/python/Screens/InputBox.py | 7 +++++-- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/data/keymap.xml b/data/keymap.xml index 3641df94..ffcfa95d 100644 --- a/data/keymap.xml +++ b/data/keymap.xml @@ -88,6 +88,24 @@ + + + + + + + + + + + + + + + + + + @@ -97,7 +115,7 @@ - + diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py index f1a17d90..a3ab764e 100644 --- a/lib/python/Components/Input.py +++ b/lib/python/Components/Input.py @@ -69,6 +69,10 @@ class Input(HTMLComponent, GUIComponent, VariableText): self.text = self.text[0:self.currPos] + newNumber + self.text[self.currPos + 1:] self.update() + def delete(self): + self.text = self.text[:self.currPos] + self.text[self.currPos + 1:] + self.update() + def number(self, number): if self.type == self.TEXT: newChar = self.numericalTextInput.getKey(number) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 8b3fe93c..db279451 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -103,7 +103,7 @@ class ChannelContextMenu(Screen): self.close(False) def showBouquetInputBox(self): - self.session.openWithCallback(self.bouquetInputCallback, InputBox, title=_("Please enter a name for the new bouquet"), text="neues_bouquet", maxSize=False, type=Input.TEXT) + self.session.openWithCallback(self.bouquetInputCallback, InputBox, title=_("Please enter a name for the new bouquet"), text="bouquetname", maxSize=False, type=Input.TEXT) def bouquetInputCallback(self, bouquet): if bouquet is not None: diff --git a/lib/python/Screens/InputBox.py b/lib/python/Screens/InputBox.py index 57745ca7..47b800df 100644 --- a/lib/python/Screens/InputBox.py +++ b/lib/python/Screens/InputBox.py @@ -15,12 +15,13 @@ class InputBox(Screen): self["text"] = Label(title) self["input"] = Input(**kwargs) - self["actions"] = NumberActionMap(["WizardActions", "InputActions"], + self["actions"] = NumberActionMap(["WizardActions", "InputBoxActions"], { "ok": self.go, "back": self.cancel, "left": self.keyLeft, "right": self.keyRight, + "delete": self.keyDelete, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, @@ -40,9 +41,11 @@ class InputBox(Screen): self["input"].right() def keyNumberGlobal(self, number): - print "pressed", number self["input"].number(number) + def keyDelete(self): + self["input"].delete() + def go(self): self.close(self["input"].getText()) -- 2.30.2