aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-03-03 02:00:18 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-03-03 02:00:18 +0000
commit13e74ce7d8fcccc12bed3ce65c4f35987f206799 (patch)
tree8e66040d566caf1fe177098af5aa8c0200b4f6e0
parent4cdb4528bbff583dc193f24508157e96a0d95c59 (diff)
downloadenigma2-13e74ce7d8fcccc12bed3ce65c4f35987f206799.tar.gz
enigma2-13e74ce7d8fcccc12bed3ce65c4f35987f206799.zip
delete characters in the InputBox with mute key
-rw-r--r--data/keymap.xml20
-rw-r--r--lib/python/Components/Input.py4
-rw-r--r--lib/python/Screens/ChannelSelection.py2
-rw-r--r--lib/python/Screens/InputBox.py7
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 @@
<key id="KEY_OK" mapto="ok" flags="mr" />
<key id="KEY_EXIT" mapto="cancel" flags="mr" />
</map>
+
+ <map context="InputBoxActions">
+ <key id="KEY_LEFT" mapto="left" flags="mr" />
+ <key id="KEY_RIGHT" mapto="right" flags="mr" />
+ <key id="KEY_OK" mapto="ok" flags="m" />
+ <key id="KEY_EXIT" mapto="back" flags="m" />
+ <key id="KEY_MUTE" mapto="delete" flags="mr" />
+ <key id="KEY_1" mapto="1" flags="m" />
+ <key id="KEY_2" mapto="2" flags="m" />
+ <key id="KEY_3" mapto="3" flags="m" />
+ <key id="KEY_4" mapto="4" flags="m" />
+ <key id="KEY_5" mapto="5" flags="m" />
+ <key id="KEY_6" mapto="6" flags="m" />
+ <key id="KEY_7" mapto="7" flags="m" />
+ <key id="KEY_8" mapto="8" flags="m" />
+ <key id="KEY_9" mapto="9" flags="m" />
+ <key id="KEY_0" mapto="0" flags="m" />
+ </map>
<map context="WizardActions">
<key id="KEY_LEFT" mapto="left" flags="mr" />
@@ -97,7 +115,7 @@
<key id="KEY_OK" mapto="ok" flags="m" />
<key id="KEY_EXIT" mapto="back" flags="m" />
</map>
-
+
<map context="InfobarMenuActions">
<key id="KEY_MENU" mapto="mainMenu" flags="mr" />
</map>
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())