diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2008-02-11 23:42:08 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2008-02-11 23:42:08 +0000 |
| commit | e66f4bdb5fd20a77e5db713d732275aa32b22af5 (patch) | |
| tree | 1db2063d2991f1005d72efdd3a690a0a6705119e /lib/python/Components/config.py | |
| parent | 5ce65d82dcb11e8c5886be467fefecc5e70d4868 (diff) | |
| download | enigma2-e66f4bdb5fd20a77e5db713d732275aa32b22af5.tar.gz enigma2-e66f4bdb5fd20a77e5db713d732275aa32b22af5.zip | |
text edit patch #5 by Anders Holst
Diffstat (limited to 'lib/python/Components/config.py')
| -rw-r--r-- | lib/python/Components/config.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index f8ef0ec8..861e70bf 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -98,8 +98,11 @@ class ConfigElement(object): def __call__(self, selected): return self.getMulti(selected) - def helpWindow(self): - return None + def onSelect(self, session): + pass + + def onDeselect(self, session): + pass KEY_LEFT = 0 KEY_RIGHT = 1 @@ -558,7 +561,7 @@ class ConfigText(ConfigElement, NumericalTextInput): self.visible_width = visible_width self.offset = 0 self.overwrite = fixed_size - + self.help_window = None self.value = self.default = default def validateMarker(self): @@ -668,8 +671,12 @@ class ConfigText(ConfigElement, NumericalTextInput): self.insertChar(newChar, self.marked_pos, owr) elif key == KEY_TIMEOUT: self.timeout() + if self.help_window: + self.help_window.update(self) return + if self.help_window: + self.help_window.update(self) self.validateMarker() self.changed() @@ -708,9 +715,19 @@ class ConfigText(ConfigElement, NumericalTextInput): mark = [self.marked_pos] return ("mtext"[1-selected:], self.value+" ", mark) - def helpWindow(self): - from Screens.NumericalTextInputHelpDialog import NumericalTextInputHelpDialog - return (NumericalTextInputHelpDialog,self) + def onSelect(self, session): + self.allmarked = (self.value != "") + if session is not None: + from Screens.NumericalTextInputHelpDialog import NumericalTextInputHelpDialog + self.help_window = session.instantiateDialog(NumericalTextInputHelpDialog, self) + self.help_window.show() + + def onDeselect(self, session): + self.marked_pos = 0 + self.offset = 0 + if self.help_window: + session.deleteDialog(self.help_window) + self.help_window = None def getHTML(self, id): return '<input type="text" name="' + id + '" value="' + self.value + '" /><br>\n' |
