return;
}
- // TODO
- getDesktop()->makeCompatiblePixmap(*m_pixmap);
+ // TODO: This only works for desktop 0
+ getDesktop(0)->makeCompatiblePixmap(*m_pixmap);
event(evtChangedPixmap);
}
void setFocus(eWidget *focus);
};
-extern eWidgetDesktop *getDesktop();
+extern eWidgetDesktop *getDesktop(int which);
#endif
eWindow::eWindow(eWidgetDesktop *desktop, int z): eWidget(0)
{
m_flags = 0;
+ m_desktop = desktop;
/* ask style manager for current style */
ePtr<eWindowStyleManager> mgr;
eWindowStyleManager::getInstance(mgr);
eWindow::~eWindow()
{
- getDesktop()->removeRootWidget(this);
+ m_desktop->removeRootWidget(this);
m_child->destruct();
}
std::string m_title;
eWidget *m_child;
int m_flags;
+ eWidgetDesktop *m_desktop;
};
#endif
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):
# ...und als HTML:
def produceHTML(self):
return self.getText()
-
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:
def __init__(self):
self.onLayoutFinish = [ ]
- pass
+ self.summaries = [ ]
def createGUIScreen(self, parent, desktop):
for (name, val) in self.items():
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)
self.list = list
self.l = eListboxPythonStringContent()
self.l.setList(self.list)
+ self.onSelectionChanged = [ ]
def getCurrent(self):
return self.l.getCurrentSelection()
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()
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:
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
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 = { }
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?
if pos != -1:
title = title[:pos]
title += " (TV)"
- self.instance.setTitle(title)
+ self.setTitle(title)
def setRadioMode(self):
self.mode = MODE_RADIO
if pos != -1:
title = title[:pos]
title += " (Radio)"
- self.instance.setTitle(title)
+ self.setTitle(title)
def setRoot(self, root, justSet=False):
path = root.getPath()
titleStr += '/'
nameStr = self.getServiceName(end_ref)
titleStr += nameStr
- self.instance.setTitle(titleStr)
+ self.setTitle(titleStr)
def moveUp(self):
self.servicelist.moveUp()
})
def __onExecCallback(self):
- self.session.currentDialog.instance.setTitle(self.title)
+ self.setTitle(self.title)
self.setModeTv()
def channelSelected(self): # just return selected service
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))
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
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)
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...")]))
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)
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)
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
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"
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
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 = []
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
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
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"
def execText(self, text):
exec text
-
+
def runScreen(self, arg):
# arg[0] is the module (as string)
# arg[1] is Screen inside this module
self["menu"] = MenuList(list)
+ self["menu"].onSelectionChanged.append(self.selectionChanged)
self["actions"] = ActionMap(["OkCancelActions", "MenuActions"],
{
if a == "": #if empty use name
a = _(getValbyAttr(parent, "text"))
self["title"] = Header(a)
+ self.menu_title = a
def closeNonRecursive(self):
self.close(False)
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
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()
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)
# never call this directly - it will be called from the session!
def doClose(self):
+ self.hide()
for x in self.onClose:
x()
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:
self.instance.hide()
for x in self.onHide:
x()
+ for (name, val) in self.items():
+ if isinstance(val, GUIComponent):
+ val.onHide()
"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" ]
/************************************************/
-eLabel *lcd_label, *lcd_clock;
-
int exit_code;
int main(int argc, char **argv)
dsk.setRedrawTask(main);
dsk_lcd.setRedrawTask(main);
- eWindow *lcd_win = new eWindow(&dsk_lcd);
-
- lcd_win->setFlag(eWindow::wfNoBorder);
-
- lcd_win->move(ePoint(0, 0));
- lcd_win->resize(eSize(132, 64));
-
- lcd_label = new eLabel(lcd_win);
- lcd_label->move(ePoint(0, 4));
- lcd_label->resize(eSize(132, 42));
- ePtr<gFont> font = new gFont("Regular", 19);
- //ePtr<gFont> font = new gFont("Regular", 16);
- lcd_label->setFont(font);
-
- lcd_clock = new eLabel(lcd_win);
- lcd_clock->move(ePoint(50, 46));
- lcd_clock->resize(eSize(132, 18));
- ePtr<gFont> clkfont = new gFont("Regular", 16);
- lcd_clock->setFont(clkfont);
-
- //lcd_label->setText("bla bla bla, this lcd\nSUCKS!");
- //lcd_clock->setText("88:88:88");
-
- lcd_win->show();
-
eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
printf("executing main\n");
python.execute("mytest", "__main__");
- lcd_win->hide();
-
dsk.paint();
dsk_lcd.paint();
return exit_code;
}
-eWidgetDesktop *getDesktop()
+eWidgetDesktop *getDesktop(int which)
{
- return wdsk;
+ return which ? lcddsk : wdsk;
}
eApplication *getApplication()
void setLCD(const char *string)
{
- lcd_label->setText(string);
}
void setLCDClock(const char *string)
{
- lcd_clock->setText(string);
}
import traceback
import Screens.InfoBar
+from Screens.SimpleSummary import SimpleSummary
import sys
import time
comp.createGUIScreen(self.parent, desktop)
class Session:
- def __init__(self):
- self.desktop = None
- self.delayTimer = eTimer()
- self.delayTimer.timeout.get().append(self.processDelay)
+ def __init__(self, desktop = None, summary_desktop = None, navigation = None):
+ self.desktop = desktop
+ self.summary_desktop = summary_desktop
+ self.nav = navigation
+ self.delay_timer = eTimer()
+ self.delay_timer.timeout.get().append(self.processDelay)
- self.currentDialog = None
+ self.current_dialog = None
- self.dialogStack = [ ]
+ self.dialog_stack = [ ]
+ self.summary_stack = [ ]
+ self.summary = None
def processDelay(self):
self.execEnd()
- callback = self.currentDialog.callback
+ callback = self.current_dialog.callback
- retval = self.currentDialog.returnValue
+ retval = self.current_dialog.returnValue
- if self.currentDialog.isTmp:
- self.currentDialog.doClose()
-# dump(self.currentDialog)
- del self.currentDialog
+ if self.current_dialog.isTmp:
+ self.current_dialog.doClose()
+# dump(self.current_dialog)
+ del self.current_dialog
else:
- del self.currentDialog.callback
+ del self.current_dialog.callback
self.popCurrent()
if callback is not None:
callback(*retval)
def execBegin(self):
- c = self.currentDialog
+ c = self.current_dialog
+
+ self.pushSummary()
+
+ summary = c.createSummary() or SimpleSummary
+ self.summary = self.instantiateSummaryDialog(summary, c)
+ self.summary.show()
+
+ c.addSummary(self.summary)
c.execBegin()
# when execBegin opened a new dialog, don't bother showing the old one.
- if c == self.currentDialog:
+ if c == self.current_dialog:
c.show()
def execEnd(self):
- self.currentDialog.execEnd()
- self.currentDialog.hide()
+ self.current_dialog.execEnd()
+ self.current_dialog.hide()
+ self.current_dialog.removeSummary(self.summary)
+ self.popSummary()
def create(self, screen, arguments, **kwargs):
# creates an instance of 'screen' (which is a class)
print errstr
traceback.print_exc(file=sys.stdout)
quitMainloop(5)
-
def instantiateDialog(self, screen, *arguments, **kwargs):
+ return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
+
+ def instantiateSummaryDialog(self, screen, *arguments, **kwargs):
+ return self.doInstantiateDialog(screen, arguments, kwargs, self.summary_desktop)
+
+ def doInstantiateDialog(self, screen, arguments, kwargs, desktop):
# create dialog
try:
return
# read skin data
- readSkin(dlg, None, dlg.skinName, self.desktop)
+ readSkin(dlg, None, dlg.skinName, desktop)
# create GUI view of this dialog
- assert self.desktop != None
+ assert desktop is not None
z = 0
+ title = ""
for (key, value) in dlg.skinAttributes:
if key == "zPosition":
z = int(value)
-
- dlg.instance = eWindow(self.desktop, z)
- applyAllAttributes(dlg.instance, self.desktop, dlg.skinAttributes)
+ elif key == "title":
+ title = value
+
+ dlg.instance = eWindow(desktop, z)
+ dlg.title = title
+ applyAllAttributes(dlg.instance, desktop, dlg.skinAttributes)
gui = GUIOutputDevice()
gui.parent = dlg.instance
- gui.create(dlg, self.desktop)
+ gui.create(dlg, desktop)
return dlg
def pushCurrent(self):
- if self.currentDialog:
- self.dialogStack.append(self.currentDialog)
+ if self.current_dialog:
+ self.dialog_stack.append(self.current_dialog)
self.execEnd()
def popCurrent(self):
- if len(self.dialogStack):
- self.currentDialog = self.dialogStack.pop()
+ if len(self.dialog_stack):
+ self.current_dialog = self.dialog_stack.pop()
self.execBegin()
else:
- self.currentDialog = None
+ self.current_dialog = None
def execDialog(self, dialog):
self.pushCurrent()
- self.currentDialog = dialog
- self.currentDialog.isTmp = False
- self.currentDialog.callback = None # would cause re-entrancy problems.
+ self.current_dialog = dialog
+ self.current_dialog.isTmp = False
+ self.current_dialog.callback = None # would cause re-entrancy problems.
self.execBegin()
def openWithCallback(self, callback, screen, *arguments, **kwargs):
def open(self, screen, *arguments, **kwargs):
self.pushCurrent()
- dlg = self.currentDialog = self.instantiateDialog(screen, *arguments, **kwargs)
+ dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)
dlg.isTmp = True
dlg.callback = None
self.execBegin()
print "code " + str(code)
def close(self, *retval):
- self.currentDialog.returnValue = retval
- self.delayTimer.start(0, 1)
+ self.current_dialog.returnValue = retval
+ self.delay_timer.start(0, 1)
+
+ def pushSummary(self):
+ if self.summary is not None:
+ self.summary.hide()
+ self.summary_stack.append(self.summary)
+ self.summary = None
+
+ def popSummary(self):
+ if self.summary is not None:
+ self.summary.doClose()
+ self.summary = self.summary_stack.pop()
+ if self.summary is not None:
+ self.summary.show()
from Screens.Volume import Volume
from Screens.Mute import Mute
self.muteDialog.hide()
def runScreenTest():
- session = Session()
- session.desktop = getDesktop()
-
- session.nav = Navigation()
+ session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = Navigation())
screensToRun = [ ]
import keymapparser
keymapparser.readKeymap()
import skin
-skin.loadSkin(getDesktop())
+skin.loadSkin(getDesktop(0))
import Components.InputDevice
Components.InputDevice.InitInputDevices()
myscreen = x
del skin
- if myscreen is None:
- # try embedded skin
- if "parsedSkin" in screen.__dict__:
- myscreen = screen.parsedSkin
- elif "skin" in screen.__dict__:
- myscreen = screen.parsedSkin = xml.dom.minidom.parseString(screen.skin).childNodes[0]
+ # try embedded skin
+ myscreen = myscreen or getattr(screen, "parsedSkin", None)
+
+ # try uncompiled embedded skin
+ if myscreen is None and getattr(screen, "skin", None):
+ myscreen = screen.parsedSkin = xml.dom.minidom.parseString(screen.skin).childNodes[0]
assert myscreen is not None, "no skin for screen '" + name + "' found!"