def close(self, value): if self.connected: self.connected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if path.exists("/usr/scripts/standby_enter.sh"): Console().ePopen("/usr/scripts/standby_enter.sh") self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog( QuitMainloopScreen, retvalue=self.retval) self.quitScreen.show() print "[Standby] quitMainloop #1" quitMainloopCode = self.retval if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off / fix a deep-standby-crash on some boxes / gb4k print "[Standby] LCDminiTV off" setLCDMiniTVMode("0") if getBoxType() == "vusolo4k": #workaround for white display flash f = open("/proc/stb/fp/oled_brightness", "w") f.write("0") f.close() quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): global quitMainloopCode if self.connected: self.connected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == QUIT_SHUTDOWN: config.misc.DeepStandby.value = True self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog( QuitMainloopScreen, retvalue=self.retval) self.quitScreen.show() print "[Standby] quitMainloop #1" quitMainloopCode = self.retval if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off / fix a deep-standby-crash on some boxes / gb4k print "[Standby] LCDminiTV off" setLCDModeMinitTV("0") if getBoxType() == "vusolo4k": #workaround for white display flash open("/proc/stb/fp/oled_brightness", "w").write("0") setLCDModeMinitTV4k(config.lcd.modeminitv4k.value) quitMainloop(self.retval) else: MessageBox.close(self, True)
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 close(self, value): global quitMainloopCode if self.connected: self.connected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == QUIT_SHUTDOWN: config.misc.DeepStandby.value = True config.misc.StartMode.value = self.retval config.misc.StartMode.save() self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog( QuitMainloopScreen, retvalue=self.retval) self.quitScreen.show() print '[Standby] quitMainloop #1' quitMainloopCode = self.retval if SystemInfo['Display'] and SystemInfo['LCDMiniTV']: print '[Standby] LCDminiTV off' setLCDModeMinitTV('0') if getBoxType() == 'vusolo4k': open('/proc/stb/fp/oled_brightness', 'w').write('0') quitMainloop(self.retval) else: MessageBox.close(self, True)
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, retvalue=QUIT_SHUTDOWN, timeout=-1, default_yes=False, check_reasons=True): self.retval = retvalue self.connected = False reason = check_reasons and getReasons(session, retvalue) if reason: text = { QUIT_SHUTDOWN: _("Really shutdown now?"), QUIT_REBOOT: _("Really reboot now?"), QUIT_RESTART: _("Really restart now?"), QUIT_UPGRADE_FP: _("Really update the frontprocessor and reboot now?"), QUIT_DEBUG_RESTART: _("Really restart in debug mode now?"), QUIT_REBOOT_ANDROID: _("Really reboot into android mode?"), QUIT_REBOOT_RECOVERY: _("Really reboot into recovery mode?"), QUIT_UPGRADE_PROGRAM: _("Really update your settop box and reboot now?"), QUIT_MANUFACTURER_RESET: _("Really perform a manufacturer reset now?"), QUIT_UPGRADE_FPANEL: _("Really update the front panel and reboot now?"), QUIT_WOL: _("Really WOL 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 close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if not inStandby: if os.path.exists("/usr/script/Standby.sh"): Console().ePopen("/usr/script/Standby.sh off") if os.path.exists("/usr/script/standby_enter.sh"): Console().ePopen("/usr/script/standby_enter.sh") if SystemInfo["HasHDMI-CEC"] and config.hdmicec.enabled.value and config.hdmicec.control_tv_standby.value and config.hdmicec.next_boxes_detect.value: import Components.HdmiCec Components.HdmiCec.hdmi_cec.secondBoxActive() self.delay = eTimer() self.delay.timeout.callback.append(self.quitMainloop) self.delay.start(1500, True) return elif not inStandby: config.misc.RestartUI.value = True config.misc.RestartUI.save() self.quitMainloop() else: MessageBox.close(self, True)
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 close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == QUIT_SHUTDOWN: config.misc.DeepStandby.value = True if not inStandby: if os.path.exists("/usr/script/standby_enter.sh"): Console().ePopen("/usr/script/standby_enter.sh") if SystemInfo["HasHDMI-CEC"] and config.hdmicec.enabled.value and config.hdmicec.control_tv_standby.value and config.hdmicec.next_boxes_detect.value: import Components.HdmiCec Components.HdmiCec.hdmi_cec.secondBoxActive() self.delay = eTimer() self.delay.timeout.callback.append(self.quitMainloop) self.delay.start(1500, True) return elif not inStandby: config.misc.RestartUI.value = True config.misc.RestartUI.save() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: print("[Standby] LCDminiTV off") try: open("/proc/stb/lcd/mode", "w").write(0) except: pass if getBoxType() == "vusolo4k": try: open("/proc/stb/fp/oled_brightness", "w").write("0") except: pass self.quitMainloop() else: MessageBox.close(self, True)
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 self.connected = False reason = getReasons(session) 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) 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): self._isFrontProcessor = HardwareInfo().get_device_name( ) in self.NRF_AS_FRONTPROCESSOR_DEVICES if self._isFrontProcessor: title = _("Flashing Frontprocessor Firmware") windowTitle = _("Frontprocessor Firmware") else: title = _("Flashing Adapter Firmware") windowTitle = _("Bluetooth Frontprocessor Firmware") fakeText = "\n. .\n.\n.\n." ##reserve some space for future text in our messagebox MessageBox.__init__(self, session, fakeText, title=title, type=MessageBox.TYPE_WARNING, windowTitle=windowTitle) self.skinName = "MessageBox" self._console = eConsoleAppContainer() self.__onDataConn = self._console.dataAvail.connect(self._onData) self.__onAppClosedConn = self._console.appClosed.connect( self._onAppClosed) self._dm = eInputDeviceManager.getInstance() self._success = False self._flasherMissing = False self.onFirstExecBegin.append(self._check) self.onShow.append(self.__onShow) self.onClose.append(self.__onClose) self._flashFirmware()
def __init__(self, session, replytext_1="", replytext_2="", type = MessageBox.TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None): self.replytext_1 = replytext_1 self.replytext_2 = replytext_2 MessageBox.__init__(self,session,self.replytext_1 + "\n" + self.replytext_2,type,timeout,close_on_any_key,default,enable_input,msgBoxID) if type == MessageBox.TYPE_YESNO: self.list = [ (_("Keep"), 0), (_("Restore"), 1) ] self["list"].setList(self.list)
def close(self, value): if self.connected: self.connected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == QUIT_SHUTDOWN: config.misc.DeepStandby.value = True if not inStandby: if os.path.exists("/usr/script/standby_enter.sh"): Console().ePopen("/usr/script/standby_enter.sh") if SystemInfo[ "HasHDMI-CEC"] and config.hdmicec.enabled.value and config.hdmicec.control_tv_standby.value and config.hdmicec.next_boxes_detect.value: import Components.HdmiCec Components.HdmiCec.hdmi_cec.secondBoxActive() self.delay = eTimer() self.delay.timeout.callback.append(self.quitMainloop) self.delay.start(1500, True) return elif not inStandby: config.misc.RestartUI.value = True config.misc.RestartUI.save() self.quitMainloop() else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if os.path.exists("/usr/scripts/standby_enter.sh"): Console().ePopen("/usr/scripts/standby_enter.sh") self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() print "[Standby] quitMainloop #1" quitMainloopCode = self.retval if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off / fix a deep-standby-crash on some boxes / gb4k print "[Standby] LCDminiTV off" setLCDMiniTVMode("0") if getBoxType() == "vusolo4k": #workaround for white display flash f = open("/proc/stb/fp/oled_brightness", "w") f.write("0") f.close() quitMainloop(self.retval) else: MessageBox.close(self, 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): MessageBox.__init__(self, session, _("Desea restaurar su configuracion?"), type=MessageBox.TYPE_YESNO, timeout=20, default=True, simple=True)
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 ok(self): if self.dmm_fix: if self.list: self.close(self["list"].getCurrent()[1]) else: self.close(True) else: OrigMessageBox.ok(self)
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 close(self, value): if self.connected: self.conntected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: quitMainloop(self.retval) else: MessageBox.close(self, True)
def __init__(self, session): MessageBox.__init__(self, session, _("Setup"), MessageBox.TYPE_INFO, enable_input=False) self.errors = [] self.onShown.append(self.start)
def close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: quitMainloop(self.retval) else: MessageBox.close(self, True)
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, 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, _("Do you want to remove all unused translations?"), type=MessageBox.TYPE_YESNO, timeout=20, default=False, simple=True)
def close(self, value): if value: language.delLanguage() config.misc.do_deletelanguage.value = True config.misc.do_deletelanguage.save() config.misc.ask_languagedeletion.value = False config.misc.ask_languagedeletion.save() configfile.save() MessageBox.close(self)
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): 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, 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 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 = { 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, _("Do you want to autorestore settings?"), type=MessageBox.TYPE_YESNO, timeout=10, default=True, simple=True, )
def close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: if self.retval ==1: config.misc.DeepStandbyOn.value=True quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: # hack .. we dont like to show any other screens when this screen has closed self.onClose = [self.__closed] self.session.dialog_stack = [] self.session.summary_stack = [None] MessageBox.close(self, True)
def close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: if self.retval == 1: config.misc.DeepStandby.value = True quitMainloop(self.retval) else: MessageBox.close(self, True)
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"
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, 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, _("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 close(self, value): if self.connected: self.conntected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: # hack .. we dont like to show any other screens when this screen has closed self.onClose = [self.__closed] self.session.dialog_stack = [] self.session.summary_stack = [None] MessageBox.close(self, 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_ANDROID: _("Really reboot into Android Mode?"), 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, 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 close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() self.session.nav.stopService() print "show image info" self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=10) self.quitScreen.show() # switch system self.testTimer.start(2000) else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() quitMainloop(self.retval) else: MessageBox.close(self, 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 close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() if getBoxType() == "vusolo4k": #workaround for white display flash open("/proc/stb/fp/oled_brightness", "w").write("0") quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if os.path.exists("/usr/script/standby_enter.sh"): Console().ePopen("/usr/script/standby_enter.sh") elif not inStandby: config.misc.RestartUI.value = True config.misc.RestartUI.save() self.quitMainloop() else: MessageBox.close(self, True)
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 close(self, value): if self.connected: self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval ==1: config.misc.DeepStandbyOn.value=True # WARNING HACK !! Black Hole dirty hack if self.retval == 1 or self.retval == 2: system("umount -a -f -t nfs,smbfs,cifs,ncpfs") #end self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if os.path.exists("/usr/script/Standby.sh"): Console().ePopen("/usr/script/Standby.sh off") if os.path.exists("/usr/script/standby_enter.sh"): Console().ePopen("/usr/script/standby_enter.sh") self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): global quitMainloopCode if self.connected: self.connected = False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen, retvalue=self.retval) self.quitScreen.show() print '[Standby] quitMainloop #1' quitMainloopCode = self.retval if getBoxType() == 'vusolo4k': open('/proc/stb/fp/oled_brightness', 'w').write('0') quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): global quitMainloopCode if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() print "[Standby] quitMainloop #1" quitMainloopCode = self.retval if SystemInfo["OffLCDbrightness"]: open(SystemInfo["OffLCDbrightness"], "w").write("0") quitMainloop(self.retval) else: MessageBox.close(self, True)
def close(self, value): if self.connected: self.connected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: self.hide() if self.retval == 1: config.misc.DeepStandby.value = True if os.path.exists("/etc/cron/standby_on"): Console().ePopen("/bin/run-parts /etc/cron/standby_on") elif not inStandby: config.misc.RestartUI.value = True config.misc.RestartUI.save() self.session.nav.stopService() self.quitScreen = self.session.instantiateDialog(QuitMainloopScreen,retvalue=self.retval) self.quitScreen.show() quitMainloop(self.retval) else: MessageBox.close(self, True)
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)