aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-03-02 02:14:10 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-03-02 02:14:10 +0000
commit6c2d3fc303542b7f77f4350974acf781a1b91c30 (patch)
tree356a431d479c5dff6fb6aaea8000bbb71a8c58d0 /lib/python
parent0a3c667bfb6a1552975c1fd2325e7435363c2bc9 (diff)
downloadenigma2-6c2d3fc303542b7f77f4350974acf781a1b91c30.tar.gz
enigma2-6c2d3fc303542b7f77f4350974acf781a1b91c30.zip
minimally improved LCD support
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Clock.py6
-rw-r--r--lib/python/Components/GUIComponent.py6
-rw-r--r--lib/python/Components/GUISkin.py18
-rw-r--r--lib/python/Components/MenuList.py6
-rw-r--r--lib/python/Screens/ChannelSelection.py16
-rw-r--r--lib/python/Screens/EventView.py2
-rw-r--r--lib/python/Screens/InfoBar.py16
-rw-r--r--lib/python/Screens/InfoBarGenerics.py22
-rw-r--r--lib/python/Screens/LanguageSelection.py2
-rw-r--r--lib/python/Screens/Makefile.am3
-rw-r--r--lib/python/Screens/Menu.py32
-rw-r--r--lib/python/Screens/PluginBrowser.py4
-rw-r--r--lib/python/Screens/Screen.py13
-rw-r--r--lib/python/Screens/__init__.py2
14 files changed, 118 insertions, 30 deletions
diff --git a/lib/python/Components/Clock.py b/lib/python/Components/Clock.py
index e2d9d5f5..982d1c4a 100644
--- a/lib/python/Components/Clock.py
+++ b/lib/python/Components/Clock.py
@@ -20,7 +20,12 @@ class Clock(HTMLComponent, GUIComponent, VariableText):
self.clockTimer = eTimer()
self.clockTimer.timeout.get().append(self.doClock)
+
+ def onShow(self):
self.clockTimer.start(1000)
+
+ def onHide(self):
+ self.clockTimer.stop()
# "funktionalitaet"
def doClock(self):
@@ -39,4 +44,3 @@ class Clock(HTMLComponent, GUIComponent, VariableText):
# ...und als HTML:
def produceHTML(self):
return self.getText()
-
diff --git a/lib/python/Components/GUIComponent.py b/lib/python/Components/GUIComponent.py
index 1476ba83..493df681 100644
--- a/lib/python/Components/GUIComponent.py
+++ b/lib/python/Components/GUIComponent.py
@@ -18,6 +18,12 @@ class GUIComponent:
def execEnd(self):
pass
+ def onShow(self):
+ pass
+
+ def onHide(self):
+ pass
+
# this works only with normal widgets - if you don't have self.instance, override this.
def applySkin(self, desktop):
if self.state == self.HIDDEN:
diff --git a/lib/python/Components/GUISkin.py b/lib/python/Components/GUISkin.py
index f97dd8bd..3aa9c851 100644
--- a/lib/python/Components/GUISkin.py
+++ b/lib/python/Components/GUISkin.py
@@ -6,7 +6,7 @@ class GUISkin:
def __init__(self):
self.onLayoutFinish = [ ]
- pass
+ self.summaries = [ ]
def createGUIScreen(self, parent, desktop):
for (name, val) in self.items():
@@ -32,3 +32,19 @@ class GUISkin:
def close(self):
self.deleteGUIScreen()
+
+ def createSummary(self):
+ return None
+
+ def addSummary(self, summary):
+ self.summaries.append(summary)
+
+ def removeSummary(self, summary):
+ self.summaries.remove(summary)
+
+ def setTitle(self, title):
+ self.instance.setTitle(title)
+ self.title = title
+
+ for x in self.summaries:
+ x.setTitle(title)
diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py
index 03e6be6d..40898095 100644
--- a/lib/python/Components/MenuList.py
+++ b/lib/python/Components/MenuList.py
@@ -9,6 +9,7 @@ class MenuList(HTMLComponent, GUIComponent):
self.list = list
self.l = eListboxPythonStringContent()
self.l.setList(self.list)
+ self.onSelectionChanged = [ ]
def getCurrent(self):
return self.l.getCurrentSelection()
@@ -16,9 +17,12 @@ class MenuList(HTMLComponent, GUIComponent):
def GUIcreate(self, parent):
self.instance = eListbox(parent)
self.instance.setContent(self.l)
+ self.instance.selectionChanged.get().append(self.selectionChanged)
def GUIdelete(self):
self.instance.setContent(None)
self.instance = None
-
+ def selectionChanged(self):
+ for f in self.onSelectionChanged:
+ f()
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index c7c1b968..40868e87 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -272,7 +272,7 @@ class ChannelSelectionEdit:
new_title += ' ' + _("[bouquet edit]")
else:
new_title += ' ' + _("[favourite edit]")
- self.instance.setTitle(new_title)
+ self.setTitle(new_title)
self.bouquet_mark_edit = True
self.__marked = self.servicelist.getRootServices()
for x in self.__marked:
@@ -300,7 +300,7 @@ class ChannelSelectionEdit:
self.clearMarks()
self.bouquet_mark_edit = False
self.mutableList = None
- self.instance.setTitle(self.saved_title)
+ self.setTitle(self.saved_title)
self.saved_title = None
self.servicePath = self.savedPath[:]
del self.savedPath
@@ -346,7 +346,7 @@ class ChannelSelectionEdit:
self.pathChangedDisabled = False # re-enable path change
self.mutableList.flushChanges() # FIXME add check if changes was made
self.mutableList = None
- self.instance.setTitle(self.saved_title)
+ self.setTitle(self.saved_title)
self.saved_title = None
if self.getRoot() == self.bouquet_root:
self.bouquetNumOffsetCache = { }
@@ -358,7 +358,7 @@ class ChannelSelectionEdit:
new_title = self.saved_title
pos = self.saved_title.find(')')
new_title = self.saved_title[:pos+1] + ' ' + _("[move mode]") + self.saved_title[pos+1:]
- self.instance.setTitle(new_title);
+ self.setTitle(new_title);
def handleEditCancel(self):
if self.movemode: #movemode active?
@@ -487,7 +487,7 @@ class ChannelSelectionBase(Screen):
if pos != -1:
title = title[:pos]
title += " (TV)"
- self.instance.setTitle(title)
+ self.setTitle(title)
def setRadioMode(self):
self.mode = MODE_RADIO
@@ -498,7 +498,7 @@ class ChannelSelectionBase(Screen):
if pos != -1:
title = title[:pos]
title += " (Radio)"
- self.instance.setTitle(title)
+ self.setTitle(title)
def setRoot(self, root, justSet=False):
path = root.getPath()
@@ -559,7 +559,7 @@ class ChannelSelectionBase(Screen):
titleStr += '/'
nameStr = self.getServiceName(end_ref)
titleStr += nameStr
- self.instance.setTitle(titleStr)
+ self.setTitle(titleStr)
def moveUp(self):
self.servicelist.moveUp()
@@ -1043,7 +1043,7 @@ class SimpleChannelSelection(ChannelSelectionBase):
})
def __onExecCallback(self):
- self.session.currentDialog.instance.setTitle(self.title)
+ self.setTitle(self.title)
self.setModeTv()
def channelSelected(self): # just return selected service
diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py
index 01695dfb..ef3786c5 100644
--- a/lib/python/Screens/EventView.py
+++ b/lib/python/Screens/EventView.py
@@ -82,7 +82,7 @@ class EventViewBase:
if len(text) > 0:
text = text + '\n\n'
text = text + ext
- self.session.currentDialog.instance.setTitle(event.getEventName())
+ self.setTitle(event.getEventName())
self["epg_description"].setText(text)
self["datetime"].setText(event.getBeginTimeString())
self["duration"].setText(_("%d min")%(event.getDuration()/60))
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index cfc35294..d60725f2 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -16,7 +16,8 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
- InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView
+ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
+ InfoBarSummarySupport
from Screens.HelpMenu import HelpableScreen, HelpMenu
@@ -24,11 +25,12 @@ from enigma import *
import time
-class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey,
+class InfoBar(InfoBarShowHide, InfoBarPowerKey,
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
- InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek):
+ InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
+ InfoBarSummarySupport, Screen):
def __init__(self, session):
Screen.__init__(self, session)
@@ -44,7 +46,7 @@ class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey,
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
- InfoBarTuner, InfoBarTimeshift, InfoBarSeek:
+ InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport:
x.__init__(self)
self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
@@ -66,7 +68,8 @@ class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey,
class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
- InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView):
+ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
+ InfoBarSummarySupport):
def __init__(self, session, service):
Screen.__init__(self, session)
@@ -79,7 +82,8 @@ class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
- InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport:
+ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
+ InfoBarSummarySupport:
x.__init__(self)
self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 954e9d1f..d0619628 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -11,6 +11,7 @@ from Components.Pixmap import Pixmap, PixmapConditional
from Components.BlinkingPixmap import BlinkingPixmapConditional
from Components.ServiceName import ServiceName
from Components.EventInfo import EventInfo, EventInfoProgress
+from Components.Clock import Clock
from ServiceReference import ServiceReference
from EpgSelection import EPGSelection
@@ -748,7 +749,7 @@ class InfoBarSeek:
if self.seekstate == self.SEEK_STATE_PAUSE:
seekable = self.getSeek()
if seekable is not None:
- seekable.seekRelative(-1, 2)
+ seekable.seekRelative(-1, 3)
def fwdTimerFire(self):
print "Display seek fwd"
@@ -1349,3 +1350,22 @@ class InfoBarCueSheetSupport:
print "upload failed, no cuesheet interface"
return
self.cut_list = cue.getCutList()
+
+class InfoBarSummary(Screen):
+ skin = """
+ <screen position="0,0" size="132,64">
+ <widget name="Clock" position="50,46" size="82,18" font="Regular;19" />
+ <widget name="CurrentService" position="0,4" size="132,42" font="Regular;19" />
+ </screen>"""
+
+ def __init__(self, session, parent):
+ Screen.__init__(self, session)
+ self["CurrentService"] = ServiceName(self.session.nav)
+ self["Clock"] = Clock()
+
+class InfoBarSummarySupport:
+ def __init__(self):
+ pass
+
+ def createSummary(self):
+ return InfoBarSummary
diff --git a/lib/python/Screens/LanguageSelection.py b/lib/python/Screens/LanguageSelection.py
index f59c7987..6b18121f 100644
--- a/lib/python/Screens/LanguageSelection.py
+++ b/lib/python/Screens/LanguageSelection.py
@@ -37,7 +37,7 @@ class LanguageSelection(Screen):
language.activateLanguage(self["list"].l.getCurrentSelectionIndex())
config.osd.language.value = self["list"].l.getCurrentSelectionIndex()
config.osd.language.save()
- self.session.currentDialog.instance.setTitle(_("Language selection"))
+ self.setTitle(_("Language selection"))
def updateList(self):
self.list = []
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index 47586fe0..d917eb39 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -9,5 +9,4 @@ install_PYTHON = \
AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
- Console.py InputBox.py ChoiceBox.py
-
+ Console.py InputBox.py ChoiceBox.py SimpleSummary.py
diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py
index bba36282..2a7055cf 100644
--- a/lib/python/Screens/Menu.py
+++ b/lib/python/Screens/Menu.py
@@ -6,6 +6,7 @@ from Components.Button import Button
from Components.Label import Label
from Components.ProgressBar import ProgressBar
from Components.config import configfile
+from Components.Clock import Clock
from Tools.Directories import resolveFilename, SCOPE_SKIN
@@ -73,7 +74,24 @@ class MenuUpdater:
return self.updatedMenuItems[id]
menuupdater = MenuUpdater()
-
+
+class MenuSummary(Screen):
+ skin = """
+ <screen position="0,0" size="132,64">
+ <widget name="Clock" position="50,46" size="82,18" font="Regular;19" />
+ <widget name="MenuTitle" position="0,4" size="132,21" font="Regular;19" />
+ <widget name="MenuEntry" position="0,25" size="132,21" font="Regular;19" />
+ </screen>"""
+
+ def __init__(self, session, parent):
+ Screen.__init__(self, session)
+ self["MenuTitle"] = Label(parent.menu_title)
+ self["MenuEntry"] = Label("")
+ self["Clock"] = Clock()
+
+ def setCurrentEntry(self, entry):
+ self["MenuEntry"].setText(entry)
+
class Menu(Screen):
def okbuttonClick(self):
print "okbuttonClick"
@@ -82,7 +100,7 @@ class Menu(Screen):
def execText(self, text):
exec text
-
+
def runScreen(self, arg):
# arg[0] is the module (as string)
# arg[1] is Screen inside this module
@@ -185,6 +203,7 @@ class Menu(Screen):
self["menu"] = MenuList(list)
+ self["menu"].onSelectionChanged.append(self.selectionChanged)
self["actions"] = ActionMap(["OkCancelActions", "MenuActions"],
{
@@ -197,6 +216,7 @@ class Menu(Screen):
if a == "": #if empty use name
a = _(getValbyAttr(parent, "text"))
self["title"] = Header(a)
+ self.menu_title = a
def closeNonRecursive(self):
self.close(False)
@@ -204,6 +224,14 @@ class Menu(Screen):
def closeRecursive(self):
self.close(True)
+ def createSummary(self):
+ return MenuSummary
+
+ def selectionChanged(self):
+ entry = self["menu"].getCurrent()[0]
+ for x in self.summaries:
+ x.setCurrentEntry(entry)
+
class MainMenu(Menu):
#add file load functions for the xml-file
diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py
index 41b3f32e..46661ca1 100644
--- a/lib/python/Screens/PluginBrowser.py
+++ b/lib/python/Screens/PluginBrowser.py
@@ -110,9 +110,9 @@ class PluginDownloadBrowser(Screen):
def setTitle(self):
if self.type == self.DOWNLOAD:
- self.session.currentDialog.instance.setTitle(_("Downloadable new plugins"))
+ self.setTitle(_("Downloadable new plugins"))
elif self.type == self.REMOVE:
- self.session.currentDialog.instance.setTitle(_("Remove plugins"))
+ self.setTitle(_("Remove plugins"))
def startRun(self):
self["list"].instance.hide()
diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py
index a8d0b048..8398dadd 100644
--- a/lib/python/Screens/Screen.py
+++ b/lib/python/Screens/Screen.py
@@ -29,15 +29,15 @@ class Screen(dict, HTMLSkin, GUISkin):
self.active_components = [ ]
for x in self.onExecBegin:
x()
- if self.session.currentDialog != self:
+ if self.session.current_dialog != self:
return
-# assert self.session == None, "a screen can only exec one per time"
+# assert self.session == None, "a screen can only exec once per time"
# self.session = session
for (name, val) in self.items():
val.execBegin()
- if self.session.currentDialog != self:
+ if self.session.current_dialog != self:
return
self.active_components.append(val)
@@ -57,6 +57,7 @@ class Screen(dict, HTMLSkin, GUISkin):
# never call this directly - it will be called from the session!
def doClose(self):
+ self.hide()
for x in self.onClose:
x()
@@ -84,6 +85,9 @@ class Screen(dict, HTMLSkin, GUISkin):
self.instance.show()
for x in self.onShow:
x()
+ for (name, val) in self.items():
+ if isinstance(val, GUIComponent):
+ val.onShow()
def hide(self):
if not self.shown:
@@ -92,3 +96,6 @@ class Screen(dict, HTMLSkin, GUISkin):
self.instance.hide()
for x in self.onHide:
x()
+ for (name, val) in self.items():
+ if isinstance(val, GUIComponent):
+ val.onHide()
diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py
index 82e4d833..c25426f4 100644
--- a/lib/python/Screens/__init__.py
+++ b/lib/python/Screens/__init__.py
@@ -5,4 +5,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu",
"Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
"EpgSelection", "EventView", "Standby", "ServiceInfo",
"AudioSelection", "SubserviceSelection", "InfoBarGenerics", "HelpMenu", "Wizard",
- "PVRState", "Console", "InputBox", "ChoiceBox" ]
+ "PVRState", "Console", "InputBox", "ChoiceBox", "SimpleSummary" ]