Esempio n. 1
0
	def __init__(self, default = False):
		ConfigBoolean.__init__(self, default = default, descriptions = goto_descriptions)
# -*- coding: utf-8 -*-
from __future__ import print_function
from . import _
from os import listdir, path
from Plugins.Plugin import PluginDescriptor
from Components.config import config, ConfigBoolean
from BackupManager import BackupManagerautostart
from ImageManager import ImageManagerautostart
from SwapManager import SwapAutostart
from SoftcamManager import SoftcamAutostart
from ScriptRunner import ScriptRunnerAutostart
from IPKInstaller import OpkgInstaller
from ClientModeBox import ClientModeBoxWizard
from Components.SystemInfo import BoxInfo

config.misc.restorewizardrun = ConfigBoolean(default=False)


def setLanguageFromBackup(backupfile):
    try:
        print(backupfile)
        import tarfile
        tar = tarfile.open(backupfile)
        for member in tar.getmembers():
            if member.name == 'etc/enigma2/settings':
                for line in tar.extractfile(member):
                    if line.startswith('config.osd.language'):
                        print(line)
                        languageToSelect = line.strip().split('=')[1]
                        print(languageToSelect)
                        if languageToSelect:
Esempio n. 3
0
	def __init__(self, descriptions = "", fnc = None):
		ConfigBoolean.__init__(self, descriptions = descriptions)
		self.fnc = fnc
    def createConfig(self, *args):
        config.pep = ConfigSubsection()
        config.pep.configsteps = NoSave(
            ConfigSelection(choices=[1, 5, 10, 25], default=1))

        if os.path.exists("/proc/stb/video/plane/psi_contrast"):

            def setContrast(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting contrast to: %s" % myval)
                    open("/proc/stb/video/plane/psi_contrast",
                         "w").write("%s" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write psi_contrast.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.contrast = ConfigSlider(default=128, limits=(0, 255))
            config.pep.contrast.addNotifier(setContrast)
        else:
            config.pep.contrast = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/video/plane/psi_saturation"):

            def setSaturation(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting saturation to: %s" %
                          myval)
                    open("/proc/stb/video/plane/psi_saturation",
                         "w").write("%s" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write psi_saturation.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.saturation = ConfigSlider(default=128, limits=(0, 255))
            config.pep.saturation.addNotifier(setSaturation)
        else:
            config.pep.saturation = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/video/plane/psi_tint"):

            def setHue(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting hue to: %s" % myval)
                    open("/proc/stb/video/plane/psi_tint",
                         "w").write("%s" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write psi_tint.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.hue = ConfigSlider(default=128, limits=(0, 255))
            config.pep.hue.addNotifier(setHue)
        else:
            config.pep.hue = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/video/plane/psi_brightness"):

            def setBrightness(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting brightness to: %s" %
                          myval)
                    open("/proc/stb/video/plane/psi_brightness",
                         "w").write("%s" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write psi_brightness.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.brightness = ConfigSlider(default=128, limits=(0, 255))
            config.pep.brightness.addNotifier(setBrightness)
        else:
            config.pep.brightness = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"):

            def setBlock_noise_reduction(config):
                myval = int(config.value)
                try:
                    print(
                        "[VideoEnhancement] setting block_noise_reduction to: %0.8X"
                        % myval)
                    open("/proc/stb/vmpeg/0/pep_block_noise_reduction",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print(
                        "[VideoEnhancement] couldn't write pep_block_noise_reduction."
                    )

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.block_noise_reduction = ConfigSlider(default=0,
                                                            limits=(0, 5))
            config.pep.block_noise_reduction.addNotifier(
                setBlock_noise_reduction)
        else:
            config.pep.block_noise_reduction = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"):

            def setMosquito_noise_reduction(config):
                myval = int(config.value)
                try:
                    print(
                        "[VideoEnhancement] setting mosquito_noise_reduction to: %0.8X"
                        % myval)
                    open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print(
                        "[VideoEnhancement] couldn't write pep_mosquito_noise_reduction."
                    )

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.mosquito_noise_reduction = ConfigSlider(default=0,
                                                               limits=(0, 5))
            config.pep.mosquito_noise_reduction.addNotifier(
                setMosquito_noise_reduction)
        else:
            config.pep.mosquito_noise_reduction = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"):

            def setDigital_contour_removal(config):
                myval = int(config.value)
                try:
                    print(
                        "[VideoEnhancement] setting digital_contour_removal to: %0.8X"
                        % myval)
                    open("/proc/stb/vmpeg/0/pep_digital_contour_removal",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print(
                        "[VideoEnhancement] couldn't write pep_digital_contour_removal."
                    )

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.digital_contour_removal = ConfigSlider(default=0,
                                                              limits=(0, 5))
            config.pep.digital_contour_removal.addNotifier(
                setDigital_contour_removal)
        else:
            config.pep.digital_contour_removal = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_split"):

            def setSplitMode(config):
                try:
                    print("[VideoEnhancement] setting splitmode to:",
                          str(config.value))
                    open("/proc/stb/vmpeg/0/pep_split",
                         "w").write(str(config.value))
                except IOError:
                    print("[VideoEnhancement] couldn't write pep_split.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.split = ConfigSelection(choices={
                "off": _("Off"),
                "left": _("Left"),
                "right": _("Right")
            },
                                               default="off")
            config.pep.split.addNotifier(setSplitMode)
        else:
            config.pep.split = NoSave(ConfigNothing())

        if SystemInfo["ScalerSharpness"]:

            def setSharpness(config):
                myval = int(config.value * 256)
                try:
                    print("[VideoEnhancement] setting sharpness to: %0.8X" %
                          myval)
                    open("/proc/stb/vmpeg/0/pep_sharpness",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write pep_sharpness.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.sharpness = ConfigSlider(default=0, limits=(0, 255))
            config.pep.sharpness.addNotifier(setSharpness)
        else:
            config.pep.sharpness = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"):

            def setAutoflesh(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting auto_flesh to: %0.8X" %
                          myval)
                    open("/proc/stb/vmpeg/0/pep_auto_flesh",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write pep_auto_flesh.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.auto_flesh = ConfigSlider(default=0, limits=(0, 4))
            config.pep.auto_flesh.addNotifier(setAutoflesh)
        else:
            config.pep.auto_flesh = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_green_boost"):

            def setGreenboost(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting green_boost to: %0.8X" %
                          myval)
                    open("/proc/stb/vmpeg/0/pep_green_boost",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write pep_green_boost.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.green_boost = ConfigSlider(default=0, limits=(0, 4))
            config.pep.green_boost.addNotifier(setGreenboost)
        else:
            config.pep.green_boost = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_blue_boost"):

            def setBlueboost(config):
                myval = int(config.value)
                try:
                    print("[VideoEnhancement] setting blue_boost to: %0.8X" %
                          myval)
                    open("/proc/stb/vmpeg/0/pep_blue_boost",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write pep_blue_boost.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.blue_boost = ConfigSlider(default=0, limits=(0, 4))
            config.pep.blue_boost.addNotifier(setBlueboost)
        else:
            config.pep.blue_boost = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"):

            def setDynamic_contrast(config):
                myval = int(config.value)
                try:
                    print(
                        "[VideoEnhancement] setting dynamic_contrast to: %0.8X"
                        % myval)
                    open("/proc/stb/vmpeg/0/pep_dynamic_contrast",
                         "w").write("%0.8X" % myval)
                except IOError:
                    print(
                        "[VideoEnhancement] couldn't write pep_dynamic_contrast."
                    )

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.dynamic_contrast = ConfigSlider(default=0,
                                                       limits=(0, 255))
            config.pep.dynamic_contrast.addNotifier(setDynamic_contrast)
        else:
            config.pep.dynamic_contrast = NoSave(ConfigNothing())

        try:
            x = config.av.scaler_sharpness.value
        except KeyError:
            if SystemInfo["ScalerSharpness"]:

                def setScaler_sharpness(config):
                    myval = int(config.value)
                    try:
                        print(
                            "[VideoEnhancement] setting scaler_sharpness to: %0.8X"
                            % myval)
                        open("/proc/stb/vmpeg/0/pep_scaler_sharpness",
                             "w").write("%0.8X" % myval)
                    except IOError:
                        print(
                            "[VideoEnhancement] couldn't write pep_scaler_sharpness."
                        )

                    if not VideoEnhancement.firstRun:
                        self.setConfiguredValues()

                config.av.scaler_sharpness = ConfigSlider(default=13,
                                                          limits=(0, 26))
                config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
            else:
                config.av.scaler_sharpness = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"):

            def setScaler_vertical_dejagging(configElement):
                myval = configElement.value and "enable" or "disable"
                try:
                    print(
                        "[VideoEnhancement] setting scaler_vertical_dejagging to: %s"
                        % myval)
                    open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging",
                         "w").write(myval)
                except IOError:
                    print(
                        "[VideoEnhancement] couldn't write pep_scaler_vertical_dejagging."
                    )

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.scaler_vertical_dejagging = ConfigBoolean(
                default=False,
                descriptions={
                    False: _("Disabled"),
                    True: _("Enabled")
                })
            config.pep.scaler_vertical_dejagging.addNotifier(
                setScaler_vertical_dejagging)
        else:
            config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing())

        if os.path.exists("/proc/stb/vmpeg/0/smooth"):

            def setSmooth(configElement):
                myval = configElement.value and "enable" or "disable"
                try:
                    print("[VideoEnhancement] setting smooth to: %s" % myval)
                    open("/proc/stb/vmpeg/0/smooth", "w").write(myval)
                except IOError:
                    print("[VideoEnhancement] couldn't write smooth.")

                if not VideoEnhancement.firstRun:
                    self.setConfiguredValues()

            config.pep.smooth = ConfigBoolean(default=False,
                                              descriptions={
                                                  False: _("Disabled"),
                                                  True: _("Enabled")
                                              })
            config.pep.smooth.addNotifier(setSmooth)
        else:
            config.pep.smooth = NoSave(ConfigNothing())

        if VideoEnhancement.firstRun:
            self.setConfiguredValues()

        VideoEnhancement.firstRun = False
Esempio n. 5
0
from __future__ import absolute_import
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from Components.config import getConfigListEntry, config, ConfigBoolean

config.misc.firstrun = ConfigBoolean(default=True)


def NetworkWizardMain(session, **kwargs):
    session.open(NetworkWizard)


def startSetup(menuid):
    if menuid != "system":
        return []

    return [(_("Network wizard"), NetworkWizardMain, "nw_wizard", 40)]


def NetworkWizard(*args, **kwargs):
    from .NetworkWizard import NetworkWizard
    return NetworkWizard(*args, **kwargs)


def Plugins(**kwargs):
    list = []
    if config.misc.firstrun.value:
        list.append(
            PluginDescriptor(name=_("Network wizard"),
                             where=PluginDescriptor.WHERE_WIZARD,
                             needsRestart=False,
Esempio n. 6
0
from Screens.Wizard import WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Rc import Rc
from VideoHardware import video_hw

from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap
from Components.config import config, ConfigBoolean, configfile

from Tools.Directories import resolveFilename, SCOPE_PLUGINS
from Tools.HardwareInfo import HardwareInfo

config.misc.showtestcard = ConfigBoolean(default=False)


class VideoWizardSummary(WizardSummary):
    skin = (
        """<screen name="VideoWizardSummary" position="0,0" size="132,64" id="1">
		<widget name="text" position="6,4" size="120,40" font="Regular;12" transparent="1" />
		<widget source="parent.list" render="Label" position="6,40" size="120,21" font="Regular;14">
			<convert type="StringListSelection" />
		</widget>
		<!--widget name="pic" pixmap="%s" position="6,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
	</screen>""",
        """<screen name="VideoWizardSummary" position="0,0" size="96,64" id="2">
		<widget name="text" position="0,4" size="96,40" font="Regular;12" transparent="1" />
		<widget source="parent.list" render="Label" position="0,40" size="96,21" font="Regular;14">
			<convert type="StringListSelection" />
		</widget>
		<!--widget name="pic" pixmap="%s" position="0,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/-->
	</screen>""")
Esempio n. 7
0
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from Components.SystemInfo import SystemInfo
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing
from Components.Label import Label
from Components.Sources.StaticText import StaticText

from VideoHardware import video_hw

config.misc.videowizardenabled = ConfigBoolean(default=True)


class VideoSetup(Screen, ConfigListScreen):
    def __init__(self, session, hw):
        Screen.__init__(self, session)
        # for the skin: first try VideoSetup, then Setup, this allows individual skinning
        self.skinName = ["VideoSetup", "Setup"]
        self.setup_title = _("A/V settings")
        self.setTitle(self.setup_title)
        self.hw = hw
        self.onChangedEntry = []

        # handle hotplug by re-creating setup
        self.onShow.append(self.startHotplug)
        self.onHide.append(self.stopHotplug)

        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
Esempio n. 8
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Components.config import config, ConfigBoolean
from Screens.ChoiceBox import ChoiceBox
from Plugins.Plugin import PluginDescriptor
from enigma import getBoxType
from Plugins.SystemPlugins.FSBLUpdater.FSBLUpdater import FSBLUpdater
from Tools.Log import Log
from Tools import Notifications

model = getBoxType()

config.misc.fsbl_update_never = ConfigBoolean(default=False)


class FSBLUpdateHandler(object):
	def __init__(self):
		self._session = None

	def check(self, session):
		if config.misc.fsbl_update_never.value:
			return
		self._session = session
		if FSBLUpdater.isUpdateRequired(model):
			Log.w("FSBL Update required!")
			choices = [
				(_("Yes"), "yes"),
				(_("No"), "no"),
				(_("Don't ask again!"), "never")
			]
			txt = _("DO NOT POWER OFF YOUR DEVICE WHILE UPDATING!\nUpdate now?")
from Screens.WizardLanguage import WizardLanguage
try:
    from Plugins.SystemPlugins.OSDPositionSetup.overscanwizard import OverscanWizard
except:
    OverscanWizard = None
from Components.Pixmap import Pixmap
from Components.ProgressBar import ProgressBar
from Components.Sources.StaticText import StaticText
from Components.Label import Label
from Components.ScrollLabel import ScrollLabel
from Components.config import config, ConfigBoolean, configfile
from Screens.LocaleSelection import LocaleWizard
from enigma import eConsoleAppContainer, eTimer, eActionMap
import os

config.misc.firstrun = ConfigBoolean(default=True)
config.misc.do_overscanwizard = ConfigBoolean(default=OverscanWizard)


class StartWizard(WizardLanguage, ShowRemoteControl):
    def __init__(self, session, silent=True, showSteps=False, neededTag=None):
        self.xmlfile = ["startwizard.xml"]
        WizardLanguage.__init__(self, session, showSteps=False)
        ShowRemoteControl.__init__(self)
        self["wizard"] = Pixmap()
        self["lab1"] = StaticText(_("OpenVision"))
        self["lab2"] = StaticText(_("Lets define enigma2 once more"))
        self["lab3"] = StaticText(_("Report problems to:"))
        self["lab4"] = StaticText(_("https://openvision.tech"))
        self["lab5"] = StaticText(_("Sources are available at:"))
        self["lab6"] = StaticText(_("https://github.com/OpenVisionE2"))
Esempio n. 10
0
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText
from Components.config import config, ConfigSubsection, ConfigBoolean, getConfigListEntry, ConfigSelection, ConfigYesNo, ConfigIP
from Components.Network import iNetwork
from Components.Ipkg import IpkgComponent
from enigma import eDVBDB

config.misc.installwizard = ConfigSubsection()
config.misc.installwizard.hasnetwork = ConfigBoolean(default=False)
config.misc.installwizard.ipkgloaded = ConfigBoolean(default=False)
config.misc.installwizard.channellistdownloaded = ConfigBoolean(default=False)


class InstallWizard(Screen, ConfigListScreen):

    STATE_UPDATE = 0
    STATE_CHOISE_CHANNELLIST = 1

    # 	STATE_CHOISE_SOFTCAM = 2

    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        self.index = args
        self.list = []
        ConfigListScreen.__init__(self, self.list)

        if self.index == self.STATE_UPDATE:
            config.misc.installwizard.hasnetwork.value = False
            config.misc.installwizard.ipkgloaded.value = False