Fix network test.
[vuplus_dvbapp] / lib / python / Components / Input.py
index 3c09ab9..017d109 100644 (file)
@@ -116,7 +116,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                self.allmarked = False
                if self.type == self.TEXT:
                        self.timeout()
-               if self.Text[self.currPos] == "9" or self.Text[self.currPos] == " ":
+               if self.currPos == len(self.Text) or self.Text[self.currPos] == "9" or self.Text[self.currPos] == " ":
                        newNumber = "0"
                else:
                        newNumber = str(int(self.Text[self.currPos]) + 1)
@@ -127,7 +127,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                self.allmarked = False
                if self.type == self.TEXT:
                        self.timeout()
-               if self.Text[self.currPos] == "0" or self.Text[self.currPos] == " ":
+               if self.currPos == len(self.Text) or self.Text[self.currPos] == "0" or self.Text[self.currPos] == " ":
                        newNumber = "9"
                else:
                        newNumber = str(int(self.Text[self.currPos]) - 1)
@@ -225,7 +225,12 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                if self.allmarked:
                        self.deleteAllChars()
                        self.allmarked = False
-               self.insertChar(unichr(code), self.currPos, False, False);
+               #self.insertChar(unichr(code), self.currPos, False, False);
+               from Components.config import getCharValue
+               newcode = getCharValue(code)
+               if newcode is None:
+                       return
+               self.insertChar(newcode, self.currPos, False, False);
                self.innerright()
                self.update()