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 branch 'bug_318_PluginBrowser_no_reaction_on_language_changes'
[enigma2.git]
/
lib
/
python
/
Components
/
Element.py
diff --git
a/lib/python/Components/Element.py
b/lib/python/Components/Element.py
index f4a8f1275d346d88b990690a696bf5b179b833b5..3297a4adf80a4af6dce071f9d629920aa9e8003f 100644
(file)
--- a/
lib/python/Components/Element.py
+++ b/
lib/python/Components/Element.py
@@
-18,10
+18,10
@@
def cached(f):
class ElementError(Exception):
def __init__(self, message):
class ElementError(Exception):
def __init__(self, message):
- self.m
essage
= message
+ self.m
sg
= message
def __str__(self):
def __str__(self):
- return self.m
essage
+ return self.m
sg
class Element(object):
CHANGED_DEFAULT = 0 # initial "pull" state
class Element(object):
CHANGED_DEFAULT = 0 # initial "pull" state
@@
-30,9
+30,12
@@
class Element(object):
CHANGED_SPECIFIC = 3 # second tuple will specify what exactly changed
CHANGED_POLL = 4 # a timer expired
CHANGED_SPECIFIC = 3 # second tuple will specify what exactly changed
CHANGED_POLL = 4 # a timer expired
+ SINGLE_SOURCE = True
+
def __init__(self):
self.downstream_elements = CList()
self.master = None
def __init__(self):
self.downstream_elements = CList()
self.master = None
+ self.sources = [ ]
self.source = None
self.__suspended = True
self.cache = None
self.source = None
self.__suspended = True
self.cache = None
@@
-43,7
+46,9
@@
class Element(object):
self.master = downstream
def connectUpstream(self, upstream):
self.master = downstream
def connectUpstream(self, upstream):
- assert self.source is None
+ assert not self.SINGLE_SOURCE or self.source is None
+ self.sources.append(upstream)
+ # self.source always refers to the last recent source added.
self.source = upstream
self.changed((self.CHANGED_DEFAULT,))
self.source = upstream
self.changed((self.CHANGED_DEFAULT,))
@@
-58,10
+63,14
@@
class Element(object):
assert len(self.downstream_elements) == 0, "there are still downstream elements left"
# Sources don't have a source themselves. don't do anything here.
assert len(self.downstream_elements) == 0, "there are still downstream elements left"
# Sources don't have a source themselves. don't do anything here.
- if self.source is not None:
- self.source.disconnectDownstream(self)
+ for s in self.sources:
+ s.disconnectDownstream(self)
+
+ if self.source:
# sources are owned by the Screen, so don't destroy them here.
self.destroy()
# sources are owned by the Screen, so don't destroy them here.
self.destroy()
+ self.source = None
+ self.sources = [ ]
def disconnectDownstream(self, downstream):
self.downstream_elements.remove(downstream)
def disconnectDownstream(self, downstream):
self.downstream_elements.remove(downstream)
@@
-77,10
+86,6
@@
class Element(object):
self.downstream_elements.changed(*args, **kwargs)
self.cache = None
self.downstream_elements.changed(*args, **kwargs)
self.cache = None
- def reconnectUpstream(self, new_upstream):
- assert self.source is not None
- self.source = new_upstream
-
def setSuspend(self, suspended):
changed = self.__suspended != suspended
if not self.__suspended and suspended:
def setSuspend(self, suspended):
changed = self.__suspended != suspended
if not self.__suspended and suspended:
@@
-89,8
+94,9
@@
class Element(object):
self.doSuspend(0)
self.__suspended = suspended
self.doSuspend(0)
self.__suspended = suspended
- if self.source is not None and changed:
- self.source.checkSuspend()
+ if changed:
+ for s in self.sources:
+ s.checkSuspend()
suspended = property(lambda self: self.__suspended, setSuspend)
suspended = property(lambda self: self.__suspended, setSuspend)