}
} else
{
- serviceEvent(eventTuneFailed);
+ serviceEvent(eventNoResources);
return res;
}
eDVBServicePMTHandler.eventSOF: None,
eDVBServicePMTHandler.eventEOF: None
}
-
+
if error not in errors:
error = None
- error = error and errors[error]
-
+ error = error is not None and errors[error]
+
if error is not None:
Notifications.AddPopup(text = error, type = MessageBox.TYPE_ERROR, timeout = 5, id = "ZapError")
else:
self.timer.start(1000)
def timerTick(self):
- self.timeout -= 1
- if self.origTitle is None:
- self.origTitle = self.instance.getTitle()
- self.setTitle(self.origTitle + " (" + str(self.timeout) + ")")
- if self.timeout == 0:
- self.timer.stop()
- self.timerRunning = False
- self.timeoutCallback()
-
+ if self.execing:
+ self.timeout -= 1
+ if self.origTitle is None:
+ self.origTitle = self.instance.getTitle()
+ self.setTitle(self.origTitle + " (" + str(self.timeout) + ")")
+ if self.timeout == 0:
+ self.timer.stop()
+ self.timerRunning = False
+ self.timeoutCallback()
+
def timeoutCallback(self):
print "Timeout!"
self.ok()
# we need the list in every screen. how ironic.
self.helpList = [ ]
+ self.close_on_next_exec = None
+
def execBegin(self):
self.active_components = [ ]
+ if self.close_on_next_exec is not None:
+ tmp = self.close_on_next_exec
+ self.close_on_next_exec = None
+ self.execing = True
+ self.close(tmp)
+ else:
+ single = self.onFirstExecBegin
+ self.onFirstExecBegin = []
+ for x in self.onExecBegin + single:
+ x()
+ if self.session.current_dialog != self:
+ return
- single = self.onFirstExecBegin
- self.onFirstExecBegin = []
- for x in self.onExecBegin + single:
- x()
- if self.session.current_dialog != self:
- return
+# assert self.session == None, "a screen can only exec once per time"
+# self.session = session
-# assert self.session == None, "a screen can only exec once per time"
-# self.session = session
+ for val in self.values() + self.renderer:
+ val.execBegin()
+ if self.session.current_dialog != self:
+ return
+ self.active_components.append(val)
- for val in self.values() + self.renderer:
- val.execBegin()
- if self.session.current_dialog != self:
- return
- self.active_components.append(val)
-
- self.execing = True
+ self.execing = True
- for x in self.onShown:
- x()
+ for x in self.onShown:
+ x()
def execEnd(self):
# for (name, val) in self.items():
self.__dict__.clear()
def close(self, *retval):
- self.session.close(self, *retval)
+ if not self.execing:
+ self.close_on_next_exec = retval
+ else:
+ self.session.close(self, *retval)
def setFocus(self, o):
self.instance.setFocus(o.instance)
notificationAdded = [ ]
-
# notifications which are currently on screen (and might be closed by similiar notifications)
current_notifications = [ ]
print "(found in current notifications)"
x[1].close()
+from Screens.MessageBox import MessageBox
+
def AddPopup(text, type, timeout, id = None):
if id is not None:
RemovePopup(id)
- from Screens.MessageBox import MessageBox
print "AddPopup, id =", id
AddNotificationWithID(id, MessageBox, text = text, type = type, timeout = timeout, close_on_any_key = True)
}
break;
}
+ case eDVBServicePMTHandler::eventNoResources:
case eDVBServicePMTHandler::eventNoPAT:
case eDVBServicePMTHandler::eventNoPATEntry:
case eDVBServicePMTHandler::eventNoPMT:
if (m_is_pvr)
m_cue = new eCueSheet();
+ m_event(this, evStart);
+
m_first_program_info = 1;
eServiceReferenceDVB &service = (eServiceReferenceDVB&)m_reference;
r = m_service_handler.tune(service, m_is_pvr, m_cue);
if (m_is_pvr)
loadCuesheet();
- m_event(this, evStart);
m_event((iPlayableService*)this, evSeekableStatusChanged);
return 0;
}