diff options
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Converter/MenuEntryCompare.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/MenuEntryCompare.py b/lib/python/Components/Converter/MenuEntryCompare.py new file mode 100644 index 00000000..42cdc5d1 --- /dev/null +++ b/lib/python/Components/Converter/MenuEntryCompare.py @@ -0,0 +1,25 @@ +from Components.Converter.Converter import Converter +from Components.Element import cached + +class MenuEntryCompare(Converter, object): + def __init__(self, type): + Converter.__init__(self, type) + self.entry_id = type + + def selChanged(self): + self.downstream_elements.changed((self.CHANGED_ALL, 0)) + + @cached + def getBool(self): + id = self.entry_id + cur = self.source.current + if cur and len(cur) > 2: + EntryID = cur[2] + return EntryID and id and id == EntryID + return False + + boolean = property(getBool) + + def changed(self, *args, **kwargs): + if args[0][0] == self.CHANGED_DEFAULT: + self.source.onSelectionChanged.append(self.selChanged) |
