git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/translations'
[enigma2.git]
/
lib
/
python
/
Components
/
Renderer
/
Listbox.py
diff --git
a/lib/python/Components/Renderer/Listbox.py
b/lib/python/Components/Renderer/Listbox.py
index fb787bfacae78cc0708aabbbbb8132bfdf10340c..640121e1ff97a7ac92cb6ece3e26ed1602dfd3b8 100644
(file)
--- a/
lib/python/Components/Renderer/Listbox.py
+++ b/
lib/python/Components/Renderer/Listbox.py
@@
-1,10
+1,7
@@
-from Components.VariableText import VariableText
from Renderer import Renderer
from Renderer import Renderer
-from Tools.Event import Event
-
from enigma import eListbox
from enigma import eListbox
-# the listbox renderer is the listbox, but no listbox content
+# the listbox renderer is the listbox, but no listbox content
.
# the content will be provided by the source (or converter).
# the source should emit the 'changed' signal whenever
# the content will be provided by the source (or converter).
# the source should emit the 'changed' signal whenever
@@
-42,28
+39,32
@@
class Listbox(Renderer, object):
self.wrap_around = self.wrap_around # trigger
self.selection_enabled = self.selection_enabled # trigger
self.wrap_around = self.wrap_around # trigger
self.selection_enabled = self.selection_enabled # trigger
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
def setWrapAround(self, wrap_around):
self.__wrap_around = wrap_around
if self.instance is not None:
self.instance.setWrapAround(self.__wrap_around)
def setWrapAround(self, wrap_around):
self.__wrap_around = wrap_around
if self.instance is not None:
self.instance.setWrapAround(self.__wrap_around)
-
+
wrap_around = property(lambda self: self.__wrap_around, setWrapAround)
def selectionChanged(self):
wrap_around = property(lambda self: self.__wrap_around, setWrapAround)
def selectionChanged(self):
- self.
upstream_elements
.selectionChanged(self.index)
+ self.
source
.selectionChanged(self.index)
def getIndex(self):
if self.instance is None:
def getIndex(self):
if self.instance is None:
- return
None
+ return
0
return self.instance.getCurrentIndex()
return self.instance.getCurrentIndex()
-
+
def moveToIndex(self, index):
if self.instance is None:
return
self.instance.moveSelectionTo(index)
index = property(getIndex, moveToIndex)
def moveToIndex(self, index):
if self.instance is None:
return
self.instance.moveSelectionTo(index)
index = property(getIndex, moveToIndex)
-
+
def move(self, direction):
if self.instance is not None:
self.instance.moveSelection(direction)
def move(self, direction):
if self.instance is not None:
self.instance.moveSelection(direction)
@@
-75,5
+76,13
@@
class Listbox(Renderer, object):
selection_enabled = property(lambda self: self.__selection_enabled, setSelectionEnabled)
selection_enabled = property(lambda self: self.__selection_enabled, setSelectionEnabled)
- def changed(self):
+ def changed(self, what):
+ if hasattr(self.source, "selectionEnabled"):
+ self.selection_enabled = self.source.selectionEnabled
+ if len(what) > 1 and isinstance(what[1], str) and what[1] == "style":
+ return
self.content = self.source.content
self.content = self.source.content
+
+ def entry_changed(self, index):
+ if self.instance is not None:
+ self.instance.entryChanged(index)