Example #1
0
	def okbuttonClick(self):
		nim = self["nimlist"].getCurrent()
		nim = nim and nim[3]

		nimConfig = nimmanager.getNimConfig(nim.slot)
		if nim.isFBCLink() and nimConfig.configMode.value == "nothing" and not getLinkedSlotID(nim.slot) == -1:
			return

		if nim is not None and not nim.empty and nim.isSupported():
			self.session.openWithCallback(boundFunction(self.NimSetupCB, self["nimlist"].getIndex()), self.resultclass, nim.slot)
Example #2
0
	def okbuttonClick(self):
		recordings = self.session.nav.getRecordings()
		next_rec_time = self.session.nav.RecordTimer.getNextRecordingTime()
		if recordings or (next_rec_time and next_rec_time > 0 and (next_rec_time - time()) < 360):
			self.session.open(MessageBox, _("Recording(s) are in progress or coming up in few seconds!"), MessageBox.TYPE_INFO, timeout=5, enable_input=False)
		else:
			nim = self["nimlist"].getCurrent()
			nim = nim and nim[3]

			nimConfig = nimmanager.getNimConfig(nim.slot)
			if nim.isFBCLink() and nimConfig.configMode.value == "nothing" and not getLinkedSlotID(nim.slot) == -1:
				return

			if nim is not None and not nim.empty and nim.isSupported():
				self.session.openWithCallback(boundFunction(self.NimSetupCB, self["nimlist"].getIndex()), self.resultclass, nim.slot)
Example #3
0
	def okbuttonClick(self):
		recordings = self.session.nav.getRecordings()
		next_rec_time = self.session.nav.RecordTimer.getNextRecordingTime()
		if recordings or (next_rec_time and next_rec_time > 0 and (next_rec_time - time()) < 360):
			self.session.open(MessageBox, _("Recording(s) are in progress or coming up in few seconds!"), MessageBox.TYPE_INFO, timeout=5, enable_input=False)
		else:
			nim = self["nimlist"].getCurrent()
			nim = nim and nim[3]

			nimConfig = nimmanager.getNimConfig(nim.slot)
			if nim.isFBCLink() and nimConfig.configMode.value == "nothing" and not getLinkedSlotID(nim.slot) == -1:
				return

			if nim is not None and not nim.empty and nim.isSupported():
				self.session.openWithCallback(boundFunction(self.NimSetupCB, self["nimlist"].getIndex()), self.resultclass, nim.slot)
Example #4
0
    def loadFBCLinks(self):
        for x in nimmanager.nim_slots:
            slotid = x.slot
            nimConfig = nimmanager.getNimConfig(x.slot)
            configMode = nimConfig.configMode.value
            if self.showNim(x):
                if x.isCompatible("DVB-S"):
                    if isFBCLink(x.slot) and configMode != "advanced":
                        link = getLinkedSlotID(x.slot)

                        if link == -1:
                            nimConfig.configMode.value = "nothing"
                        else:
                            nimConfig.configMode.value = "loopthrough"
                            nimConfig.connectedTo.value = str(link)
Example #5
0
	def loadFBCLinks(self):
		for x in nimmanager.nim_slots:
			slotid = x.slot
			if self.showNim(x):
				if x.isCompatible("DVB-S"):
					nimConfig = nimmanager.getNimConfig(x.slot).dvbs
					configMode = nimConfig.configMode.value
					if isFBCLink(x.slot) and configMode != "advanced":
						link = getLinkedSlotID(x.slot)

						if link == -1:
							nimConfig.configMode.value = "nothing"
						else:
							nimConfig.configMode.value = "loopthrough"
							nimConfig.connectedTo.value = str(link)
Example #6
0
	def updateList(self, index=None):
		self.list = [ ]
		for x in nimmanager.nim_slots:
			slotid = x.slot
			nimConfig = nimmanager.getNimConfig(x.slot)
			text = nimConfig.configMode.value
			if self.showNim(x):
				if x.isCompatible("DVB-S"):
					if nimConfig.configMode.value in ("loopthrough", "equal", "satposdepends"):
						if x.isFBCLink():
							text = _("FBC automatic\nconnected to")
						else:
							text = { "loopthrough": _("Loop through from"),
									"equal": _("Equal to"),
									"satposdepends": _("Second cable of motorized LNB") } [nimConfig.configMode.value]
						text += " " + nimmanager.getNim(int(nimConfig.connectedTo.value)).slot_name
					elif nimConfig.configMode.value == "nothing":
						if x.isFBCLink():
							link = getLinkedSlotID(x.slot)
							if link == -1:
								text = _("FBC automatic\ninactive")
							else:
								link = nimmanager.getNim(link).slot_name
								text = _("FBC automatic\nconnected to %s") % link
						else:
							text = _("not configured")
					elif nimConfig.configMode.value == "simple":
						if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
							text = {"single": _("Single"), "toneburst_a_b": _("Toneburst A/B"), "diseqc_a_b": _("DiSEqC A/B"), "diseqc_a_b_c_d": _("DiSEqC A/B/C/D")}[nimConfig.diseqcMode.value] + "\n"
							text += _("Sats") + ": "
							satnames = []
							if nimConfig.diseqcA.orbital_position < 3600:
								satnames.append(nimmanager.getSatName(int(nimConfig.diseqcA.value)))
							if nimConfig.diseqcMode.value in ("toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
								if nimConfig.diseqcB.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcB.value)))
							if nimConfig.diseqcMode.value == "diseqc_a_b_c_d":
								if nimConfig.diseqcC.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcC.value)))
								if nimConfig.diseqcD.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcD.value)))
							if len(satnames) <= 2:
								text += ", ".join(satnames)
							elif len(satnames) > 2:
								# we need a newline here, since multi content lists don't support automtic line wrapping
								text += ", ".join(satnames[:2]) + ",\n"
								text += "         " + ", ".join(satnames[2:])
						elif nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
							text = {"positioner": _("Positioner"), "positioner_select": _("Positioner (selecting satellites)")}[nimConfig.diseqcMode.value]
							text += ": "
							if nimConfig.positionerMode.value == "usals":
								text += "USALS"
							elif nimConfig.positionerMode.value == "manual":
								text += _("Manual")
						else:
							text = _("Simple")
					elif nimConfig.configMode.value == "advanced":
						text = _("Advanced") + "\n"
						text += _("Sats") + ": "
						satnames = []
						for sat in nimmanager.getSatListForNim(slotid):
							satnames.append(self.OrbToStr(int(sat[0])))
						text += ", ".join(satnames)
				elif x.isCompatible("DVB-T") or x.isCompatible("DVB-C") or x.isCompatible("ATSC"):
					if nimConfig.configMode.value == "nothing":
						text = _("Nothing connected")
					elif nimConfig.configMode.value == "enabled":
						text = _("Enabled")
				if x.isMultiType():
					text = _("Switchable tuner types:") + " (" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text
				if not x.isSupported():
					text = _("Tuner is not supported")

				self.list.append((slotid, x.friendly_full_description, text, x))
		self["nimlist"].setList(self.list)
		self["nimlist"].updateList(self.list)
		if index is not None:
			self["nimlist"].setIndex(index)
Example #7
0
	def updateList(self, index=None):
		self.list = [ ]
		for x in nimmanager.nim_slots:
			slotid = x.slot
			nimConfig = nimmanager.getNimConfig(x.slot)
			text = nimConfig.configMode.value
			if self.showNim(x):
				if x.isCompatible("DVB-S"):
					if nimConfig.configMode.value in ("loopthrough", "equal", "satposdepends"):
						if x.isFBCLink():
							text = "FBC automatic loop through\nlinked to"
						else:
							text = { "loopthrough": _("Loop through to"),
									"equal": _("Equal to"),
									"satposdepends": _("Second cable of motorized LNB") } [nimConfig.configMode.value]
						text += " " + nimmanager.getNim(int(nimConfig.connectedTo.value)).slot_name
					elif nimConfig.configMode.value == "nothing":
						if x.isFBCLink():
							link = getLinkedSlotID(x.slot)
							if link == -1:
								text = _("FBC automatic loop through\ninactive")
							else:
								link = nimmanager.getNim(link).slot_name
								text = _("FBC automatic loop through\nlinked to %s") % link
						else:
							text = _("not configured")
					elif nimConfig.configMode.value == "simple":
						if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
							text = {"single": _("Single"), "toneburst_a_b": _("Toneburst A/B"), "diseqc_a_b": _("DiSEqC A/B"), "diseqc_a_b_c_d": _("DiSEqC A/B/C/D")}[nimConfig.diseqcMode.value] + "\n"
							text += _("Sats") + ": "
							satnames = []
							if nimConfig.diseqcA.orbital_position < 3600:
								satnames.append(nimmanager.getSatName(int(nimConfig.diseqcA.value)))
							if nimConfig.diseqcMode.value in ("toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
								if nimConfig.diseqcB.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcB.value)))
							if nimConfig.diseqcMode.value == "diseqc_a_b_c_d":
								if nimConfig.diseqcC.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcC.value)))
								if nimConfig.diseqcD.orbital_position < 3600:
									satnames.append(nimmanager.getSatName(int(nimConfig.diseqcD.value)))
							if len(satnames) <= 2:
								text += ", ".join(satnames)
							elif len(satnames) > 2:
								# we need a newline here, since multi content lists don't support automtic line wrapping
								text += ", ".join(satnames[:2]) + ",\n"
								text += "         " + ", ".join(satnames[2:])
						elif nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
							text = {"positioner": _("Positioner"), "positioner_select": _("Positioner (selecting satellites)")}[nimConfig.diseqcMode.value]
							text += ":"
							if nimConfig.positionerMode.value == "usals":
								text += "USALS"
							elif nimConfig.positionerMode.value == "manual":
								text += _("Manual")
						else:
							text = _("Simple")
					elif nimConfig.configMode.value == "advanced":
						text = _("Advanced")
				elif x.isCompatible("DVB-T") or x.isCompatible("DVB-C"):
					if nimConfig.configMode.value == "nothing":
						text = _("Nothing connected")
					elif nimConfig.configMode.value == "enabled":
						text = _("Enabled")
				if x.isMultiType():
					text = _("Switchable tuner types:") + "(" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text
				if not x.isSupported():
					text = _("Tuner is not supported")

				self.list.append((slotid, x.friendly_full_description, text, x))
		self["nimlist"].setList(self.list)
		self["nimlist"].updateList(self.list)
		if index is not None:
			self["nimlist"].setIndex(index)