def __init__(self, session): MessageBox.__init__(self, session, _("When you do a factory reset, you will lose ALL your configuration data\n" "(including bouquets, services, satellite data ...)\n" "After completion of factory reset, your receiver will restart automatically!\n\n" "Really do a factory reset?"), MessageBox.TYPE_YESNO, default=False) self.skinName = "MessageBox" ProtectedScreen.__init__(self)
def __init__(self, session): MessageBox.__init__( self, session, _( "When you do a factory reset, you will lose ALL your configuration data\n" "(including bouquets, services, satellite data ...)\n" "After completion of factory reset, your %s %s will restart automatically!\n\n" "Really do a factory reset?" ) % (getMachineBrand(), getMachineName()), MessageBox.TYPE_YESNO, default=False, ) self.setTitle(_("Factory reset")) self.skinName = "MessageBox" if self.isProtected() and config.ParentalControl.servicepin[0].value: self.onFirstExecBegin.append( boundFunction( self.session.openWithCallback, self.pinEntered, PinInput, pinList=[x.value for x in config.ParentalControl.servicepin], triesEntry=config.ParentalControl.retries.servicepin, title=_("Please enter the correct pin code"), windowTitle=_("Enter pin code"), ) )
def __init__(self, session): MessageBox.__init__(self, session, _("When you do a factory reset, you will lose ALL your configuration data\n" "(including bouquets, services, satellite data ...)\n" "After completion of factory reset, your STB_BOX will restart automatically!\n\n" "Really do a factory reset?"), MessageBox.TYPE_YESNO) self.setTitle(_("Factory reset")) self.skinName = "MessageBox"
def __init__(self, session): MessageBox.__init__(self, session, _("When you do a factory reset, you will lose ALL your configuration data\n" "(including bouquets, services, satellite data ...)\n" "After completion of factory reset, your %s %s will restart automatically!\n\n" "Really do a factory reset?") % (getMachineBrand(), getMachineName()), MessageBox.TYPE_YESNO, default = False) self.setTitle(_("Factory reset")) self.skinName = "MessageBox"
def __init__(self, session, retvalue=1, timeout=-1, default_yes = False): self.retval = retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _("Recording(s) are in progress or coming up in few seconds!") + '\n' if jobs: if jobs == 1: job = job_manager.getPendingJobs()[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) else: reason += (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n' if reason: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 42: _("Really upgrade your settop box and reboot now?") }.get(retvalue) if text: MessageBox.__init__(self, session, reason+text, type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="0,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session): MessageBox.__init__(self, session, _("Factory reset will restore your receiver to its default configuration. " "All user data including system settings, tuner configuration, bouquets, services and plugins will be DELETED. " "Recordings and other files stored on HDD and USB media will remain intact. " "After completion, the system will restart automatically!\n\n" "Do you really want to proceed?"), MessageBox.TYPE_YESNO, default=False) self.skinName = "MessageBox" ProtectedScreen.__init__(self)
def __init__(self, session, retvalue=1, timeout=-1, default_yes=True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) inTimeshift = ( Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus(Screens.InfoBar.InfoBar.instance) ) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() # if jobs: # reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n' # if jobs == 1: # job = job_manager.getPendingJobs()[0] # if job.name == "VFD Checker": # reason = "" # else: # reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) # else: # reason += (_("%d jobs are running in the background!") % jobs) + '\n' if inTimeshift: reason = _("You seem to be in timeshift!") + "\n" if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): default_yes = False reason = _("Recording(s) are in progress or coming up in few seconds!") + "\n" if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = "" elif reason and not inStandby: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 42: _("Really upgrade your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), 43: _("Really reflash your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), 44: _("Really upgrade the front panel and reboot now?"), 45: _("Really WOL now?"), }.get(retvalue) if text: MessageBox.__init__( self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes ) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="1310,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session): MessageBox.__init__(self, session, default = False, text = _("When you do a factory reset, you will lose ALL your configuration data, " "including timers, but not the contents of your hard disk.\n\n" "You can use the Backup Settings option in the Software Manager section " "of the Setup menu and then the Restore Settings option later.\n\n" "Your %s %s will reboot automatically after a factory reset.\n\n" "Do you really want to perform a factory reset now?") % (getMachineBrand(), getMachineName())) self.setTitle(_("Factory reset"))
def __init__(self, session, text, key1, key2, type): MessageBox.__init__(self, session, text=text, type=type, enable_input=False) self.skinName = "MessageBox" self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], {"ok": self.cancel, "cancel": self.cancel, key1: self.firstAction, key2: self.secondAction}, -1, ) self.firstKey = False eActionMap.getInstance().bindAction("", 0x7FFFFFFF, self.action)
def __init__(self, session): MessageBox.__init__( self, session, _("Do you want to autorestore settings?"), type=MessageBox.TYPE_YESNO, timeout=10, default=True, simple=True, )
def __init__(self, session, retvalue=1, timeout=-1, default_yes = True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings() jobs = [] for job in job_manager.getPendingJobs(): if job.name != dgettext('vix', 'SoftcamCheck'): jobs.append(job) inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus(Screens.InfoBar.InfoBar.instance) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if config.usage.task_warning.value and len(jobs): reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", len(jobs)) % len(jobs)) + '\n' if len(jobs) == 1: job = jobs[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) else: reason += (_("%d jobs are running in the background!") % len(jobs)) + '\n' if inTimeshift: reason = _("You seem to be in timeshift!") + '\n' if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): default_yes = False reason = _("Recording(s) are in progress or coming up in few seconds!") + '\n' if eStreamServer.getInstance().getConnectedClients() or StreamServiceList: reason += _("A client is streaming from this box!") + '\n' if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = "" elif reason and not inStandby: text = { QUIT_SHUTDOWN: _("Really shutdown now?"), QUIT_REBOOT: _("Really reboot now?"), QUIT_RESTART: _("Really restart now?"), QUIT_MAINT: _("Really reboot into Recovery Mode?"), QUIT_UPGRADE_FP: _("Really upgrade the frontprocessor and reboot now?"), QUIT_UPGRADE_PROGRAM: _("Really upgrade your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), QUIT_IMAGE_RESTORE: _("Really reflash your %s %s and reboot now?") % (getMachineBrand(), getMachineName()) }.get(retvalue) if text: MessageBox.__init__(self, session, "%s\n%s" % (reason, text), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="1310,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__( self, session, text, type=MessageBox.TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, ): MessageBox.__init__(self, session, text, type, timeout, close_on_any_key, default, enable_input, msgBoxID) if type == MessageBox.TYPE_YESNO: self.list = [(_("Agree"), 0), (_("Exit"), 1)] self["list"].setList(self.list)
def __init__( self, session, text, type=MessageBox.TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, ): MessageBox.__init__(self, session, text, type, timeout, close_on_any_key, default, enable_input, msgBoxID) self.skinName = "MessageBox" if type == MessageBox.TYPE_YESNO: self.list = [(_("Keep"), True), (_("Restore"), False)] self["list"].setList(self.list)
def __init__(self, *args, **kwargs): list = None self.dmm_fix = False import inspect argspec = inspect.getargspec(OrigMessageBox.__init__) if kwargs.get('simple') is not None and not 'simple' in argspec.args: del kwargs['simple'] if kwargs.get('list') is not None and not 'list' in argspec.args: list = kwargs.pop('list') self.dmm_fix = True OrigMessageBox.__init__(self, *args, **kwargs) # this is taylored solution for DMM based images, so it might crash elsewhere # or when dreambox changes something in MessageBox if list: self.list = list self["selectedChoice"].setText(self.list[0][0]) self["list"] = MenuList(self.list)
def __init__(self, session, retvalue = 1, timeout = -1, default_yes = True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus(Screens.InfoBar.InfoBar.instance) self.connected = False reason = '' next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if inTimeshift: reason = _('You seem to be in timeshift!') + '\n' default_yes = True timeout = 30 if recordings or next_rec_time > 0 and next_rec_time - time() < 360: default_yes = False reason = _('Recording(s) are in progress or coming up in few seconds!') + '\n' if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = '' elif reason and not inStandby: text = {1: _('Really shutdown now?'), 2: _('Really reboot now?'), 3: _('Really restart now?'), 4: _('Really upgrade the frontprocessor and reboot now?'), 42: _('Really upgrade your %s %s and reboot now?') % (getMachineBrand(), getMachineName()), 43: _('Really reflash your %s %s and reboot now?') % (getMachineBrand(), getMachineName()), 44: _('Really upgrade the front panel and reboot now?'), 45: _('Really WOL now?')}.get(retvalue) if text: MessageBox.__init__(self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = 'MessageBoxSimple' session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = '<screen position="1310,0" size="0,0"/>' Screen.__init__(self, session) self.close(True)
def __init__(self, session, retvalue=1, timeout=-1, default_yes = False): self.retval = retvalue self.connected = False reason = getReasons(session) if reason and not(internalHDDNotSleeping() and retvalue in (3, 6, 42)): text = { 1: _("Really shutdown your %s %s now?") % (MACHINEBRAND, MACHINENAME), 2: _("Really reboot your %s %s now?") % (MACHINEBRAND, MACHINENAME), 3: _("Really restart your %s %s now?") % (MACHINEBRAND, MACHINENAME), 4: _("Really upgrade the frontprocessor and reboot now?"), 42: _("Really upgrade your %s %s and reboot now?") % (MACHINEBRAND, MACHINENAME), 43: _("Really WOL now?") }.get(retvalue, _("Invalid reason")) MessageBox.__init__(self, session, "%s\n%s" % (reason, text), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) else: self.skin = """<screen position="0,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session, retvalue=1, timeout=-1, default_yes = True): self.retval=retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _("Recording(s) are in progress or coming up in few seconds!") + '\n' if jobs: if jobs == 1: job = job_manager.getPendingJobs()[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) else: reason += (_("%d jobs are running in the background!") % jobs) + '\n' if reason: if retvalue == 1: MessageBox.__init__(self, session, reason+_("Really shutdown now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) elif retvalue == 2: MessageBox.__init__(self, session, reason+_("Really reboot now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) elif retvalue == 4: pass else: MessageBox.__init__(self, session, reason+_("Really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBox" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) else: self.skin = """<screen name="TryQuitMainloop" position="0,0" size="0,0" flags="wfNoBorder"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session, retvalue=1, timeout=-1, default_yes=False, check_reasons=True): self.retval = retvalue self.connected = False reason = check_reasons and getReasons(session, retvalue) if reason: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 6: _("Really restart in debug mode now?"), 42: _("Really upgrade your settop box and reboot now?") }.get(retvalue, None) if text: MessageBox.__init__(self, session, "%s\n%s" % (reason, text), type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="0,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session, timeout=-1, default_yes = True): # self.retval = retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) self.connected = False reason = "" next_rec_time = -1 self.testTimer = eTimer() self.testTimer.callback.append(self.switchAndroid) if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _("Recording(s) are in progress or coming up in few seconds!") + '\n' if jobs: if jobs == 1: job = job_manager.getPendingJobs()[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) else: reason += (_("%d jobs are running in the background!") % jobs) + '\n' if reason: text = "Are you sure you want to switch to Android now?" MessageBox.__init__(self, session, reason+text, type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBox" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return else: text = "Are you sure you want to switch to Android now?" MessageBox.__init__(self, session, text, type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes) self.skinName = "MessageBox" self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return
def __init__(self, session): MessageBox.__init__(self, session, _("Are you sure you want to reload the EPG data from:\n") + config.misc.epgcache_filename.value, MessageBox.TYPE_YESNO) self.skinName = "MessageBox"
def __init__(self, *args, **kwargs): if kwargs.get('simple') is not None and not SimpleMessageBox: del kwargs['simple'] OrigMessageBox.__init__(self, *args, **kwargs)
def __init__(self, session, retvalue=QUIT_SHUTDOWN, timeout=-1, default_yes=True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings( False, Components.RecordingConfig.recType( config.recording.warn_box_restart_rec_types.getValue())) jobs = len(job_manager.getPendingJobs()) inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus( Screens.InfoBar.InfoBar.instance) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() # if jobs: # reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n' # if jobs == 1: # job = job_manager.getPendingJobs()[0] # if job.name == "VFD Checker": # reason = "" # else: # reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) # else: # reason += (_("%d jobs are running in the background!") % jobs) + '\n' if inTimeshift: reason = _("You seem to be in timeshift!") + '\n' default_yes = True timeout = 30 elif recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _( "Recording(s) are in progress or coming up in few seconds!" ) + '\n' default_yes = False timeout = 30 elif eStreamServer.getInstance().getConnectedClients( ) or StreamServiceList: reason = _("Client is streaming from this box!") default_yes = False timeout = 30 elif mediaFilesInUse(session) and retvalue in ( QUIT_SHUTDOWN, QUIT_REBOOT, QUIT_UPGRADE_FP, QUIT_UPGRADE_PROGRAM, QUIT_UPGRADE_FRONTPANEL): reason = _("A file from media is in use!") default_yes = False timeout = 30 if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = "" elif reason and not inStandby: text = { QUIT_SHUTDOWN: _("Really shutdown now?"), QUIT_REBOOT: _("Really reboot now?"), QUIT_RESTART: _("Really restart now?"), QUIT_UPGRADE_FP: _("Really upgrade the frontprocessor and reboot now?"), QUIT_MAINT: _("Really reboot into Recovery Mode?"), QUIT_UPGRADE_PROGRAM: _("Really upgrade your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), QUIT_IMAGE_RESTORE: _("Really reflash your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), QUIT_UPGRADE_FRONTPANEL: _("Really upgrade the front panel and reboot now?"), QUIT_WOLSHUTDOWN: _("Really WOL now?") }.get(retvalue) if text: MessageBox.__init__(self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="1310,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session): MessageBox.__init__(self, session, _('Are you sure you want to save the EPG Cache to:\n') + config.misc.epgcache_filename.value, MessageBox.TYPE_YESNO) self.skinName = 'MessageBox'
def __init__(self, session, seconds, message): MessageBox.__init__(self, session, message, type=MessageBox.TYPE_INFO, timeout=seconds, close_on_any_key=False, enable_input=False) self.skinName = "MessageBox"
def __init__(self, session): MessageBox.__init__(self, session, _("Last import: ")+ config.plugins.extra_epgimport.last_import.value + _(" events\n") + _("\nImport of epg data will start.\nThis may take a few minutes.\nIs this ok?"), MessageBox.TYPE_YESNO) self.skinName = "MessageBox"
def __init__(self, session): MessageBox.__init__(self, session, _("This image is intended for developers and testers.\nNo support will be provided!\nDo you understand this?"), type=MessageBox.TYPE_YESNO, timeout=20, default=False, simple=True)
def __init__(self, session, text, type = MessageBox.TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None): MessageBox.__init__(self,session,text,type,timeout,close_on_any_key,default,enable_input,msgBoxID) self.skinName = "MessageBox" if type == MessageBox.TYPE_YESNO: self.list = [ (_("Keep"), True), (_("Restore"), False) ] self["list"].setList(self.list)
def __init__(self, session): MessageBox.__init__(self, session, _("Are you sure you want to remove all bouquets created by ABM?"), MessageBox.TYPE_YESNO, default=False) self.skinName = "MessageBox"
def __init__(self, session): MessageBox.__init__(self, session, _('Are you sure you want to delete the EPG data from:\n') + config.misc.epgcache_filename.value, MessageBox.TYPE_YESNO, default=False) self.skinName = 'MessageBox'
def __init__(self, session): MessageBox.__init__(self, session, _('When you perform a factory reset, you will lose ALL of your configuration data\n(including bouquets, services, satellite data ...)\nAfter completion of the factory reset, your %s %s will restart automatically!\n\nDo you really want to do a factory reset?') % (getMachineBrand(), getMachineName()), MessageBox.TYPE_YESNO, default=False) self.setTitle(_('Factory reset')) self.skinName = 'MessageBox' ProtectedScreen.__init__(self)
def __init__(self, session): MessageBox.__init__( self, session, _("Are you sure you want to reload the EPG data from:\n") + config.misc.epgcache_filename.value, MessageBox.TYPE_YESNO) self.skinName = "MessageBox"
def __init__(self, session, retvalue=1, timeout=-1, default_yes=True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings( False, Components.RecordingConfig.recType( config.recording.warn_box_restart_rec_types.getValue())) jobs = len(job_manager.getPendingJobs()) inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus( Screens.InfoBar.InfoBar.instance) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() # if jobs: # reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n' # if jobs == 1: # job = job_manager.getPendingJobs()[0] # if job.name == "VFD Checker": # reason = "" # else: # reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end))) # else: # reason += (_("%d jobs are running in the background!") % jobs) + '\n' if inTimeshift: reason = _("You seem to be in timeshift!") + '\n' default_yes = True timeout = 30 if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _( "Recording(s) are in progress or coming up in few seconds!" ) + '\n' default_yes = False timeout = 30 if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = "" elif reason and not inStandby: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 16: _("Really reboot into Recovery Mode?"), 42: _("Really upgrade your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), 43: _("Really reflash your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), 44: _("Really upgrade the front panel and reboot now?"), 45: _("Really WOL now?") }.get(retvalue) if text: MessageBox.__init__(self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="1310,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session, retvalue=1, timeout=-1, default_yes=True): self.retval = retvalue self.ptsmainloopvalue = retvalue recordings = session.nav.getRecordings() jobs = [] for job in job_manager.getPendingJobs(): if job.name != dgettext('vix', 'SoftcamCheck'): jobs.append(job) inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus( Screens.InfoBar.InfoBar.instance) self.connected = False reason = "" next_rec_time = -1 if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if config.usage.task_warning.value and len(jobs): reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", len(jobs)) % len(jobs)) + '\n' if len(jobs) == 1: job = jobs[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100 * job.progress / float(job.end))) else: reason += (_("%d jobs are running in the background!") % len(jobs)) + '\n' if inTimeshift: reason = _("You seem to be in timeshift!") + '\n' if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): default_yes = False reason = _( "Recording(s) are in progress or coming up in few seconds!" ) + '\n' if reason and inStandby: session.nav.record_event.append(self.getRecordEvent) self.skinName = "" elif reason and not inStandby: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 42: _("Really upgrade your %s %s and reboot now?") % (getMachineBrand(), getMachineName()), 43: _("Really reflash your %s %s and reboot now?") % (getMachineBrand(), getMachineName()) }.get(retvalue) if text: MessageBox.__init__(self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = "MessageBoxSimple" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="1310,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def __init__(self, session): MessageBox.__init__(self, session, _("Do you want to autorestore settings?"), type=MessageBox.TYPE_YESNO, timeout=20, default=True, simple=True)
def __init__(self, session): if not os.path.isfile("/etc/installed"): from Components.Console import Console Console().ePopen("opkg list_installed | cut -d ' ' -f 1 > /etc/installed;chmod 444 /etc/installed") MessageBox.__init__(self, session, _("Do you want to autorestore settings?"), type=MessageBox.TYPE_YESNO, timeout=10, default=True, simple=True)
def __init__(self, session): if not os.path.isfile("/etc/installed"): from Components.Console import Console Console().ePopen("opkg list_installed | cut -d ' ' -f 1 > /etc/installed;chmod 444 /etc/installed") MessageBox.__init__(self, session, _("Do you want to autorestore settings?"), type=MessageBox.TYPE_YESNO, timeout=10, default=True, simple=True)
def __init__(self, session): MessageBox.__init__(self, session, _("Are you sure you want to save the EPG cache to:\n") + config.misc.epgcache_filename.getValue(), MessageBox.TYPE_YESNO) self.skinName = "MessageBox"
def __init__(self, session, text, type = 1, timeout = -1, close_on_any_key = False, default = True): MessageBox.__init__(self, session, text, type, timeout, close_on_any_key, default) self.skinName = "MessageBox"