projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add concept of 'related screen', which can be used to get shared sources (like clock...
[vuplus_dvbapp]
/
lib
/
python
/
Screens
/
Screen.py
diff --git
a/lib/python/Screens/Screen.py
b/lib/python/Screens/Screen.py
index
a6106e1
..
4e3b117
100644
(file)
--- a/
lib/python/Screens/Screen.py
+++ b/
lib/python/Screens/Screen.py
@@
-1,16
+1,18
@@
-from Components.HTMLSkin import
*
-from Components.GUISkin import
*
+from Components.HTMLSkin import
HTMLSkin
+from Components.GUISkin import
GUISkin
from Components.Sources.Source import Source
from Components.Sources.Source import Source
-
-import sys
+from Components.GUIComponent import GUIComponent
class Screen(dict, HTMLSkin, GUISkin):
ALLOW_SUSPEND = False
class Screen(dict, HTMLSkin, GUISkin):
ALLOW_SUSPEND = False
- def __init__(self, session):
+ global_scren = None
+
+ def __init__(self, session, parent = None):
self.skinName = self.__class__.__name__
self.session = session
self.skinName = self.__class__.__name__
self.session = session
+ self.parent = parent
GUISkin.__init__(self)
self.onClose = [ ]
GUISkin.__init__(self)
self.onClose = [ ]
@@
-22,7
+24,10
@@
class Screen(dict, HTMLSkin, GUISkin):
self.onHide = [ ]
self.execing = False
self.onHide = [ ]
self.execing = False
+
self.shown = True
self.shown = True
+ # already shown is false until the screen is really shown (after creation)
+ self.already_shown = False
self.renderer = [ ]
self.renderer = [ ]
@@
-113,10
+118,11
@@
class Screen(dict, HTMLSkin, GUISkin):
def setFocus(self, o):
self.instance.setFocus(o.instance)
def setFocus(self, o):
self.instance.setFocus(o.instance)
- def show(self
, force = False
):
- if (self.shown and
not force
) or not self.instance:
+ def show(self):
+ if (self.shown and
self.already_shown
) or not self.instance:
return
self.shown = True
return
self.shown = True
+ self.already_shown = True
self.instance.show()
for x in self.onShow:
x()
self.instance.show()
for x in self.onShow:
x()
@@
-137,3
+143,13
@@
class Screen(dict, HTMLSkin, GUISkin):
def __repr__(self):
return str(type(self))
def __repr__(self):
return str(type(self))
+
+ def getRelatedScreen(self, name):
+ if name == "session":
+ return self.session.screen
+ elif name == "parent":
+ return self.parent
+ elif name == "global":
+ return self.global_screen
+ else:
+ return None