Example #1
0
    def createSetup(self):
        print "Creating setup"
        self.list = []

        self.multiType = None
        self.configMode = None
        self.diseqcModeEntry = None
        self.advancedSatsEntry = None
        self.advancedLnbsEntry = None
        self.advancedDiseqcMode = None
        self.advancedUsalsEntry = None
        self.advancedLof = None
        self.advancedPowerMeasurement = None
        self.turningSpeed = None
        self.turnFastEpochBegin = None
        self.turnFastEpochEnd = None
        self.toneburst = None
        self.committedDiseqcCommand = None
        self.uncommittedDiseqcCommand = None
        self.commandOrder = None
        self.cableScanType = None
        self.have_advanced = False
        self.advancedUnicable = None
        self.advancedType = None
        self.advancedManufacturer = None
        self.advancedSCR = None
        self.advancedConnected = None
        self.showAdditionalMotorOptions = None
        self.selectSatsEntry = None
        self.advancedSelectSatsEntry = None
        self.singleSatEntry = None

        if self.nim.isMultiType():
            multiType = self.nimConfig.multiType
            self.multiType = getConfigListEntry(_("Tuner type"), multiType)
            self.list.append(self.multiType)

        if self.nim.isCompatible("DVB-S"):
            self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
            self.list.append(self.configMode)

            if self.nimConfig.configMode.value == "simple":  # simple setup
                self.diseqcModeEntry = getConfigListEntry(
                    pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode
                )
                self.list.append(self.diseqcModeEntry)
                if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
                    self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
                if self.nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
                    self.createPositionerSetup(self.list)
            elif self.nimConfig.configMode.value == "equal":
                choices = []
                nimlist = nimmanager.canEqualTo(self.nim.slot)
                for id in nimlist:
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "satposdepends":
                choices = []
                nimlist = nimmanager.canDependOn(self.nim.slot)
                for id in nimlist:
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "loopthrough":
                choices = []
                print "connectable to:", nimmanager.canConnectTo(self.slotid)
                connectable = nimmanager.canConnectTo(self.slotid)
                for id in connectable:
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "nothing":
                pass
            elif self.nimConfig.configMode.value == "advanced":  # advanced
                # SATs
                self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
                self.list.append(self.advancedSatsEntry)
                current_config_sats = self.nimConfig.advanced.sats.value
                if current_config_sats in ("3605", "3606"):
                    self.advancedSelectSatsEntry = getConfigListEntry(
                        _("Press OK to select satellites"), self.nimConfig.pressOKtoList
                    )
                    self.list.append(self.advancedSelectSatsEntry)
                    self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
                else:
                    cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
                    satlist = self.nimConfig.advanced.sat.keys()
                    if cur_orb_pos is not None:
                        if cur_orb_pos not in satlist:
                            cur_orb_pos = satlist[0]
                        self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
                self.have_advanced = True
            if self.nim.description == "Alps BSBE2" and config.usage.setup_level.index >= 2:  # expert
                self.list.append(getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude))
        elif self.nim.isCompatible("DVB-C"):
            self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
            self.list.append(self.configMode)
            if self.nimConfig.configMode.value == "enabled":
                self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
                self.cableScanType = getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
                self.list.append(self.cableScanType)
                if self.nimConfig.cable.scan_type.value == "provider":
                    self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
                else:
                    if self.nimConfig.cable.scan_type.value == "bands":
                        # TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I
                            )
                        )
                        self.list.append(
                            getConfigListEntry(_("Scan %s band") % ("EU MID"), self.nimConfig.cable.scan_band_EU_MID)
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III
                            )
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV
                            )
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V
                            )
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER
                            )
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER
                            )
                        )
                        self.list.append(
                            getConfigListEntry(_("Scan %s band") % ("US LOW"), self.nimConfig.cable.scan_band_US_LOW)
                        )
                        self.list.append(
                            getConfigListEntry(_("Scan %s band") % ("US MID"), self.nimConfig.cable.scan_band_US_MID)
                        )
                        self.list.append(
                            getConfigListEntry(_("Scan %s band") % ("US HIGH"), self.nimConfig.cable.scan_band_US_HIGH)
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("US SUPER"), self.nimConfig.cable.scan_band_US_SUPER
                            )
                        )
                        self.list.append(
                            getConfigListEntry(
                                _("Scan %s band") % ("US HYPER"), self.nimConfig.cable.scan_band_US_HYPER
                            )
                        )
                    elif self.nimConfig.cable.scan_type.value == "steps":
                        self.list.append(
                            getConfigListEntry(
                                _("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps
                            )
                        )
                        # TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
                    self.list.append(getConfigListEntry(_("Scan %s") % ("QAM16"), self.nimConfig.cable.scan_mod_qam16))
                    self.list.append(getConfigListEntry(_("Scan %s") % ("QAM32"), self.nimConfig.cable.scan_mod_qam32))
                    self.list.append(getConfigListEntry(_("Scan %s") % ("QAM64"), self.nimConfig.cable.scan_mod_qam64))
                    self.list.append(
                        getConfigListEntry(_("Scan %s") % ("QAM128"), self.nimConfig.cable.scan_mod_qam128)
                    )
                    self.list.append(
                        getConfigListEntry(_("Scan %s") % ("QAM256"), self.nimConfig.cable.scan_mod_qam256)
                    )
                    self.list.append(getConfigListEntry(_("Scan %s") % ("SR6900"), self.nimConfig.cable.scan_sr_6900))
                    self.list.append(getConfigListEntry(_("Scan %s") % ("SR6875"), self.nimConfig.cable.scan_sr_6875))
                    self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
                    self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
            self.have_advanced = False
        elif self.nim.isCompatible("DVB-T"):
            self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
            self.list.append(self.configMode)
            self.have_advanced = False
            if self.nimConfig.configMode.value == "enabled":
                self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
                self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
        else:
            self.have_advanced = False
        self["config"].list = self.list
        self["config"].l.setList(self.list)
Example #2
0
 def test_some_translations_with_context(self):
     eq = self.assertEqual
     eq(gettext.pgettext('my context', 'nudge nudge'),
        'wink wink (in "my context")')
     eq(gettext.pgettext('my other context', 'nudge nudge'),
        'wink wink (in "my other context")')
Example #3
0
	def createSetup(self):
		level = config.usage.setup_level.index

		self.list = [
			getConfigListEntry(_("Video output"), config.av.videoport, _("Configures which video output connector will be used."))
		]

		# if we have modes for this port:
		if config.av.videoport.value in config.av.videomode:
			# add mode- and rate-selection:
			self.list.append(getConfigListEntry(pgettext("Video output mode", "Mode"), config.av.videomode[config.av.videoport.value], _("Configure the video output mode (or resolution).")))
			if config.av.videomode[config.av.videoport.value].value == 'PC':
				self.list.append(getConfigListEntry(_("Resolution"), config.av.videorate[config.av.videomode[config.av.videoport.value].value], _("Configure the screen resolution in PC output mode.")))
			else:
				self.list.append(getConfigListEntry(_("Refresh rate"), config.av.videorate[config.av.videomode[config.av.videoport.value].value], _("Configure the refresh rate of the screen.")))

		port = config.av.videoport.value
		if port not in config.av.videomode:
			mode = None
		else:
			mode = config.av.videomode[port].value

		# some modes (720p, 1080i) are always widescreen. Don't let the user select something here, "auto" is not what he wants.
		force_wide = self.hw.isWidescreenMode(port, mode)

		if not force_wide:
			self.list.append(getConfigListEntry(_("Aspect ratio"), config.av.aspect, _("Configure the aspect ratio of the screen.")))

		if force_wide or config.av.aspect.value in ("16_9", "16_10"):
			self.list.extend((
				getConfigListEntry(_("Display 4:3 content as"), config.av.policy_43, _("When the content has an aspect ratio of 4:3, choose whether to scale/stretch the picture.")),
				getConfigListEntry(_("Display >16:9 content as"), config.av.policy_169, _("When the content has an aspect ratio of 16:9, choose whether to scale/stretch the picture."))
			))
		elif config.av.aspect.value == "4_3":
			self.list.append(getConfigListEntry(_("Display 16:9 content as"), config.av.policy_169, _("When the content has an aspect ratio of 16:9, choose whether to scale/stretch the picture.")))

#		if config.av.videoport.value == "DVI":
#			self.list.append(getConfigListEntry(_("Allow Unsupported Modes"), config.av.edid_override))
		if config.av.videoport.value == "Scart":
			self.list.append(getConfigListEntry(_("Color format"), config.av.colorformat, _("Configure which color format should be used on the SCART output.")))
			if level >= 1:
				self.list.append(getConfigListEntry(_("WSS on 4:3"), config.av.wss, _("When enabled, content with an aspect ratio of 4:3 will be stretched to fit the screen.")))
				if SystemInfo["ScartSwitch"]:
					self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch, _("When enabled, your receiver will detect activity on the VCR SCART input.")))

		if level >= 1:
			if SystemInfo["CanDownmixAC3"]:
				self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3, _("Configure whether multi channel sound tracks should be downmixed to stereo.")))
			if SystemInfo["CanDownmixDTS"]:
				self.list.append(getConfigListEntry(_("DTS downmix"), config.av.downmix_dts, _("Configure whether multi channel sound tracks should be downmixed to stereo.")))
			if SystemInfo["CanDownmixAAC"]:
				self.list.append(getConfigListEntry(_("AAC downmix"), config.av.downmix_aac, _("Configure whether multi channel sound tracks should be downmixed to stereo.")))
			self.list.extend((
				getConfigListEntry(_("General AC3 delay"), config.av.generalAC3delay, _("Configure the general audio delay of Dolby Digital sound tracks.")),
				getConfigListEntry(_("General PCM delay"), config.av.generalPCMdelay, _("Configure the general audio delay of stereo sound tracks."))
			))

		if SystemInfo["CanChangeOsdAlpha"]:
			self.list.append(getConfigListEntry(_("OSD transparency"), config.av.osd_alpha, _("Configure the transparency of the OSD.")))

		if not isinstance(config.av.scaler_sharpness, ConfigNothing):
			self.list.append(getConfigListEntry(_("Scaler sharpness"), config.av.scaler_sharpness, _("Configure the sharpness of the video scaling.")))

		self["config"].list = self.list
		self["config"].l.setList(self.list)