def checkNotifications(self): InfoBarNotifications.checkNotifications(self) pending = Notifications.notificationQueue.getPending("JobMananger") if pending: print "[JobView] have pending JobMananger Notification(s):", pending elif self.settings.afterEvent.getValue() == "close" and self.job.status == self.job.FAILED: self.close(False)
def checkNotifications(self): InfoBarNotifications.checkNotifications(self, immediate=True) pending = Notifications.notificationQueue.getPending("JobMananger") if pending: print "[JobView] have pending JobMananger Notification(s):", pending elif self.settings.afterEvent.getValue( ) == "close" and self.job.status == self.job.FAILED: self.close(False)
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job self.setTitle(_("Job overview")) self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self["finished"] = Boolean() self["cancelable"] = Boolean(cancelable) self["backgroundable"] = Boolean(backgroundable) self["key_blue"] = StaticText(_("Background")) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self["setupActions"] = ActionMap( ["ColorActions", "SetupActions"], { "green": self.ok, "red": self.abort, "blue": self.background, "cancel": self.ok, "ok": self.ok, }, -2) self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString) ], default=self.job.afterEvent or "nothing") self.job.afterEvent = self.settings.afterEvent.getValue() self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True, afterEvent='nothing'): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) Screen.setTitle(self, _('Job View')) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job if afterEvent: self.job.afterEvent = afterEvent self['job_name'] = StaticText(job.name) self['job_progress'] = Progress() self['job_task'] = StaticText() self['summary_job_name'] = StaticText(job.name) self['summary_job_progress'] = Progress() self['summary_job_task'] = StaticText() self['job_status'] = StaticText() self['finished'] = Boolean() self['cancelable'] = Boolean(cancelable) self['backgroundable'] = Boolean(backgroundable) self['key_blue'] = StaticText(_('Background')) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self['setupActions'] = ActionMap( ['ColorActions', 'SetupActions'], { 'green': self.ok, 'red': self.abort, 'blue': self.background, 'cancel': self.ok, 'ok': self.ok }, -2) self.settings = ConfigSubsection() if SystemInfo['DeepstandbySupport']: shutdownString = _('go to deep standby') else: shutdownString = _('shut down') self.settings.afterEvent = ConfigSelection(choices=[ ('nothing', _('do nothing')), ('close', _('Close')), ('standby', _('go to standby')), ('deepstandby', shutdownString) ], default=self.job.afterEvent or 'nothing') self.job.afterEvent = self.settings.afterEvent.value self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, job, parent=None, cancelable = True, backgroundable = True, afterEventChangeable = True , afterEvent="nothing"): Screen.__init__(self, session, parent) Screen.setTitle(self, _("Job View")) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job if afterEvent: self.job.afterEvent = afterEvent self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self.cancelable = cancelable self.backgroundable = backgroundable self["key_green"] = StaticText("") if self.cancelable: self["key_red"] = StaticText(_("Cancel")) else: self["key_red"] = StaticText("") if self.backgroundable: self["key_blue"] = StaticText(_("Background")) else: self["key_blue"] = StaticText("") self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self["setupActions"] = ActionMap(["ColorActions", "SetupActions"], { "green": self.ok, "red": self.abort, "blue": self.background, "cancel": self.abort, "ok": self.ok, }, -2) self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection(choices = [("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default = self.job.afterEvent or "nothing") self.job.afterEvent = self.settings.afterEvent.value self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True): Screen.__init__(self, session, parent) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job self.setTitle(_("Job overview")) self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self.cancelable = cancelable self.backgroundable = backgroundable self["key_green"] = StaticText("") if self.job.IN_PROGRESS: self["key_red"] = StaticText(_("Job cancel")) else: self["key_red"] = StaticText("") if self.job.IN_PROGRESS: self["key_blue"] = StaticText(_("Continue in background")) self["key_green"] = StaticText(_("OK")) else: self["key_blue"] = StaticText("") self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self["setupActions"] = ActionMap(["ColorActions", "SetupActions"], { "green": self.ok, "red": self.abort, "blue": self.background, "ok": self.ok, }, -2) self.settings = ConfigSubsection() if BoxInfo.getItem("DeepstandbySupport"): shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection(choices=[("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default=self.job.afterEvent or "nothing") self.job.afterEvent = self.settings.afterEvent.getValue() self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self["finished"] = Boolean() self["cancelable"] = Boolean(cancelable) self["backgroundable"] = Boolean(backgroundable) self["key_blue"] = StaticText(_("Background")) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self["setupActions"] = ActionMap( ["ColorActions", "SetupActions"], {"green": self.ok, "red": self.abort, "blue": self.background, "cancel": self.ok, "ok": self.ok}, -2, ) self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection( choices=[ ("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ], default=self.job.afterEvent or "nothing", ) self.job.afterEvent = self.settings.afterEvent.getValue() self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, job, parent = None, cancelable = True, backgroundable = True, afterEventChangeable = True, afterEvent = 'nothing'): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) Screen.setTitle(self, _('Job View')) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job if afterEvent: self.job.afterEvent = afterEvent self['job_name'] = StaticText(job.name) self['job_progress'] = Progress() self['job_task'] = StaticText() self['summary_job_name'] = StaticText(job.name) self['summary_job_progress'] = Progress() self['summary_job_task'] = StaticText() self['job_status'] = StaticText() self['finished'] = Boolean() self['cancelable'] = Boolean(cancelable) self['backgroundable'] = Boolean(backgroundable) self['key_blue'] = StaticText(_('Background')) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self['setupActions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.ok, 'red': self.abort, 'blue': self.background, 'cancel': self.ok, 'ok': self.ok}, -2) self.settings = ConfigSubsection() if SystemInfo['DeepstandbySupport']: shutdownString = _('go to deep standby') else: shutdownString = _('shut down') self.settings.afterEvent = ConfigSelection(choices=[('nothing', _('do nothing')), ('close', _('Close')), ('standby', _('go to standby')), ('deepstandby', shutdownString)], default=self.job.afterEvent or 'nothing') self.job.afterEvent = self.settings.afterEvent.value self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def checkNotifications(self): InfoBarNotifications.checkNotifications(self) if Notifications.notifications == []: if self.settings.afterEvent.getValue() == "close" and self.job.status == self.job.FAILED: self.close(False)
def checkNotifications(self): InfoBarNotifications.checkNotifications(self) if not Notifications.notifications: if self.settings.afterEvent.value == 'close' and self.job.status == self.job.FAILED: self.close(False)
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True, afterEvent="nothing"): Screen.__init__(self, session, parent) Screen.setTitle(self, _("Job View")) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job if afterEvent: self.job.afterEvent = afterEvent self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self.cancelable = cancelable self.backgroundable = backgroundable self["okActions"] = ActionMap(["SetupActions"], { "save": self.ok, "ok": self.ok, }, -2) self["abortActions"] = ActionMap(["SetupActions"], { "cancel": self.abort, }, -2) self["backgroundActions"] = ActionMap(["ColorActions"], { "blue": self.background, }, -2) self["key_green"] = StaticText("") self["okActions"].setEnabled(False) if self.cancelable: self["key_red"] = StaticText(_("Cancel")) else: self["key_red"] = StaticText("") self["abortActions"].setEnabled(False) if self.backgroundable: self["key_blue"] = StaticText(_("Background")) else: self["key_blue"] = StaticText("") self["backgroundActions"].setEnabled(False) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString) ], default=self.job.afterEvent or "nothing") self.job.afterEvent = self.settings.afterEvent.value self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()