Beispiel #1
0
	def __init__(self, session, args = 0):

		Screen.__init__(self, session)

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		NUM_CI=eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					if  state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Beispiel #2
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions", "ColorActions"],
			{
				"blue": self.CIAssignment,
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]
		self["key_blue"] = Label(_("CI assignment"))
		self["key_blue"].hide()
		self["pixmap_blue"] = Pixmap()
		self["pixmap_blue"].hide()

		for slot in range(SystemInfo["CommonInterface"]):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
		self.onLayoutFinish.append(self.layoutFinished)
Beispiel #3
0
	def __init__(self, session):
		self.skin = Volume_adjust.skin
		Screen.__init__(self, session)
		# Path of the config file
		self.filename="/etc/volume.xml"
		global offset
		offset = 0
		self["key_red"] = StaticText(_("delete"))
		self["key_green"] = StaticText(_("add Service"))
		self["key_yellow"] = StaticText(_("change"))
		self["key_blue"] = StaticText(_("add Current"))
		self["press_menu"] = StaticText(_("press the menu button to set a general AC3/Dolby offset"))
		self["ServiceList.desc"] = Label(_("Channel \t\t\tVolume +"))

		self["actions"] = ActionMap(["ColorActions","OkCancelActions","MenuActions"],
			{
				"green": self.greenPressed,
				"red": self.redPressed,
				"yellow": self.yellowPressed,
				"blue": self.bluePressed,
				"menu": self.config_menu,
				"ok": self.okPressed,
				"cancel": self.cancel
			}, -1)

		self.servicelist = []
		self.read_volume=[]
		serviceList = ConfigList(self.servicelist)
		serviceList.list = self.servicelist
		serviceList.l.setList(self.servicelist)
		self["ServiceList"] = serviceList

		self.loadXML() # load the config file
		self.onShown.append(self.setWindowTitle)
Beispiel #4
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]

		for slot in range(MAX_NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
Beispiel #5
0
    def __init__(self, session, ci_slot="9"):

        Screen.__init__(self, session)
        self.ci_slot = ci_slot
        self.filename = "/etc/enigma2/ci" + str(self.ci_slot) + ".xml"

        self["key_red"] = StaticText(_("Delete"))
        self["key_green"] = StaticText(_("add Service"))
        self["key_yellow"] = StaticText(_("add Provider"))
        self["key_blue"] = StaticText(_("select CAId"))
        self["CAidList_desc"] = StaticText(_("assigned CAIds:"))
        self["CAidList"] = StaticText()
        self["ServiceList_desc"] = StaticText(_("assigned Services/Provider:"))
        self["ServiceList_info"] = StaticText()

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions"],
            {
                "green": self.greenPressed,
                "red": self.redPressed,
                "yellow": self.yellowPressed,
                "blue": self.bluePressed,
                "cancel": self.cancel,
            },
            -1,
        )

        print "[CI_Wizzard_Config] Configuring CI Slots : %d  " % self.ci_slot

        i = 0
        self.caidlist = []
        print eDVBCIInterfaces.getInstance().readCICaIds(self.ci_slot)
        for caid in eDVBCIInterfaces.getInstance().readCICaIds(self.ci_slot):
            i += 1
            self.caidlist.append((str(hex(int(caid))), str(caid), i))

        print "[CI_Wizzard_Config_CI%d] read following CAIds from CI: %s" % (self.ci_slot, self.caidlist)

        self.selectedcaid = []
        self.servicelist = []
        self.caids = ""

        serviceList = ConfigList(self.servicelist)
        serviceList.list = self.servicelist
        serviceList.l.setList(self.servicelist)
        self["ServiceList"] = serviceList

        self.loadXML()
        # if config mode !=advanced autoselect any caid
        if config.usage.setup_level.index <= 1:  # advanced
            self.selectedcaid = self.caidlist
            self.finishedCAidSelection(self.selectedcaid)
        self.onShown.append(self.setWindowTitle)
Beispiel #6
0
	def __init__(self, session, args = 0):
		self.skin = CIselectMainMenu.skin
		Screen.__init__(self, session)
		#--->
		#---<
		#+++>
		appname = ""
		#+++<	
		
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Config"))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.redPressed,
				"yellow": self.yellowPressed,
				"ok": self.greenPressed,
				"cancel": self.cancel
			}, -1)

		NUM_CI=eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				#--->
				#-if state == 0:
				#---<
				#+++>
				if state == 0 or state == -1:
				#+++<	
					appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
				elif state == 1:	
					appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
				elif state == 2:
					appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
				self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Beispiel #7
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "CiSelectionActions"],
            {
                "left": self.keyLeft,
                "right": self.keyRight,
                "cancel": self.cancel,
                "green": self.reset_both,
                "yellow": self.reset_sc,
                "red": self.cancel,
                "blue": self.download,
            },
            -1,
        )

        self.list = []

        self.softcam = CamConfig("emu")
        self.cardserver = SrvConfig("crdsrv")

        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self["entries"] = menuList
        self["info"] = Label("")
        self["ecmtext"] = Label("")
        self.ecm()
        self.service()
        self.onShown.append(self.openTest)
        self.mytimer = eTimer()
        self.mytimer.callback.append(self.ecm)
        self.mytimer.start(1000)

        softcams = [_("None")] + self.softcam.getList()
        cardservers = [_("None")] + self.cardserver.getList()

        self.softcams = ConfigSelection(choices=softcams)
        self.softcams.value = self.softcam.current() or _("None")
        self.cardservers = ConfigSelection(choices=cardservers)
        self.cardservers.value = self.cardserver.current() or _("None")

        self.list.append(getConfigListEntry(_("Select Cam:"), self.softcams))
        self.list.append(getConfigListEntry(_("Select Cardserver:"), self.cardservers))

        self["key_red"] = Label(_("Cancel"))
        self["key_yellow"] = Label(_("Start"))
        self["key_green"] = Label(_("Restart"))
        self["key_blue"] = Label(_("Download"))
Beispiel #8
0
	def __init__(self, session, args = 0):

		Screen.__init__(self, session)

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Edit"))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.close,
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		if getBoxType() in ('zgemmah9combo'):
			NUM_CI = 1
		else:
			NUM_CI = eDVBCIInterfaces.getInstance() and eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if  NUM_CI and NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					appname = _("Slot %d") %(slot+1) + " - " + _("unknown error")
					if state == 0:
						appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
					elif state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")

					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )
		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Beispiel #9
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyRight,
				"cancel": self.cancel,
				"ok": self.ok,
				"green": self.save,
				"red": self.cancel,
				"blue": self.blue,
			},-1)

		self.list = [ ]

		self.softcam = CamControl('softcam')
		self.cardserver = CamControl('cardserver')

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList

		softcams = self.softcam.getList()
		cardservers = self.cardserver.getList()

		self.softcams = ConfigSelection(choices = softcams)
		self.softcams.value = self.softcam.current()

		self.list.append(getConfigListEntry(_("Select Softcam"), self.softcams))
		if cardservers:
			self.cardservers = ConfigSelection(choices = cardservers)
			self.cardservers.value = self.cardserver.current()
			self.list.append(getConfigListEntry(_("Select Card Server"), self.cardservers))

		self.list.append(getConfigListEntry(_("Restart softcam"), ConfigAction(self.restart, "s")))
		if cardservers:
			self.list.append(getConfigListEntry(_("Restart cardserver"), ConfigAction(self.restart, "c")))
			self.list.append(getConfigListEntry(_("Restart both"), ConfigAction(self.restart, "sc")))

		self["key_red"] = Label(_("Cancel"))
		self["key_green"] = Label(_("OK"))
		self["key_blue"] = Label(_("ECM Info's"))
    def setupSkin(self):
        self.skin = None
        InitSkin(self)

        self['config'] = ConfigList([])
        self['config'].show()

        self['config_information'].show()
        self['config_information_text'].show()

        self['title'].setText("Senderzuordnung - Einstellungen für '%s':" %
                              self.webSender)

        if not config.plugins.serienRec.showAllButtons.value:
            self['text_0'].setText("Abbrechen")
            self['text_1'].setText("About")

            self['bt_red'].show()
            self['bt_green'].show()
            self['bt_blue'].show()
            self['bt_ok'].show()
            self['bt_exit'].show()
            self['bt_text'].show()
            self['text_red'].show()
            self['text_green'].show()
            self['text_blue'].show()
            self['text_ok'].show()
            self['text_0'].show()
            self['text_1'].show()
            self['text_2'].show()
            self['text_3'].show()
            self['text_4'].show()
        else:
            self['text_0'].hide()
            self['text_1'].hide()
            self['text_2'].hide()
            self['text_3'].hide()
            self['text_4'].hide()
            self['text_5'].hide()
            self['text_6'].hide()
            self['text_7'].hide()
            self['text_8'].hide()
            self['text_9'].hide()

            self['bt_0'].hide()
            self['bt_1'].hide()
            self['bt_2'].hide()
            self['bt_3'].hide()
            self['bt_4'].hide()
            self['bt_5'].hide()
            self['bt_6'].hide()
            self['bt_7'].hide()
            self['bt_8'].hide()
            self['bt_9'].hide()
Beispiel #11
0
    def __init__(self,
                 session,
                 slotid,
                 action,
                 handler=eDVBCI_UI.getInstance(),
                 wait_text=_("wait for ci...")):
        Screen.__init__(self, session)

        print "MMIDialog with action" + str(action)

        self.mmiclosed = False
        self.tag = None
        self.slotid = slotid

        self.timer = eTimer()
        self.timer.callback.append(self.keyCancel)

        #else the skins fails
        self["title"] = Label("")
        self["subtitle"] = Label("")
        self["bottom"] = Label("")
        self["entries"] = ConfigList([])

        self["actions"] = NumberActionMap(
            ["SetupActions"],
            {
                "ok": self.okbuttonClick,
                "cancel": self.keyCancel,
                #for PIN
                "left": self.keyLeft,
                "right": self.keyRight,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            },
            -1)

        self.action = action

        self.handler = handler
        self.wait_text = wait_text

        if action == 2:  #start MMI
            handler.startMMI(self.slotid)
            self.showWait()
        elif action == 3:  #mmi already there (called from infobar)
            self.showScreen()
Beispiel #12
0
	def __init__(self, session, menu_path=""):
		Screen.__init__(self, session)
		screentitle = _("Common interface")
		if config.usage.show_menupath.value == 'large':
			menu_path += screentitle
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")

		Screen.setTitle(self, title)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]
		self.slot = 0
		for slot in range(SystemInfo["CommonInterface"]):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.slot += 1
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d") % 1)
		self.onLayoutFinish.append(self.layoutFinished)
Beispiel #13
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Edit"))
		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.close,
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		NUM_CI = SystemInfo["CommonInterface"]

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if  NUM_CI and NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					if state == 0:
						appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
					elif state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
				else:
					self.list.append( (_("Slot %d") %(slot+1) + " - " + _("no module found") , ConfigNothing(), 1, -1) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Beispiel #14
0
	def __init__(self, session, menu_path=""):
		Screen.__init__(self, session)
		screentitle = _("Common interface")
		if config.usage.show_menupath.value == 'large':
			menu_path += screentitle
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)

		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]

		for slot in range(MAX_NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
		self.onLayoutFinish.append(self.layoutFinished)
Beispiel #15
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_('Common Interface'))
        self['actions'] = ActionMap(['OkCancelActions', 'CiSelectionActions'], {'left': self.keyLeft,
         'right': self.keyLeft,
         'ok': self.okbuttonClick,
         'cancel': self.cancel}, -1)
        self.dlg = None
        self.state = {}
        self.list = []
        for slot in range(MAX_NUM_CI):
            state = eDVBCI_UI.getInstance().getState(slot)
            if state != -1:
                self.appendEntries(slot, state)
                CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self['entries'] = menuList
        self['entries'].onSelectionChanged.append(self.selectionChanged)
        self['text'] = Label(_('Slot %d') % 1)
Beispiel #16
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.setTitle(_('Common Interface'))
     self['actions'] = ActionMap(
         ['OkCancelActions', 'CiSelectionActions'], {
             'left': self.keyLeft,
             'right': self.keyLeft,
             'ok': self.okbuttonClick,
             'cancel': self.cancel
         }, -1)
     self.dlg = None
     self.state = {}
     self.slots = []
     self.HighBitrateEntry = {}
     self.RelevantPidsRoutingEntry = {}
     self.entryData = []
     self.list = []
     self['entries'] = ConfigList(self.list)
     self['entries'].list = self.list
     self['entries'].l.setList(self.list)
     self['text'] = Label(_('Slot %d') % 1)
     self.onLayoutFinish.append(self.initialUpdate)
Beispiel #17
0
    def __init__(self, session, args = 0):
        Screen.__init__(self, session)
        self['key_red'] = StaticText(_('Close'))
        self['key_green'] = StaticText(_('Edit'))
        self['actions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.greenPressed,
         'red': self.close,
         'ok': self.greenPressed,
         'cancel': self.close}, -1)
        NUM_CI = eDVBCIInterfaces.getInstance().getNumOfSlots()
        print '[CI_Wizzard] FOUND %d CI Slots ' % NUM_CI
        self.dlg = None
        self.state = {}
        self.list = []
        if NUM_CI > 0:
            for slot in range(NUM_CI):
                state = eDVBCI_UI.getInstance().getState(slot)
                if state == 0:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + _('no module found')
                elif state == 1:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + _('init modules')
                elif state == 2:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + eDVBCI_UI.getInstance().getAppName(slot)
                else:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + 'Unknown state %d' % state
                self.list.append((appname,
                 ConfigNothing(),
                 0,
                 slot))

        else:
            self.list.append((_('no CI slots found'),
             ConfigNothing(),
             1,
             -1))
        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self['CiList'] = menuList
        self.onShown.append(self.setWindowTitle)
Beispiel #18
0
    def __init__(self, session, ci_slot = '9'):
        Screen.__init__(self, session)
        self.ci_slot = ci_slot
        self.filename = eEnv.resolve('${sysconfdir}/enigma2/ci') + str(self.ci_slot) + '.xml'
        self['key_red'] = StaticText(_('Delete'))
        self['key_green'] = StaticText(_('Add service'))
        self['key_yellow'] = StaticText(_('Add provider'))
        self['key_blue'] = StaticText(_('Select CAId'))
        self['CAidList_desc'] = StaticText(_('Assigned CAIds:'))
        self['CAidList'] = StaticText()
        self['ServiceList_desc'] = StaticText(_('Assigned services/provider:'))
        self['ServiceList_info'] = StaticText()
        self['actions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.greenPressed,
         'red': self.redPressed,
         'yellow': self.yellowPressed,
         'blue': self.bluePressed,
         'cancel': self.cancel}, -1)
        print '[CI_Wizzard_Config] Configuring CI Slots : %d  ' % self.ci_slot
        i = 0
        self.caidlist = []
        print eDVBCIInterfaces.getInstance().readCICaIds(self.ci_slot)
        for caid in eDVBCIInterfaces.getInstance().readCICaIds(self.ci_slot):
            i += 1
            self.caidlist.append((str(hex(int(caid))), str(caid), i))

        print '[CI_Wizzard_Config_CI%d] read following CAIds from CI: %s' % (self.ci_slot, self.caidlist)
        self.selectedcaid = []
        self.servicelist = []
        self.caids = ''
        serviceList = ConfigList(self.servicelist)
        serviceList.list = self.servicelist
        serviceList.l.setList(self.servicelist)
        self['ServiceList'] = serviceList
        self.loadXML()
        if config.usage.setup_level.index <= 1:
            self.selectedcaid = self.caidlist
            self.finishedCAidSelection(self.selectedcaid)
        self.onShown.append(self.setWindowTitle)
Beispiel #19
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self['config'] = ConfigList([
         configEntry(
             'HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/SDTV/FLASHES/GREEN'
         ),
         configEntry(
             'HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/HDTV/FLASHES/GREEN'
         )
     ])
     self['actions'] = ActionMap(['OkCancelActions'], {
         'ok': self['config'].toggle,
         'cancel': self.close
     })
Beispiel #20
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["config"] = ConfigList(
			[
				configEntry("HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/SDTV/FLASHES/GREEN"),
				configEntry("HKEY_LOCAL_ENIGMA/IMPORTANT/USER_ANNOYING_STUFF/HDTV/FLASHES/GREEN"),
			])

		self["actions"] = ActionMap(["OkCancelActions"],
									{
			"ok": self["config"].toggle,
			"cancel": self.close
		})
Beispiel #21
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Common Interface"))
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.slots = []
		self.HighBitrateEntry = {}
		self.RelevantPidsRoutingEntry = {}
		self.entryData = []

		self.list = [ ]
		self["entries"] = ConfigList(self.list)
		self["entries"].list = self.list
		self["entries"].l.setList(self.list)
		self["text"] = Label(_("Slot %d")%(1))
		self.onLayoutFinish.append(self.initialUpdate)
Beispiel #22
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Common Interface"))
        self["actions"] = ActionMap(
            ["OkCancelActions", "CiSelectionActions"], {
                "left": self.keyLeft,
                "right": self.keyLeft,
                "ok": self.okbuttonClick,
                "cancel": self.cancel
            }, -1)

        self.dlg = None
        self.state = {}
        self.slots = []
        self.HighBitrateEntry = {}
        self.RelevantPidsRoutingEntry = {}
        self.entryData = []

        self.list = []
        self["entries"] = ConfigList(self.list)
        self["entries"].list = self.list
        self["entries"].l.setList(self.list)
        self["text"] = Label(_("Slot %d") % (1))
        self.onLayoutFinish.append(self.initialUpdate)
Beispiel #23
0
 def __init__(self,
              session,
              slotid,
              action,
              handler=eDVBCI_UI.getInstance(),
              wait_text='wait for ci...',
              screen_data=None):
     Screen.__init__(self, session)
     print 'MMIDialog with action' + str(action)
     self.mmiclosed = False
     self.tag = None
     self.slotid = slotid
     self.timer = eTimer()
     self.timer.callback.append(self.keyCancel)
     self['title'] = Label('')
     self['subtitle'] = Label('')
     self['bottom'] = Label('')
     self['entries'] = ConfigList([])
     self['actions'] = NumberActionMap(
         ['SetupActions'], {
             'ok': self.okbuttonClick,
             'cancel': self.keyCancel,
             'left': self.keyLeft,
             'right': self.keyRight,
             '1': self.keyNumberGlobal,
             '2': self.keyNumberGlobal,
             '3': self.keyNumberGlobal,
             '4': self.keyNumberGlobal,
             '5': self.keyNumberGlobal,
             '6': self.keyNumberGlobal,
             '7': self.keyNumberGlobal,
             '8': self.keyNumberGlobal,
             '9': self.keyNumberGlobal,
             '0': self.keyNumberGlobal
         }, -1)
     self.action = action
     self.handler = handler
     self.wait_text = _(wait_text)
     self.screen_data = screen_data
     self.is_pin_list = -1
     if action == 2:
         handler.startMMI(self.slotid)
         self.showWait()
     elif action == 3:
         self.showScreen()
     return
Beispiel #24
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "EPGSelectActions",
                "CiSelectionActions"
            ], {
                "left": self.keyLeft,
                "right": self.keyRight,
                "cancel": self.cancel,
                "ok": self.ok,
                "green": self.save,
                "red": self.cancel,
                "blue": self.bluekey,
                "menu": self.keyMenu,
            }, -1)

        self.setTitle(_("Softcam Setup"))
        if config.plugins.SoftcamMenu.showEcm.value:
            self["text"] = ScrollLabel()
            self["text1"] = ScrollLabel()
            self.timer = eTimer()
            self.timer.callback.append(self.listServices)
            self.timer.callback.append(self.listServices1)
            self.timer.start(50, True)

        self.softcam = CamControl('softcam')
        self.cardserver = CamControl('cardserver')
        self.blueAction = REFRESH

        self["entries"] = ConfigList([])
        self.initConfig()
        self.createConfig()

        self["key_red"] = Label(_("Cancel"))
        self["key_green"] = Label(_("OK"))
        self["key_blue"] = Label(_("Refresh"))
        self["cam"] = Label()
        self["server"] = Label()

        self.nameSoftcam()
        self.nameCardserver()
        self.onClose.append(self.__onClose)
Beispiel #25
0
	def __init__(self, session, args=0):
		Screen.__init__(self, session)
		self.skin = ChangePasswdScreen.skin
		self.user = "******"
		self.list = []
		self["passwd"] = ConfigList(self.list)
		self["key_red"] = StaticText(_("Delete Password"))
		self["key_green"] = StaticText(_("Set Password"))
		self["key_yellow"] = StaticText(_("new Random"))
		self["key_blue"] = StaticText(_("virt. Keyboard"))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
			{
				"red": self.DelPasswd,
				"green": self.SetPasswd,
				"yellow": self.newRandom,
				"blue": self.bluePressed,
				"cancel": self.close
			}, -1)
		self.buildList(self.GeneratePassword())
Beispiel #26
0
 def createSetup(self):
     print "Creating BackupSetup"
     self.list = []
     self["config"] = ConfigList(self.list)
     self.backup = ConfigSubsection()
     self.backup.type = ConfigSelection(choices=[
         ("settings", _("enigma2 and network")),
         ("var", _("/var directory")),
         ("skin", _("/usr/share/enigma2 directory"))
     ],
                                        default="settings")
     self.backup.location = ConfigSelection(
         choices=[("hdd",
                   _("Harddisk")), ("usb",
                                    _("USB Stick")), ("cf", _("CF Drive"))])
     self.list.append(getConfigListEntry(_("Backup Mode"),
                                         self.backup.type))
     self.list.append(
         getConfigListEntry(_("Backup Location"), self.backup.location))
Beispiel #27
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.list = []
     self['config'] = ConfigList(self.list)
     self['conninfo'] = StaticText('')
     self['conn'] = Label('')
     self['conn'].hide()
     self['info_key'] = Label(_('Use arrows < > to select'))
     self['lab1'] = Label()
     self['lab2'] = Label()
     self['lab3'] = Label()
     self['lab4'] = Label()
     self['info_ecm'] = ScrollLabel('')
     self['key_red'] = Label(_('Settings'))
     self['key_green'] = Label(_('Backup'))
     self['key_yellow'] = Label(_('Timeline'))
     self['key_blue'] = Label(_('Weather Set'))
     self['actions'] = NumberActionMap(
         [
             'ColorActions', 'CiSelectionActions', 'WizardActions',
             'SetupActions'
         ], {
             'left': self.keyLeft,
             'right': self.keyRight,
             'ok': self.ok_pressed,
             'back': self.close,
             'red': self.keyred,
             'green': self.keygreen,
             'yellow': self.keyyellow,
             'blue': self.keyblue
         }, -1)
     self.console = Console()
     self.nemPortNumber = t.readPortNumber()
     self.ecmTimer = eTimer()
     self.ecmTimer.timeout.get().append(self.readEcmInfo)
     self.ecmTimer.start(1000, False)
     self.onLayoutFinish.append(self.checkdeveloperMode)
     self.onShown.append(self.setWindowTitle)
     self.container = eConsoleAppContainer()
     self.container.appClosed.append(self.runFinished)
     self.linkAddons = t.readAddonsUrl()[0]
     thread.start_new_thread(self.readEcmInfo, ())
Beispiel #28
0
    def __init__(self, session, selection):
        self.session = session
        self.selection = selection
        path = '/usr/lib/enigma2/python/Plugins/Extensions/iSkin/Skin/Setup.xml'
        with open(path, 'r') as f:
            self.skin = f.read()
            f.close()
        mdom = xml.etree.cElementTree.parse(path)
        for x in mdom.getroot():
            if x.tag == 'widget' and x.get('name') == 'cover':
                Size = x.get('size').split(',')
                self.SizeY = int(Size[0])
                self.SizeX = int(Size[1])

        Screen.__init__(self, session)
        self['Key_Red'] = Label(_('Exit'))
        self['Key_Green'] = Label(_('Ok'))
        self['title'] = Label(_('Select Skin ') + selection)
        self['cover'] = Pixmap()
        self.isMoving = False
        self.Loop = eTimer()
        self.Loop.stop()
        self.Loop.callback.append(self.Cover)
        self.LoopQuit = eTimer()
        self.LoopQuit.stop()
        self.LoopQuit.callback.append(self.Riavvio)
        self.configlist = []
        self['config'] = ConfigList(self.configlist)
        self.MyConfigList()
        self.SetValue()
        ConfigListScreen.__init__(self, self.configlist, session=self.session)
        self['setupActions'] = ActionMap(['SkinActionSetup'], {'down': self.down,
         'up': self.up,
         'ok': self.keyOK,
         'green': self.keyOK,
         'left': self.KeyLeft,
         'right': self.KeyRight,
         'red': self.close,
         'cancel': self.close}, -1)
Beispiel #29
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.edittext = _('Press OK to edit the settings.')
     self['key_red'] = Label(_('Close'))
     self['key_green'] = Label(_('Activate'))
     self['key_blue'] = Label(_('Delete'))
     self['introduction'] = Label(self.edittext)
     self['actions'] = NumberActionMap(
         [
             'ColorActions', 'CiSelectionActions', 'WizardActions',
             'SetupActions'
         ], {
             'left': self.keyLeft,
             'right': self.keyRight,
             'blue': self.DeleteSwap,
             'green': self.CreateSwap,
             'red': self.close,
             'ok': self.CreateSwap,
             'back': self.close
         }, -1)
     self.currentIndex = 0
     self.swap_size = {
         '8 MB': 8192,
         '16 MB': 16384,
         '32 MB': 32768,
         '64 MB': 65536,
         '128 MB': 131072,
         '256 MB': 262144,
         '512 MB': 524288
     }
     self.list = []
     self.myswap = []
     self.mountpoints = []
     self.swappresent = False
     self['list'] = ConfigList(self.list)
     self.refresh()
     self.onLayoutFinish.append(self.layoutFinished)
     self.onClose.append(self.cleanup)
Beispiel #30
0
    def __init__(self, session, args = 0):
        Screen.__init__(self, session)
        self.title = _('Change Root Password')
        try:
            self['title'] = StaticText(self.title)
        except:
            print 'self["title"] was not found in skin'

        self.user = '******'
        self.output_line = ''
        self.list = []
        self['passwd'] = ConfigList(self.list)
        self['key_red'] = StaticText(_('Close'))
        self['key_green'] = StaticText(_('Set Password'))
        self['key_yellow'] = StaticText(_('new Random'))
        self['key_blue'] = StaticText(_('virt. Keyboard'))
        self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'red': self.close,
         'green': self.SetPasswd,
         'yellow': self.newRandom,
         'blue': self.bluePressed,
         'cancel': self.close}, -1)
        self.buildList(self.GeneratePassword())
        self.onShown.append(self.setWindowTitle)
Beispiel #31
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = NumberActionMap(["SetupActions","OkCancelActions"],
		{
			"ok": self.keyOK,
			"cancel": self.close,
			"left": self.keyLeft,
			"right": self.keyRight,
			"0": self.keyNumber,
			"1": self.keyNumber,
			"2": self.keyNumber,
			"3": self.keyNumber,
			"4": self.keyNumber,
			"5": self.keyNumber,
			"6": self.keyNumber,
			"7": self.keyNumber,
			"8": self.keyNumber,
			"9": self.keyNumber
		}, -1)
		self.list = []
		self["configlist"] = ConfigList(self.list)
		self.list.append(getConfigListEntry(_("Show MC in Main-Menu"), config.plugins.mc_globalsettings.showinmainmenu))
		self.list.append(getConfigListEntry(_("Show MC in Extension-Menu"), config.plugins.mc_globalsettings.showinextmenu))
Beispiel #32
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.session = session
     self.Console = Console()
     self["actions"] = ActionMap(
         ["SetupActions", "OkCancelActions"], {
             "ok": self.keyOK,
             "cancel": self.close,
             "left": self.keyLeft,
             "right": self.keyRight
         }, -1)
     self.list = []
     self["configlist"] = ConfigList(self.list)
     self.list.append(
         getConfigListEntry(
             _("Network Interface"),
             config.plugins.um_globalsettings.networkinterface))
     self.list.append(
         getConfigListEntry(_("Telnet Command"),
                            config.plugins.um_globalsettings.telnetcommand))
     self.list.append(
         getConfigListEntry(
             _("Software Update"),
             config.plugins.um_globalsettings.softwareupdate))
     self.list.append(
         getConfigListEntry(
             _("Software Manager Setup"),
             config.plugins.um_globalsettings.softwaremanagersetup))
     self.list.append(
         getConfigListEntry(_("Skin"),
                            config.plugins.um_globalsettings.Skin))
     self.list.append(
         getConfigListEntry(_("Media Center"),
                            config.plugins.um_globalsettings.Mediacenter))
     self.list.append(
         getConfigListEntry(_("Weather"),
                            config.plugins.um_globalsettings.Weather))
 def __init__(self, session):
     Screen.__init__(self, session)
     self.session = session
     self.Console = Console()
     self.service_name = 'djmount'
     self['actions'] = NumberActionMap(['SetupActions', 'OkCancelActions'], {'ok': self.keyOK,
      'cancel': self.close,
      'left': self.keyLeft,
      'right': self.keyRight,
      '0': self.keyNumber,
      '1': self.keyNumber,
      '2': self.keyNumber,
      '3': self.keyNumber,
      '4': self.keyNumber,
      '5': self.keyNumber,
      '6': self.keyNumber,
      '7': self.keyNumber,
      '8': self.keyNumber,
      '9': self.keyNumber}, -1)
     self.list = []
     self['configlist'] = ConfigList(self.list)
     self.list.append(getConfigListEntry(_('Show MC in Main-Menu'), config.plugins.mc_globalsettings.showinmainmenu))
     self.list.append(getConfigListEntry(_('Show MC in Extension-Menu'), config.plugins.mc_globalsettings.showinextmenu))
     self.list.append(getConfigListEntry(_('UPNP Enabled'), config.plugins.mc_globalsettings.upnp_enable))
Beispiel #34
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = NumberActionMap(
            ["SetupActions", "OkCancelActions"], {
                "save": self.keyGREEN,
                "cancel": self.close,
                "left": self.keyLeft,
                "right": self.keyRight
            }, -1)
        self["key_green"] = Label(_("Save"))

        self.list = []
        self.list.append(
            getConfigListEntry(_("Zeige Emu Menu in Hauptmenu"),
                               config.plugins.TeamCS_globalsettings.showemu))
        self.list.append(
            getConfigListEntry(_("Zeige Addon Manager in Hauptmenu"),
                               config.plugins.TeamCS_globalsettings.showaddon))
        self.list.append(
            getConfigListEntry(
                _("Zeige SystemInfo in Hauptmenu"),
                config.plugins.TeamCS_globalsettings.showsysinfo))
        self["configlist"] = ConfigList(self.list)
Beispiel #35
0
 def __init__(self, session):
     path = "/usr/lib/enigma2/python/Plugins/Extensions/iSkin/Skin/Connection.xml"
     with open(path, "r") as f:
         self.skin = f.read()
         f.close()
     Screen.__init__(self, session)
     self.ConfigConnection = []
     self["config"] = ConfigList(self.ConfigConnection)
     self["Key_Red"] = Label(_("Exit"))
     self["Key_Green"] = Label("Save")
     ConfigListScreen.__init__(self,
                               self.ConfigConnection,
                               session=self.session)
     self["myActionMap"] = ActionMap(
         ["SetupActions", "ColorActions", "DirectionActions"], {
             "left": self.left,
             "right": self.right,
             "ok": self.OkKeyBoard,
             "green": self.KeySave,
             "cancel": self.KeyCancel
         }, -1)
     self.Config()
     self.LoadConfig()
     self.onLayoutFinish.append(self.MyConfigList)
Beispiel #36
0
	def __init__(self, session, msg=None):
		Screen.__init__(self, session)
		if msg is not None:
			self.msg = "Error:\n%s" % msg
		else:
			self.msg = ""
		self.oscamconfig = []
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["status"] = StaticText(self.msg)
		self["config"] = ConfigList(self.oscamconfig)
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self.save,
		}, -2)
		ConfigListScreen.__init__(self, self.oscamconfig, session=session)
		self.createSetup()
		config.oscaminfo.userdatafromconf.addNotifier(self.elementChanged, initial_call=False)
		config.oscaminfo.autoupdate.addNotifier(self.elementChanged, initial_call=False)
		self.onLayoutFinish.append(self.layoutFinished)
Beispiel #37
0
    def __init__(self, session, feid):
        self.skin = PositionerSetup.skin
        Screen.__init__(self, session)
        self.feid = feid
        self.oldref = None

        cur = {}
        if not self.openFrontend():
            self.oldref = session.nav.getCurrentlyPlayingServiceReference()
            service = session.nav.getCurrentService()
            feInfo = service and service.frontendInfo()
            if feInfo:
                cur = feInfo.getTransponderData(True)
            del feInfo
            del service
            session.nav.stopService()  # try to disable foreground service
            if not self.openFrontend():
                if session.pipshown:  # try to disable pip
                    service = self.session.pip.pipservice
                    feInfo = service and service.frontendInfo()
                    if feInfo:
                        cur = feInfo.getTransponderData()
                    del feInfo
                    del service
                    session.pipshown = False
                    del session.pip
                    if not self.openFrontend():
                        self.frontend = None  # in normal case this should not happen

        self.frontendStatus = {}
        self.diseqc = Diseqc(self.frontend)
        self.tuner = Tuner(self.frontend)

        tp = (cur.get("frequency", 0) / 1000, cur.get("symbol_rate", 0) / 1000,
              cur.get("polarization",
                      eDVBFrontendParametersSatellite.Polarisation_Horizontal),
              cur.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto),
              cur.get("inversion",
                      eDVBFrontendParametersSatellite.Inversion_Unknown),
              cur.get("orbital_position", 0),
              cur.get("system", eDVBFrontendParametersSatellite.System_DVB_S),
              cur.get("modulation",
                      eDVBFrontendParametersSatellite.Modulation_QPSK),
              cur.get("rolloff",
                      eDVBFrontendParametersSatellite.RollOff_alpha_0_35),
              cur.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown))

        self.tuner.tune(tp)
        self.createConfig()

        self.isMoving = False
        self.stopOnLock = False

        self.red = Label("")
        self["red"] = self.red
        self.green = Label("")
        self["green"] = self.green
        self.yellow = Label("")
        self["yellow"] = self.yellow
        self.blue = Label("")
        self["blue"] = self.blue

        self.list = []
        self["list"] = ConfigList(self.list)
        self.createSetup()

        self["snr_db"] = TunerInfo(TunerInfo.SNR_DB,
                                   statusDict=self.frontendStatus)
        self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE,
                                           statusDict=self.frontendStatus)
        self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE,
                                      statusDict=self.frontendStatus)
        self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR,
                                    statusDict=self.frontendStatus)
        self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR,
                                    statusDict=self.frontendStatus)
        self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE,
                                       statusDict=self.frontendStatus)

        self["frequency_value"] = Label("")
        self["symbolrate_value"] = Label("")
        self["fec_value"] = Label("")

        self["actions"] = ActionMap(
            ["DirectionActions", "OkCancelActions", "ColorActions"], {
                "ok": self.go,
                "cancel": self.keyCancel,
                "up": self.up,
                "down": self.down,
                "left": self.left,
                "right": self.right,
                "red": self.redKey,
                "green": self.greenKey,
                "yellow": self.yellowKey,
                "blue": self.blueKey,
            }, -1)

        self.updateColors("tune")

        self.statusTimer = eTimer()
        self.statusTimer.callback.append(self.updateStatus)
        self.statusTimer.start(50, True)
        self.onClose.append(self.__onClose)
Beispiel #38
0
	def __init__(self, session, currentTitle, currentUrl, menulist = None):
		Screen.__init__(self, session)

		self.currentUrl = currentUrl
		self.currentTitle = currentTitle

		#Menu
		if menulist is None:
			self.menu = MenuList([
						(_("Bookmarks"), self.MENU_BOOKMARKS),
						(_("History"), self.MENU_HISTORY),
						(_("Downloads"), self.MENU_DOWNLOADS),
						(_("Certificates"), self.MENU_CERTS),
						(_("Cookies"), self.MENU_COOKIES),
						(_("Settings"), self.MENU_SETTINGS),
				], enableWrapAround = True)
		else:
			self.menu = MenuList(menulist, enableWrapAround=True)
		self["menu"] = self.menu

		self["statuslabel"] = Label("")
		self["statuslabel"].hide()

		#Color Buttons
		self["button_red"] = Boolean(False)
		self["button_green"] = Boolean(False)
		self["button_yellow"] = Boolean(False)
		self["button_blue"] = Boolean(False)
		self.red = Label("")
		self.green = Label("")
		self.yellow = Label("")
		self.blue = Label("")
		self["red"] = self.red
		self["green"] = self.green
		self["yellow"] = self.yellow
		self["blue"] = self.blue

		#Lists
		self.detailList = List([], enableWrapAround = True)
		self.detailConfigList = ConfigList([])
		self.detailConfigList.l.setSeperation( (BrowserMenu.width - 210) / 2 )
		config.plugins.WebBrowser.storage.enabled.addNotifier(self.__cfgExpandableElementChanged, initial_call = False)
		config.plugins.WebBrowser.storage.enabled.addNotifier(self.__cfgStoragePathChanged, initial_call = False)
		config.plugins.WebBrowser.storage.path.addNotifier(self.__cfgStoragePathChanged, initial_call = False)

		self.detailInput = EnhancedInput()

		self["list"] = self.detailList
		self["config"] = self.detailConfigList
		self["input"] = self.detailInput
		self["line"] = CanvasSource()

		self.__cfgCreateSetup()

		self.__db = BrowserDB.getInstance()
		self.__curMenu = self.MENU_BOOKMARKS
		self.__bmList = None
		self.__hisList = None
		self.__crtList = None
		self.__ckList = None
		self.__bmNeedle = ""
		self.__bmFilterTimer = eTimer()
		self.__bmFilterTimer_conn = self.__bmFilterTimer.timeout.connect(self.__bmFilterCB)
		self.__hisNeedle = ""
		self.__hisFilterTimer = eTimer()
		self.__hisFilterTimer_conn = self.__hisFilterTimer.timeout.connect(self.__hisFilterCB)
		self.__dlRefreshTimer = eTimer()
		self.__dlRefreshTimer_conn = self.__dlRefreshTimer.timeout.connect(self.__dlBuildList)
		self.__statusTimer = eTimer()
		self.__statusTimer_conn = self.__statusTimer.timeout.connect(self.__hideStatus)
		self.__actions = []

		self.onFirstExecBegin.append(self.__drawSeparator)
		self.onFirstExecBegin.append(self.__onMenuChanged)
		self.onExecBegin.append(self.__reloadData)
		self.onShow.append(self.setKeyboardModeAscii)

		self["actions"] = ActionMap(["BrowserActions", "ColorActions"],
		{
			"ok" : self.__actionOk,
			"enter" : self.__actionOk,
			"exit" : self.__actionExit,
			"pageUp" : self.__actionMenuUp,
			"pageDown" : self.__actionMenuDown,
			"up" : boundFunction(self.__action, "up"),
			"down" : boundFunction(self.__action, "down"),
			"left" : boundFunction(self.__action, "left"),
			"right" : boundFunction(self.__action, "right"),
			"red" : boundFunction(self.__action, "red"),
			"green" : boundFunction(self.__action, "green"),
			"yellow" : boundFunction(self.__action, "yellow"),
			"blue" : boundFunction(self.__action, "blue"),
			"backspace" : boundFunction(self.__action, "backspace"),
			"delete" : boundFunction(self.__action, "delete"),
			"ascii": boundFunction(self.__action, "ascii"),
			# TODO "text" : self.__text
		}, -2)

		self["numberactions"] = NumberActionMap(["NumberActions"],
		{
			"1": self.__keyNumberGlobal,
			"2": self.__keyNumberGlobal,
			"3": self.__keyNumberGlobal,
			"4": self.__keyNumberGlobal,
			"5": self.__keyNumberGlobal,
			"6": self.__keyNumberGlobal,
			"7": self.__keyNumberGlobal,
			"8": self.__keyNumberGlobal,
			"9": self.__keyNumberGlobal,
			"0": self.__keyNumberGlobal
		}, -2)

		self.__actionFuncs = {
			self.MENU_BOOKMARKS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.selectPrevious,
				"right" : self.detailList.pageDown,
				"ok" : self.__bmOk,
				"enter" : self.__bmOk,
				"red" : self.__bmDelete,
				"green" : self.__bmAdd,
				"yellow" : self.__bmEdit,
				"blue" : self.__bmSetCurrentAsHome,
				"backspace" : self.__bmKeyBackspace,
				"delete" : self.__bmKeyDelete,
				"ascii": self.__bmKeyAscii,
				},
			self.MENU_HISTORY : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"ok" : self.__hisOk,
				"enter" : self.__hisOk,
				"red" : self.__hisClear,
				"blue" : self.__hisSetCurrentAsHome,
				"backspace" : self.__hisKeyBackspace,
				"delete" : self.__hisKeyDelete,
				"ascii": self.__hisKeyAscii,
				},
			self.MENU_SETTINGS : {
				"up" : self.__cfgKeyUp,
				"down" : self.__cfgKeyDown,
				"left" : self.__cfgKeyLeft,
				"right" : self.__cfgKeyRight,
				"ok" : self.__cfgKeyOK,
				"enter" : self.__cfgKeyOK,
				"red" : self.__cfgCancel,
				"green" : self.__cfgSave,
				"backspace" : self.__cfgKeyBackspace,
				"delete" : self.__cfgKeyDelete,
				"ascii": self.__cfgKeyAscii,
				},
			self.MENU_DOWNLOADS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__dlAbort,
				},
			self.MENU_CERTS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__crtDelete,
				"green" : self.__crtDetails,
				},
			self.MENU_COOKIES : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__ckDelete,
				"blue" : self.__ckDeleteAll,
				}
		}
Beispiel #39
0
class SetupGuide(Screen):
    MENU_CHOICE_LEAVE = "leave"

    skin = """<screen name="SetupGuide" position="0,0" size="1280,720" title="Welcome" flags="wfNoBorder">
		<widget name="banner" position="0,0" size="240,720" pixmap="skin_default/wizard.png" scale="fill" />
		<widget source="green" render="Pixmap" pixmap="skin_default/buttons/green.png" position="475,15" size="200,40" >
			<convert type="ConditionalShowHide"/>
		</widget>
		<widget name="green_text" position="475,15" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2"/>
		<widget source="yellow" render="Pixmap" pixmap="skin_default/buttons/yellow.png" position="685,15" size="200,40" >
			<convert type="ConditionalShowHide"/>
		</widget>
		<widget name="yellow_text" position="685,15" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2"/>
		<widget source="blue" render="Pixmap" pixmap="skin_default/buttons/blue.png" position="895,15" size="200,40" >
			<convert type="ConditionalShowHide"/>
		</widget>
		<widget name="blue_text" position="895,15" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-2,-2"/>
		<widget source="Title" render="Label" position="250,70" size="950,40" font="Regular;36" halign="center" valign="center" />
		<widget name="text" position="250,120" size="950,240" font="Regular;24" halign="center" valign="center" />
		<widget source="list" render="Listbox" position="250,370" size="950,300" zPosition="1" enableWrapAround="1" scrollbarMode="showOnDemand" transparent="1">
			<convert type="TemplatedMultiContent">
				{"templates":
					{	"default" :  (28,[ MultiContentEntryText(pos=(10,4),size=(580,22),flags=RT_HALIGN_LEFT,text=0) ]),
						"iconized" :  (50,[
							MultiContentEntryText(pos=(75,0),size=(310,50),flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER,text=0),# index 0 is the text,
							MultiContentEntryPixmap(pos=(5,5),size=(60,40),png=1),# index 1 is the pixmap
						]),
						"networkservice" : (50,[
							MultiContentEntryPixmapAlphaTest(pos=(0,0),size=(50,50),png=1),#type icon
							MultiContentEntryText(pos=(55,0),size=(400,24),font=0,flags=RT_HALIGN_LEFT,text=3),#service name
							MultiContentEntryText(pos=(780,0),size=(100,24),font=1,flags=RT_HALIGN_RIGHT|RT_VALIGN_BOTTOM,text=7),#security
							MultiContentEntryText(pos=(780,30),size=(100,18),font=1,flags=RT_HALIGN_RIGHT|RT_VALIGN_TOP,text=2),#signal strength
							MultiContentEntryText(pos=(55,30),size=(220,18),font=1,flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER,text=4),#ip
							MultiContentEntryText(pos=(605,30),size=(150,18),font=1,flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER,text=5),#state
							MultiContentEntryText(pos=(5,0),size=(490,50),font=0,flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER,text=6),#technology name
						]),
						"inputdevice":(50, [
							MultiContentEntryText(pos = (5, 0), size = (200, 24), font=0, flags = RT_HALIGN_LEFT, text = 0), #device name
							MultiContentEntryText(pos = (210, 0), size = (310, 50), font=0, flags = RT_HALIGN_CENTER|RT_VALIGN_CENTER, text = 3), #pairing state
							MultiContentEntryText(pos = (670, 0), size = (200, 18), font=1, flags = RT_HALIGN_RIGHT|RT_VALIGN_CENTER, text = 4), #connection state
							MultiContentEntryText(pos = (5, 30), size = (200, 18), font=1, flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 2), #device address
							MultiContentEntryText(pos = (670, 30), size = (200, 18), font=1, flags = RT_HALIGN_RIGHT|RT_VALIGN_TOP, text = 1), #rssi
						]),
					},
					"fonts": [gFont("Regular",20),gFont("Regular",18)],
					"itemHeight": 30
				}
			</convert>
		</widget>
		<widget name="config" position="250,370" size="950,300" zPosition="1" enableWrapAround="1" scrollbarMode="showOnDemand" transparent="1" />
	</screen>
	"""

    def __init__(self, session, steps={}):
        Screen.__init__(self, session, windowTitle=_("Welcome"))
        self["Title"] = StaticText()
        self["banner"] = Pixmap()

        self._text = Label()
        self["text"] = self._text
        #buttons
        self["green"] = Boolean(False)
        self["green_text"] = Label()
        self["green_text"].hide()
        self["yellow"] = Boolean(False)
        self["yellow_text"] = Label()
        self["yellow_text"].hide()
        self["blue"] = Boolean(False)
        self["blue_text"] = Label()
        self["blue_text"].hide()
        #list
        self.listContent = []
        self.list = List(self.listContent)
        self.list.hide()
        self["list"] = self.list
        #config
        self.configContent = []
        self.configList = ConfigList(self.configContent, session=session)
        self.configList.hide()
        self["config"] = self.configList

        self._movingBack = False
        self._currentStep = None

        self._stepper = PrioritizedStepper()
        if not steps:
            initialSetupSteps.prepare()
            for s in initialSetupSteps.steps:
                self.addSteps(s)

        self["actions"] = NumberActionMap(
            ["MenuActions", "SetupActions", "ColorActions"], {
                "ok": self._ok,
                "cancel": self._cancelAndBack,
                "menu": self._menu,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.red,
                "green": self.green,
                "yellow": self.yellow,
                "blue": self.blue,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1)
        self.onFirstExecBegin.append(self._nextStep)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        self._stepper.cleanup()
        self._currentStep = None

    def _menu(self):
        choices = [
            (_("Cancel guided setup"), self.MENU_CHOICE_LEAVE),
        ]
        self.session.openWithCallback(self._onMenuChoice,
                                      ChoiceBox,
                                      title=_("Menu"),
                                      list=choices)

    def _onMenuChoice(self, choice):
        choice = choice and choice[1]
        if not choice:
            return
        if choice == self.MENU_CHOICE_LEAVE:
            self._cancel()

    def createSummary(self):
        return SetupGuideSummary

    def updateSummary(self):
        if not self._currentStep:
            return
        self.summaries.setTitle(self._currentStep.title)
        summaryText = self._currentStep.text
        if isinstance(self._currentStep, SetupListStep):
            current = self.list.current
            if current:
                style = self.list.style
                Log.d("%s - %s" % (current, style))
                if style in ("default", "iconized"):
                    summaryText = current[1]
                elif style == "networkservice":
                    summaryText = current[1].name()
                elif style == "inputdevice":
                    deviceName = current[1].name() or current[1].shortName(
                    ) or _("DM Remote")
                    summaryText = "%s (%s)" % (deviceName,
                                               current[1].address())
            else:
                summaryText = _("n/A")
        elif isinstance(self._currentStep, SetupConfigStep):
            current = self.configList.current
            summaryText = (current and "%s\n%s" %
                           (current[0], _(current[1].getText()))) or _("n/A")
        Log.d("%s" % (summaryText, ))
        self.summaries.setText(summaryText)

    def getText(self):
        return self._text.getText()

    def setText(self, text):
        self._text.setText(text)

    text = property(getText, setText)

    def getTitle(self):
        return Screen.getTitle(self)

    def setTitle(self, title):
        Screen.setTitle(self, title)

    title = property(getTitle, setTitle)

    def checkButtons(self):
        keys = ["red", "green", "yellow", "blue"]
        texts = self._currentStep.buttons()
        for i in range(1, 4):
            buttonText = texts[i]
            key = keys[i]
            key_text = "%s_text" % (key, )
            if buttonText:
                self[key].boolean = True
                self[key_text].text = buttonText
                self[key_text].show()
            else:
                self[key].boolean = False
                self[key_text].text = ""
                self[key_text].show()

    def addSteps(self, steps):
        for prio, step in six.iteritems(steps):
            self._stepper.add(self, prio, step)

    def left(self):
        if isinstance(self._currentStep, SetupConfigStep):
            self.configList.handleKey(KEY_LEFT)
            self._currentStep.left()

    def right(self):
        if isinstance(self._currentStep, SetupConfigStep):
            self.configList.handleKey(KEY_RIGHT)
            self._currentStep.right()

    def keyNumberGlobal(self, number):
        if isinstance(self._currentStep, SetupConfigStep):
            self.configList.handleKey(KEY_0 + number)

    def up(self):
        pass

    def down(self):
        pass

    def red(self):
        pass

    def green(self):
        if self._currentStep:
            self._currentStep.green()

    def yellow(self):
        if self._currentStep:
            self._currentStep.yellow()

    def blue(self):
        if self._currentStep:
            self._currentStep.blue()

    def nextStep(self):
        self._nextStep()

    def _nextStep(self):
        self._movingBack = False
        step = self._stepper.next()
        if step:
            self._runStep(step)
            return
        Log.w("No next step available!")
        self.close()

    def _cancelAndBack(self):
        if self._currentStep:
            self._currentStep.cancel()
        self._previousStep()

    def _previousStep(self):
        self._movingBack = True
        step = self._stepper.previous()
        if step:
            self._runStep(step)
        else:
            Log.w("No previous step available!")
            self._cancel()

    def _cancel(self):
        self.session.openWithCallback(
            self._onCancelAnswered,
            MessageBox,
            _("Do you want to cancel the guided setup?"),
            type=MessageBox.TYPE_YESNO,
            windowTitle=_("Cancel guided setup?"),
        )

    def _onCancelAnswered(self, answer):
        if answer:
            if self._currentStep:
                self._currentStep.cancel()
            self.close()

    def _ok(self):
        if self._currentStep.onOk():
            self._nextStep()

    def onSelectionChanged(self):
        self.updateSummary()

    def _runStep(self, step):
        self._currentStep = step
        self.listContent = []
        self.configList.onSelectionChanged = []
        self.list.onSelectionChanged = []
        if not step.prepare():
            if self._movingBack:
                self._previousStep()
            else:
                self.nextStep()
            return
        if isinstance(step, SetupListStep):
            self.configList.hide()
            self.listContent = step.listContent
            self.list.list = self.listContent
            self.list.style = step.listStyle
            self.list.buildfunc = step.buildfunc
            self.list.onSelectionChanged = [
                step.onSelectionChanged, self.onSelectionChanged
            ]
            self.list.index = step.selectedIndex
            self.list.show()
        elif isinstance(step, SetupConfigStep):
            self.list.hide()
            self.configContent = step.configContent
            self.configList.list = self.configContent
            self.configList.onSelectionChanged = [
                step.onSelectionChanged, self.onSelectionChanged
            ]
            self.configList.show()
        else:
            self.configList.hide()
            self.list.hide()
        self.setTitle(step.title)
        self._text.text = step.text
        self.checkButtons()
        self.updateSummary()
Beispiel #40
0
    def __init__(self, session, steps={}):
        Screen.__init__(self, session, windowTitle=_("Welcome"))
        self["Title"] = StaticText()
        self["banner"] = Pixmap()

        self._text = Label()
        self["text"] = self._text
        #buttons
        self["green"] = Boolean(False)
        self["green_text"] = Label()
        self["green_text"].hide()
        self["yellow"] = Boolean(False)
        self["yellow_text"] = Label()
        self["yellow_text"].hide()
        self["blue"] = Boolean(False)
        self["blue_text"] = Label()
        self["blue_text"].hide()
        #list
        self.listContent = []
        self.list = List(self.listContent)
        self.list.hide()
        self["list"] = self.list
        #config
        self.configContent = []
        self.configList = ConfigList(self.configContent, session=session)
        self.configList.hide()
        self["config"] = self.configList

        self._movingBack = False
        self._currentStep = None

        self._stepper = PrioritizedStepper()
        if not steps:
            initialSetupSteps.prepare()
            for s in initialSetupSteps.steps:
                self.addSteps(s)

        self["actions"] = NumberActionMap(
            ["MenuActions", "SetupActions", "ColorActions"], {
                "ok": self._ok,
                "cancel": self._cancelAndBack,
                "menu": self._menu,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.red,
                "green": self.green,
                "yellow": self.yellow,
                "blue": self.blue,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1)
        self.onFirstExecBegin.append(self._nextStep)
        self.onClose.append(self.__onClose)
	def __init__(self, session, msg=None):
		Screen.__init__(self, session)
		self.session = session
		if BoxInfo.getItem("NCamIsActive"):
			if f == 1.5:
				self.skin = """<screen position="center,center" size="960,540" title="NCam Setup">"""
				self.skin += """<widget name="config" font="Regular;30" itemHeight="50" backgroundColor="black" foregroundColor="white" scrollbarMode="showOnDemand" enableWrapAround="1" position="center,center" size="960,540" transparent="1" />"""
				self.skin += """<widget name="status" render="Label" font="Regular;30" itemHeight="50" scrollbarMode="showOnDemand" enableWrapAround="1" position="50,50" size="960,540" transparent="1" />"""
				self.skin += """<eLabel backgroundColor="white" name="" position="0,450" size="960,2" zPosition="-9" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_red.png" position="60,475" size="40,40" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_green.png" position="255,475" size="40,40" />"""
				self.skin += """<widget source="key_red" render="Label" font="Regular;28" position="120,480" size="270,40" transparent="1" zPosition="1" />"""
				self.skin += """<widget source="key_green" render="Label" font="Regular;28" position="315,480" size="270,40" transparent="1" zPosition="1" />"""
			else:
				self.skin = """<screen position="center,center" size="640,400" title="NCam Setup">"""
				self.skin += """<widget name="config" font="Regular;20" itemHeight="50" foregroundColor="white" scrollbarMode="showOnDemand" enableWrapAround="1" position="center,center" size="640,400" transparent="1" />"""
				self.skin += """<widget name="status" render="Label" font="Regular;20" itemHeight="30" scrollbarMode="showOnDemand" enableWrapAround="1" position="33,33" size="640,360" transparent="1" />"""
				self.skin += """<eLabel backgroundColor="white" name="" position="0,350" size="640,2" zPosition="-9" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_red.png" position="40,365" size="35,35" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_green.png" position="180,365" size="35,35" />"""
				self.skin += """<widget source="key_red" render="Label" font="Regular;18" position="80,367" size="180,35" transparent="1" zPosition="1" />"""
				self.skin += """<widget source="key_green" render="Label" font="Regular;18" position="220,367" size="220,35" transparent="1" zPosition="1" />"""
		else:
			if f == 1.5:
				self.skin = """<screen position="center,center" size="960,540" title="OScam Setup">"""
				self.skin += """<widget name="config" font="Regular;30" itemHeight="50" backgroundColor="black" foregroundColor="white" scrollbarMode="showOnDemand" enableWrapAround="1" position="center,center" size="960,540" transparent="1" />"""
				self.skin += """<widget name="status" render="Label" font="Regular;30" itemHeight="50" scrollbarMode="showOnDemand" enableWrapAround="1" position="50,50" size="960,540" transparent="1" />"""
				self.skin += """<eLabel backgroundColor="white" name="" position="0,450" size="960,2" zPosition="-9" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_red.png" position="60,475" size="40,40" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_green.png" position="255,475" size="40,40" />"""
				self.skin += """<widget source="key_red" render="Label" font="Regular;28" position="120,480" size="270,40" transparent="1" zPosition="1" />"""
				self.skin += """<widget source="key_green" render="Label" font="Regular;28" position="315,480" size="270,40" transparent="1" zPosition="1" />"""
			else:
				self.skin = """<screen position="center,center" size="640,400" title="OScam Setup">"""
				self.skin += """<widget name="config" font="Regular;20" itemHeight="50" foregroundColor="white" scrollbarMode="showOnDemand" enableWrapAround="1" position="center,center" size="640,400" transparent="1" />"""
				self.skin += """<widget name="status" render="Label" font="Regular;20" itemHeight="30" scrollbarMode="showOnDemand" enableWrapAround="1" position="33,33" size="640,360" transparent="1" />"""
				self.skin += """<eLabel backgroundColor="white" name="" position="0,350" size="640,2" zPosition="-9" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_red.png" position="40,365" size="35,35" />"""
				self.skin += """<ePixmap alphatest="blend" pixmap="buttons/key_green.png" position="180,365" size="35,35" />"""
				self.skin += """<widget source="key_red" render="Label" font="Regular;18" position="80,367" size="180,35" transparent="1" zPosition="1" />"""
				self.skin += """<widget source="key_green" render="Label" font="Regular;18" position="220,367" size="220,35" transparent="1" zPosition="1" />"""
		self.skin += """</screen>"""
		if msg is not None:
			self.msg = "Error:\n%s" % msg
		else:
			self.msg = ""
		self.oscamconfig = []
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["status"] = StaticText(self.msg)
		self["config"] = ConfigList(self.oscamconfig)
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self.save,
		}, -2)
		ConfigListScreen.__init__(self, self.oscamconfig, session=self.session)
		self.createSetup()
		config.oscaminfo.userdatafromconf.addNotifier(self.elementChanged, initial_call=False)
		config.oscaminfo.autoupdate.addNotifier(self.elementChanged, initial_call=False)
		self.onLayoutFinish.append(self.layoutFinished)
Beispiel #42
0
 def postWidgetCreate(self, instance):
     if not self.enabled:
         instance.setSelectionEnable(False)
     ConfigList.postWidgetCreate(self, instance)
Beispiel #43
0
 def selectionChanged(self):
     if self.enabled:
         return ConfigList.selectionChanged(self)
Beispiel #44
0
 def __init__(self, list, session, enabled=True):
     ConfigList.__init__(self, list, session)
     self.enabled = enabled
Beispiel #45
0
 def postWidgetCreate(self, instance):
     if not self.enabled:
         instance.setSelectionEnable(False)
     ConfigList.postWidgetCreate(self, instance)
Beispiel #46
0
    def __init__(self,
                 session,
                 showSteps=True,
                 showStepSlider=True,
                 showList=True,
                 showConfig=True):
        Screen.__init__(self, session)

        self.isLastWizard = False  # can be used to skip a "goodbye"-screen in a wizard

        self.stepHistory = []

        self.wizard = {}
        parser = make_parser()
        if not isinstance(self.xmlfile, list):
            self.xmlfile = [self.xmlfile]
        print "Reading ", self.xmlfile
        wizardHandler = self.parseWizard(self.wizard)
        parser.setContentHandler(wizardHandler)
        for xmlfile in self.xmlfile:
            if xmlfile[0] != '/':
                parser.parse(eEnv.resolve('${datadir}/enigma2/') + xmlfile)
            else:
                parser.parse(xmlfile)

        self.showSteps = showSteps
        self.showStepSlider = showStepSlider
        self.showList = showList
        self.showConfig = showConfig

        self.numSteps = len(self.wizard)
        self.currStep = self.getStepWithID("start") + 1

        self.timeoutTimer = eTimer()
        self.timeoutTimer.callback.append(self.timeoutCounterFired)

        self["text"] = Label()

        if showConfig:
            self["config"] = ConfigList([], session=session)

        if self.showSteps:
            self["step"] = Label()

        if self.showStepSlider:
            self["stepslider"] = Slider(1, self.numSteps)

        if self.showList:
            self.list = []
            self["list"] = List(self.list, enableWrapAround=True)
            self["list"].onSelectionChanged.append(self.selChanged)
            #self["list"] = MenuList(self.list, enableWrapAround = True)

        self.onShown.append(self.updateValues)

        self.configInstance = None
        self.currentConfigIndex = None

        Wizard.instance = self

        self.lcdCallbacks = []

        self.disableKeys = False

        self["actions"] = NumberActionMap(
            [
                "WizardActions", "NumberActions", "ColorActions",
                "SetupActions", "InputAsciiActions", "KeyboardInputActions"
            ], {
                "gotAsciiCode": self.keyGotAscii,
                "ok": self.ok,
                "back": self.back,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.red,
                "green": self.green,
                "yellow": self.yellow,
                "blue": self.blue,
                "deleteBackward": self.deleteBackward,
                "deleteForward": self.deleteForward,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1)

        self["VirtualKB"] = NumberActionMap(
            ["VirtualKeyboardActions"], {
                "showVirtualKeyboard": self.KeyText,
            }, -2)

        self["VirtualKB"].setEnabled(False)
Beispiel #47
0
class BrowserMenu(Screen):
	ACTION_BOOKMARK = 0
	ACTION_COOKIES = 1
	ACTION_STORAGE_PATH = 2

	MENU_BOOKMARKS = 0
	MENU_SETTINGS = 1
	MENU_HISTORY = 2
	MENU_DOWNLOADS = 3
	MENU_CERTS = 4
	MENU_COOKIES = 5

	size = getDesktop(0).size()
	width = int(size.width() * 0.9)
	height = int(size.height() * 0.85)
	bof = height - 35 #Button-Offset

	skin = """
		<screen name="BrowserMenu" position="center,center" size="%(w)d,%(h)d" title="Web Browser - Menu" >
			<widget name="menu" position="0,0" zPosition="1" size="200,%(h)d" backgroundColor="#000000" transparent="1" />
			<widget source="line" render="Canvas" position="203,0" zPosition="2" size="4,%(h)d" backgroundColor="#000000" transparent="1" alphatest="on"/>
			<widget source="list" render="Listbox" position="210,0" zPosition="1" size="%(listW)d,%(listH)d" backgroundColor="#000000" transparent="1">
				<convert type="TemplatedMultiContent">
					{"templates":
						{"default": (55, [
							MultiContentEntryText(pos = (10, 1), size = (920, 25), font = 0, flags = RT_VALIGN_CENTER, text = 1),
							MultiContentEntryText(pos = (10, 30), size = (920, 25), font = 1, flags = RT_VALIGN_CENTER, text = 2),
						]),
						"history": (55, [
							MultiContentEntryText(pos = (10, 1), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 1),
							MultiContentEntryText(pos = (10, 28), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 2),
							MultiContentEntryText(pos = (190, 1), size = (690, 25), font = 0, flags = RT_VALIGN_CENTER, text = 3),
							MultiContentEntryText(pos = (190, 28), size = (690, 25), font = 1, flags = RT_VALIGN_CENTER, text = 4),
						]),
						"downloads": (25, [
							MultiContentEntryText(pos = (0, 1), size = (600, 24), font=1, flags = RT_HALIGN_LEFT, text = 1),
							MultiContentEntryText(pos = (610, 1), size = (150, 24), font=1, flags = RT_HALIGN_RIGHT, text = 2),
							MultiContentEntryProgress(pos = (760, 1), size = (100, 24), percent = 3),
							MultiContentEntryText(pos = (870, 1), size = (70, 24), font=1, flags = RT_HALIGN_RIGHT, text = 4),
						]),
						"certificates": (85, [
							MultiContentEntryText(pos = (10, 1), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 1),
							MultiContentEntryText(pos = (10, 28), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 2),
							MultiContentEntryText(pos = (190, 1), size = (690, 25), font = 0, flags = RT_VALIGN_CENTER, text = 3),
							MultiContentEntryText(pos = (190, 28), size = (690, 25), font = 1, flags = RT_VALIGN_CENTER, text = 4),
							MultiContentEntryText(pos = (10, 60), size = (900, 25), font = 0, flags = RT_VALIGN_CENTER, text = 5),
						]),
						"cookies": (75, [
							MultiContentEntryText(pos = (10, 1), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 1),
							MultiContentEntryText(pos = (10, 28), size = (150, 25), font = 1, flags = RT_VALIGN_CENTER, text = 2),
							MultiContentEntryText(pos = (180, 1), size = (720, 25), font = 0, flags = RT_VALIGN_CENTER, text = 3),
							MultiContentEntryText(pos = (180, 28), size = (625, 25), font = 1, flags = RT_VALIGN_CENTER, text = 4),
							MultiContentEntryText(pos = (10, 60), size = (900, 15), font = 2, flags = RT_VALIGN_CENTER, text = 5),
						])
						},
					"fonts": [gFont("Regular", 22), gFont("Regular", 16), gFont("Regular", 13)]
					}
				</convert>
			</widget>
			<widget name="statuslabel" position="210,%(inputY)d" size="%(listW)d,25" font="Regular;20"  zPosition="2" halign="center" valign="center" backgroundColor="#000000" transparent="0" />
			<widget name="input" position="210,%(inputY)d" zPosition="1" size="%(listW)d,25" font="Regular;20" halign="left" valign="bottom" backgroundColor="#000000" transparent="1"/>
			<widget name="config" position="210,0" zPosition="2" size="%(listW)d,%(configH)d" backgroundColor="background" transparent="0" />

			<ePixmap pixmap="skin_default/buttons/button_red_off.png" position="210,%(btnY)d" size="15,16" alphatest="on" />
			<widget source="button_red" zPosition="2" render="Pixmap" pixmap="skin_default/buttons/button_red.png" position="210,%(btnY)d" size="15,16" alphatest="on">
				<convert type="ConditionalShowHide" />
			</widget>
			<widget name="red" position="230,%(btnTxtY)d" size="100,20" foregroundColor="white" backgroundColor="background" font="Regular;18" transparent="1" halign="left" valign="top"/>

			<ePixmap pixmap="skin_default/buttons/button_green_off.png" position="340,%(btnY)d" size="15,16" zPosition="1" alphatest="on" />
			<widget source="button_green" zPosition="2" render="Pixmap" pixmap="skin_default/buttons/button_green.png" position="340,%(btnY)d" size="15,16" alphatest="on">
				<convert type="ConditionalShowHide" />
			</widget>
			<widget name="green" position="360,%(btnTxtY)d" size="100,20" foregroundColor="white" backgroundColor="background" font="Regular;18" transparent="1" halign="left" valign="top"/>

			<ePixmap pixmap="skin_default/buttons/button_yellow_off.png" position="470,%(btnY)d" size="15,16" alphatest="on" />
			<widget source="button_yellow" zPosition="2" render="Pixmap" pixmap="skin_default/buttons/button_yellow.png" position="470,%(btnY)d" size="15,16" alphatest="on">
				<convert type="ConditionalShowHide" />
			</widget>
			<widget name="yellow" position="490,%(btnTxtY)d" size="100,20" foregroundColor="white" backgroundColor="background" font="Regular;18" transparent="1" halign="left" valign="top"/>

			<ePixmap pixmap="skin_default/buttons/button_blue_off.png" position="600,%(btnY)d" size="15,16" alphatest="on" />
			<widget source="button_blue" zPosition="2" render="Pixmap" pixmap="skin_default/buttons/button_blue.png" position="600,%(btnY)d" size="15,16" alphatest="on">
				<convert type="ConditionalShowHide" />
			</widget>
			<widget name="blue" position="620,%(btnTxtY)d" size="200,20" foregroundColor="white" backgroundColor="background" font="Regular;18" transparent="1" halign="left" valign="top"/>
		</screen>
		""" %{ 	"w" : width,
				"h" : height,
				"listW" : width - 210, "listH" : height - 90,
				"inputY" : height - 80,
				"configH" : height - 90,
				"btnY" : bof + 2,
				"btnTxtY" : bof
			}

	def __init__(self, session, currentTitle, currentUrl, menulist = None):
		Screen.__init__(self, session)

		self.currentUrl = currentUrl
		self.currentTitle = currentTitle

		#Menu
		if menulist is None:
			self.menu = MenuList([
						(_("Bookmarks"), self.MENU_BOOKMARKS),
						(_("History"), self.MENU_HISTORY),
						(_("Downloads"), self.MENU_DOWNLOADS),
						(_("Certificates"), self.MENU_CERTS),
						(_("Cookies"), self.MENU_COOKIES),
						(_("Settings"), self.MENU_SETTINGS),
				], enableWrapAround = True)
		else:
			self.menu = MenuList(menulist, enableWrapAround=True)
		self["menu"] = self.menu

		self["statuslabel"] = Label("")
		self["statuslabel"].hide()

		#Color Buttons
		self["button_red"] = Boolean(False)
		self["button_green"] = Boolean(False)
		self["button_yellow"] = Boolean(False)
		self["button_blue"] = Boolean(False)
		self.red = Label("")
		self.green = Label("")
		self.yellow = Label("")
		self.blue = Label("")
		self["red"] = self.red
		self["green"] = self.green
		self["yellow"] = self.yellow
		self["blue"] = self.blue

		#Lists
		self.detailList = List([], enableWrapAround = True)
		self.detailConfigList = ConfigList([])
		self.detailConfigList.l.setSeperation( (BrowserMenu.width - 210) / 2 )
		config.plugins.WebBrowser.storage.enabled.addNotifier(self.__cfgExpandableElementChanged, initial_call = False)
		config.plugins.WebBrowser.storage.enabled.addNotifier(self.__cfgStoragePathChanged, initial_call = False)
		config.plugins.WebBrowser.storage.path.addNotifier(self.__cfgStoragePathChanged, initial_call = False)

		self.detailInput = EnhancedInput()

		self["list"] = self.detailList
		self["config"] = self.detailConfigList
		self["input"] = self.detailInput
		self["line"] = CanvasSource()

		self.__cfgCreateSetup()

		self.__db = BrowserDB.getInstance()
		self.__curMenu = self.MENU_BOOKMARKS
		self.__bmList = None
		self.__hisList = None
		self.__crtList = None
		self.__ckList = None
		self.__bmNeedle = ""
		self.__bmFilterTimer = eTimer()
		self.__bmFilterTimer_conn = self.__bmFilterTimer.timeout.connect(self.__bmFilterCB)
		self.__hisNeedle = ""
		self.__hisFilterTimer = eTimer()
		self.__hisFilterTimer_conn = self.__hisFilterTimer.timeout.connect(self.__hisFilterCB)
		self.__dlRefreshTimer = eTimer()
		self.__dlRefreshTimer_conn = self.__dlRefreshTimer.timeout.connect(self.__dlBuildList)
		self.__statusTimer = eTimer()
		self.__statusTimer_conn = self.__statusTimer.timeout.connect(self.__hideStatus)
		self.__actions = []

		self.onFirstExecBegin.append(self.__drawSeparator)
		self.onFirstExecBegin.append(self.__onMenuChanged)
		self.onExecBegin.append(self.__reloadData)
		self.onShow.append(self.setKeyboardModeAscii)

		self["actions"] = ActionMap(["BrowserActions", "ColorActions"],
		{
			"ok" : self.__actionOk,
			"enter" : self.__actionOk,
			"exit" : self.__actionExit,
			"pageUp" : self.__actionMenuUp,
			"pageDown" : self.__actionMenuDown,
			"up" : boundFunction(self.__action, "up"),
			"down" : boundFunction(self.__action, "down"),
			"left" : boundFunction(self.__action, "left"),
			"right" : boundFunction(self.__action, "right"),
			"red" : boundFunction(self.__action, "red"),
			"green" : boundFunction(self.__action, "green"),
			"yellow" : boundFunction(self.__action, "yellow"),
			"blue" : boundFunction(self.__action, "blue"),
			"backspace" : boundFunction(self.__action, "backspace"),
			"delete" : boundFunction(self.__action, "delete"),
			"ascii": boundFunction(self.__action, "ascii"),
			# TODO "text" : self.__text
		}, -2)

		self["numberactions"] = NumberActionMap(["NumberActions"],
		{
			"1": self.__keyNumberGlobal,
			"2": self.__keyNumberGlobal,
			"3": self.__keyNumberGlobal,
			"4": self.__keyNumberGlobal,
			"5": self.__keyNumberGlobal,
			"6": self.__keyNumberGlobal,
			"7": self.__keyNumberGlobal,
			"8": self.__keyNumberGlobal,
			"9": self.__keyNumberGlobal,
			"0": self.__keyNumberGlobal
		}, -2)

		self.__actionFuncs = {
			self.MENU_BOOKMARKS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.selectPrevious,
				"right" : self.detailList.pageDown,
				"ok" : self.__bmOk,
				"enter" : self.__bmOk,
				"red" : self.__bmDelete,
				"green" : self.__bmAdd,
				"yellow" : self.__bmEdit,
				"blue" : self.__bmSetCurrentAsHome,
				"backspace" : self.__bmKeyBackspace,
				"delete" : self.__bmKeyDelete,
				"ascii": self.__bmKeyAscii,
				},
			self.MENU_HISTORY : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"ok" : self.__hisOk,
				"enter" : self.__hisOk,
				"red" : self.__hisClear,
				"blue" : self.__hisSetCurrentAsHome,
				"backspace" : self.__hisKeyBackspace,
				"delete" : self.__hisKeyDelete,
				"ascii": self.__hisKeyAscii,
				},
			self.MENU_SETTINGS : {
				"up" : self.__cfgKeyUp,
				"down" : self.__cfgKeyDown,
				"left" : self.__cfgKeyLeft,
				"right" : self.__cfgKeyRight,
				"ok" : self.__cfgKeyOK,
				"enter" : self.__cfgKeyOK,
				"red" : self.__cfgCancel,
				"green" : self.__cfgSave,
				"backspace" : self.__cfgKeyBackspace,
				"delete" : self.__cfgKeyDelete,
				"ascii": self.__cfgKeyAscii,
				},
			self.MENU_DOWNLOADS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__dlAbort,
				},
			self.MENU_CERTS : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__crtDelete,
				"green" : self.__crtDetails,
				},
			self.MENU_COOKIES : {
				"up" : self.detailList.selectPrevious,
				"down" : self.detailList.selectNext,
				"left" : self.detailList.pageUp,
				"right" : self.detailList.pageDown,
				"red" : self.__ckDelete,
				"blue" : self.__ckDeleteAll,
				}
		}

	def _close(self):
		config.plugins.WebBrowser.storage.enabled.removeNotifier(self.__cfgExpandableElementChanged)
		config.plugins.WebBrowser.storage.enabled.removeNotifier(self.__cfgStoragePathChanged)
		config.plugins.WebBrowser.storage.path.removeNotifier(self.__cfgStoragePathChanged)
		self.close(self.__actions)

	def __actionOk(self):
		if self["statuslabel"].visible:
			self["statuslabel"].hide()
		else:
			self.__action("ok")

	def __actionExit(self):
		if self["statuslabel"].visible:
			self["statuslabel"].hide()
		else:
			if self.detailConfigList.isChanged():
				self.__cfgSave()
			self._close()

	def __actionMenuUp(self):
		self.menu.up()
		self.__onMenuChanged()

	def __actionMenuDown(self):
		self.menu.down()
		self.__onMenuChanged()

	def __reloadData(self):
		self.__bmList = self.__db.getBookmarks()
		self.__hisList = self.__db.getHistory()
		self.__crtList = self.__db.getCerts()
		self.__ckList = self.__db.getCookies()

	def __action(self, action):
		print "[BrowserMenu].__action :: action='%s'" %action
		fnc = self.__actionFuncs[self.__curMenu].get(action, None)
		if fnc != None:
			fnc()

	def __text(self):
		if self.__curMenu == self.MENU_SETTINGS:
			self.__cfgKeyText()
		elif self.__curMenu == self.MENU_BOOKMARKS:
			pass

	def __keyNumberGlobal(self, number):
		if self.__curMenu == self.MENU_SETTINGS:
			self.__cfgKeyNumberGlobal(number)
		elif self.__curMenu == self.MENU_BOOKMARKS:
			self.__bmKeyNumberGlobal(number)
		elif self.__curMenu == self.MENU_HISTORY:
			self.__hisKeyNumberGlobal(number)

	def __onMenuChanged(self):
		self.__bmFilterTimer.stop()
		self.__hisFilterTimer.stop()
		self.__dlRefreshTimer.stop()

		self.__curMenu = self.menu.getCurrent()[1]
		if self.__curMenu == self.MENU_BOOKMARKS:
			self.__showMenuList(True)
			self.__setButtons(_("Delete"), _("Add"), _("Edit"), _("Set as Startpage"))
			self.detailList.style = "default"
			self.__bmBuildList()
			self.detailInput.setText(self.__bmNeedle)
		elif self.__curMenu == self.MENU_HISTORY:
			self.__showMenuList(True)
			self.__setButtons(_("Clear"), "", "", _("Set as Startpage"))
			self.detailList.style = "history"
			self.__hisBuildList()
			self.detailInput.setText(self.__hisNeedle)
		elif self.__curMenu == self.MENU_SETTINGS:
			self.__showConfigList()
			self.__setButtons(_("Cancel"), _("Save"), "", "")
		elif self.__curMenu == self.MENU_DOWNLOADS:
			self.__showMenuList()
			self.__setButtons(_("Abort"), "", "", "")
			self.detailList.style = "downloads"
			self.__dlBuildList()
		elif self.__curMenu == self.MENU_CERTS:
			self.__showMenuList()
			self.__setButtons(_("Delete"), _("Details"), "", "")
			self.detailList.style = "certificates"
			self.__crtBuildList()
		elif self.__curMenu == self.MENU_COOKIES:
			self.__showMenuList()
			self.__setButtons(_("Delete"), "", "", _("Delete All"))
			self.detailList.style = "cookies"
			self.__ckBuildList()

	def __setButtons(self, red, green, yellow, blue):
		self.red.setText(red)
		self.__setButtonPixmapVisible(self["button_red"], red)
		self.green.setText(green)
		self.__setButtonPixmapVisible(self["button_green"], green)
		self.yellow.setText(yellow)
		self.__setButtonPixmapVisible(self["button_yellow"], yellow)
		self.blue.setText(blue)
		self.__setButtonPixmapVisible(self["button_blue"], blue)

	def __setButtonPixmapVisible(self, B, label):
		show = True
		if label == "":
			show = False
		B.setBoolean(show)

	def __showMenuList(self, hasFilter = False):
		if self.detailConfigList.visible:
			self.detailConfigList.hide()

# 		if not self.detailList.instance.visible:
# 			self.detailList.instance.show()
		if hasFilter:
			self.detailInput.show()
		else:
			self.detailInput.hide()

	def __showConfigList(self):
# 		if self.detailList.instance.visible == 1:
# 			self.detailList.instance.hide()
		self.detailInput.hide()
		if self.detailConfigList.visible == 0:
			self.detailConfigList.show()

	def __drawSeparator(self):
		self["line"].fill(0, 0, 4, BrowserMenu.height, 0xFF9900)
		self["line"].flush()

	def __setStatus(self, text):
		print "[BrowserMenu].__setStatus"
		self["statuslabel"].setText(text)
		self["statuslabel"].show()
		self.__statusTimer.startLongTimer(3)

	def __hideStatus(self):
		self["statuslabel"].hide()
		self.__statusTimer.stop()

	# Config List Methods
	def __cfgCreateSetup(self):
		list = [
			getConfigListEntry(_("Home Page"), config.plugins.WebBrowser.home),
			getConfigListEntry(_("Page to load on startup"), config.plugins.WebBrowser.startPage),
			getConfigListEntry(_("Search Provider"), config.plugins.WebBrowser.searchProvider),
			getConfigListEntry(_("Run fullscreen"), config.plugins.WebBrowser.fullscreen),
			getConfigListEntry(_("Offset in scroll mode (px)"), config.plugins.WebBrowser.scrollOffset),
			getConfigListEntry(_("Target directory for downloads"), config.plugins.WebBrowser.downloadpath),
			getConfigListEntry(_("Enable persistent storage"), config.plugins.WebBrowser.storage.enabled),
		]
		if config.plugins.WebBrowser.storage.enabled.value:
			list.append(getConfigListEntry(_("Path for persistent storage"), config.plugins.WebBrowser.storage.path))

		self.detailConfigList.setList(list)

	def __cfgExpandableElementChanged(self, element):
		self.__cfgCreateSetup()

	def __cfgSave(self):
		for x in self.detailConfigList.list:
			x[1].save()
		self.__setStatus(_("Settings have been saved successfully!"))

	def __cfgStoragePathChanged(self, element):
		action = [self.ACTION_STORAGE_PATH,True]
		if not action in self.__actions:
			self.__actions.append(action)

	def __cfgCancel(self):
		dlg = self.session.openWithCallback(self.__cfgCancelCB, MessageBox, _("Do you really want to discard all changes?"), type = MessageBox.TYPE_YESNO)
		dlg.setTitle(_("Discard changed settings?"))

	def __cfgCancelCB(self, confirmed):
		for x in self.detailConfigList.list:
			x[1].cancel()
		self.__setStatus(_("All changes to the settings have been discarded!"))

	def __cfgKeyText(self):
		from Screens.VirtualKeyBoard import VirtualKeyBoard
		self.session.openWithCallback(self.__cfgVirtualKeyBoardCallback, VirtualKeyBoard, title = self.detailConfigList.getCurrent()[0], text = self.detailConfigList.getCurrent()[1].getValue())

	def __cfgVirtualKeyBoardCallback(self, callback = None):
		if callback is not None and len(callback):
			self.detailConfigList.getCurrent()[1].setValue(callback)
			self.detailConfigList.invalidate(self.detailConfigList.getCurrent())

	def  __cfgKeyOK(self):
		self.detailConfigList.handleKey(KEY_OK)

	def  __cfgKeyUp(self):
		self.detailConfigList.instance.moveSelection(eListbox.moveUp)

	def  __cfgKeyDown(self):
		self.detailConfigList.instance.moveSelection(eListbox.moveDown)

	def  __cfgKeyLeft(self):
		self.detailConfigList.handleKey(KEY_LEFT)

	def __cfgKeyRight(self):
		self.detailConfigList.handleKey(KEY_RIGHT)

	def __cfgKeyHome(self):
		self.detailConfigList.handleKey(KEY_HOME)

	def __cfgKeyEnd(self):
		self.detailConfigList.handleKey(KEY_END)

	def __cfgKeyDelete(self):
		self.detailConfigList.handleKey(KEY_DELETE)

	def __cfgKeyBackspace(self):
		self.detailConfigList.handleKey(KEY_BACKSPACE)

	def __cfgKeyToggleOW(self):
		self.detailConfigList.handleKey(KEY_TOGGLEOW)

	def __cfgKeyAscii(self):
		self.detailConfigList.handleKey(KEY_ASCII)

	def __cfgKeyNumberGlobal(self, number):
		self.detailConfigList.handleKey(KEY_0 + number)

	#Bookmark List Methods
	def __bmOk(self):
		print "[BrowserMenu].__bmOk"
		if self.detailList.index > 0 and  self.detailList.getCurrent() != None:
			current = self.detailList.getCurrent()[0]
			print "[BrowserMenu].__bmOk, current = '%s'" %current
			self.__actions.append( (self.ACTION_BOOKMARK, current.url) )
			self.close( self.__actions )
		else:
			self.__bmAdd(Bookmark(-1, self.currentTitle, self.currentUrl))

	def __bmAdd(self, bookmark = None):
		self.session.openWithCallback(self.__bmEditCB, BookmarkEditor, bookmark)

	def __bmEdit(self):
		if self.detailList.index > 0 and  self.detailList.getCurrent() != None:
			cur = self.detailList.getCurrent()[0]
			self.session.openWithCallback(self.__bmEditCB, BookmarkEditor, cur)

	def __bmEditCB(self, bookmark):
		if bookmark != None:
			self.__db.setBookmark(bookmark)
			self.__bmReload()
			self.__setStatus(_("Bookmark '%s' saved succesfully!" %bookmark.name))

	def __bmDelete(self):
		if self.detailList.getCurrent() != None:
			name = self.detailList.getCurrent()[0].name
			print "[BrowserMenu].__bmDelete, name='%s'" %name
			dlg = self.session.openWithCallback( self.__bmDeleteCB, MessageBox, _("Do you really want to delete the bookmark '%s'?") %name, type = MessageBox.TYPE_YESNO )
			dlg.setTitle(_("Delete Bookmark?"))

	def __bmDeleteCB(self, confirmed):
		if confirmed:
			self.__db.deleteBookmark( self.detailList.getCurrent()[0] )
			name = self.detailList.getCurrent()[0]
			self.__setStatus(_("Bookmark '%s' deleted!" %name))
			self.__bmReload()

	def __bmSetCurrentAsHome(self):
		cur = self.detailList.getCurrent()[0]
		self.__setUrlAsHome(cur.url)

	def __bmGetEntryComponent(self, bookmark):
		return ( bookmark, bookmark.name, bookmark.url )

	def __bmBuildList(self):
		print "[BrowserMenu].__bmBuildList"
		list = []
		#Suggest current page for adding

		default = Bookmark(-2, _("Add '%s' to Bookmarks" %self.currentTitle), self.currentUrl)
		list.append(self.__bmGetEntryComponent(default))
		for b in self.__bmList:
			list.append(self.__bmGetEntryComponent(b))
		self.detailList.setList(list)

	def __bmReload(self, needle = ""):
		print "[BrowserMenu].__bmReload"
		self.__bmNeedle = needle
		self.__bmList = self.__db.getBookmarks(needle)
		self.__bmBuildList()

	def __bmFilterCB(self):
		print "[BrowserMenu].__bmFilterCB"
		needle = self.detailInput.getText()
		if needle != self.__bmNeedle:
			self.__bmReload(needle)
		else:
			self.__bmFilterTimer.stop()

	def __bmKeyNumberGlobal(self, number):
		self.detailInput.number(number)
		self.__bmFilterTimer.startLongTimer(1)

	def __bmKeyAscii(self):
		self.detailInput.handleAscii(getPrevAsciiCode())
		self.__bmFilterTimer.startLongTimer(1)

	def __bmKeyDelete(self):
		self.detailInput.delete()
		self.__bmFilterTimer.startLongTimer(1)

	def __bmKeyBackspace(self):
		self.detailInput.deleteBackward()
		self.__bmFilterTimer.startLongTimer(1)

	#History list methods
	def __hisSetCurrentAsHome(self):
		if self.detailList.getCurrent() != None:
			cur = self.detailList.getCurrent()[0]
			self.__setUrlAsHome(cur.url)

	def __setUrlAsHome(self, url):
		config.plugins.WebBrowser.home.value = url
		config.plugins.WebBrowser.home.save()
		self.__setStatus(_("Home page has been set to '%s'" %url))

	def __hisClear(self):
		dlg = self.session.openWithCallback(self.__hisClearCB, MessageBox, _("Do you really want to clear the History?"), type = MessageBox.TYPE_YESNO)
		dlg.setTitle(_("Clear History?"))

	def __hisClearCB(self, confirmed):
		if confirmed:
			self.__db.clearHistory()
			self.__hisReload()
			self.__setStatus(_("History cleared!"))

	def __hisGetEntryComponent(self, historyItem):
		date = strftime("%Y-%m-%d", localtime(historyItem.timestamp))
		time = strftime("%H:%M:%S", localtime(historyItem.timestamp))
		return ( historyItem, date, time, historyItem.title, historyItem.url )

	def __hisReload(self, needle = ""):
		print "[BrowserMenu].__hisReload"
		self.__hisNeedle = needle
		self.__hisList = self.__db.getHistory(needle)
		self.__hisBuildList()

	def __hisBuildList(self):
		print "[BrowserMenu].__hisBuildList"
		history = []
		for h in self.__hisList:
			history.append(self.__hisGetEntryComponent(h))
		self.detailList.setList(history)

	def __hisOk(self):
		if self.detailList.getCurrent() != None:
			current = self.detailList.getCurrent()[0]
			self.__actions.append( (self.ACTION_BOOKMARK, current.url) )
			self.close( self.__actions )

	def __hisFilterCB(self):
		needle = self.detailInput.getText()
		if needle != self.__hisNeedle:
			self.__hisReload(needle)
		else:
			self.__hisFilterTimer.stop()

	def __hisKeyNumberGlobal(self, number):
		self.detailInput.number(number)
		self.__hisFilterTimer.startLongTimer(1)

	def __hisKeyAscii(self):
		self.detailInput.handleAscii(getPrevAsciiCode())
		self.__hisFilterTimer.startLongTimer(1)

	def __hisKeyDelete(self):
		self.detailInput.delete()
		self.__hisFilterTimer.startLongTimer(1)

	def __hisKeyBackspace(self):
		self.detailInput.deleteBackward()
		self.__hisFilterTimer.startLongTimer(1)

	#Download list methods
	def __dlGetEntryComponent(self, job):
		return ( job, job.name, job.getStatustext(), int(100*job.progress/float(job.end)), str(100*job.progress/float(job.end)) + "%")

	def __dlBuildList(self):
		print "[BrowserMenu].__dlBuildList"
		downloads = []
		for job in downloadManager.getPendingJobs():
			downloads.append(self.__dlGetEntryComponent(job))
		self.detailList.setList(downloads)
		if not self.__dlRefreshTimer.isActive():
			self.__dlRefreshTimer.startLongTimer(3)

	def __dlAbort(self):
		print "[BrowserMenu].__dlAbort"
		cur = self.detailList.getCurrent()
		if cur != None:
			job = cur[0]
			dlg = self.session.openWithCallback( self.__dlAbortCB, MessageBox, _("Do you really want to abort downloading '%s'?") %job.name, type = MessageBox.TYPE_YESNO)
			dlg.setTitle(_("Abort Download?"))

	#Certificate list methods
	def __dlAbortCB(self, confirmed):
		if confirmed:
			self.detailList.getCurrent()[0].remove(downloadManager.jobDone)
			self.__dlBuildList()

	def __crtGetEntryComponent(self, cert):
		cn = "CN: %s" %(str(cert.cert.get_subject().commonName))
		return ( cert, str(cert.notBefore()), str(cert.notAfter()), str(cert.host), cn, str(cert.cert.digest("sha1")) )

	def __crtReload(self):
		print "[BrowserMenu].__crtReload"
		self.__crtList = self.__db.getCerts()
		self.__crtBuildList()


	def __crtBuildList(self):
		print "[BrowserMenu].__crtBuildList"
		certs = []
		for c in self.__crtList:
			certs.append(self.__crtGetEntryComponent(c))
		self.detailList.setList(certs)

	def __crtDelete(self):
		if self.detailList.index >= 0 and self.detailList.getCurrent() != None:
			cert = self.detailList.getCurrent()[0]
			print "[BrowserMenu].__crtDelete, host=%s,SHA1 fingerprint=%s" %(cert.host,cert.cert.digest("sha1"))
			text = _("Do you really want to remove the following certificate from the list of trusted certificates?\n\nHostname: %s\nSHA1-Fingerprint: %s") %(cert.host, cert.cert.digest("sha1"))
			dlg = self.session.openWithCallback( self.__crtDeleteCB, MessageBox, text, type = MessageBox.TYPE_YESNO )
			dlg.setTitle(_("Remove trusted certificate?"))

	def __crtDeleteCB(self, confirmed):
		print "[BrowserMenu].__crtDeleteCB"
		if confirmed:
			cert = self.detailList.getCurrent()[0]
			self.__db.deleteCert(cert)
			self.__crtReload()

	def __crtDetails(self):
		print "[BrowserMenu].__crtDetails"
		if self.detailList.index >= 0 and self.detailList.getCurrent() != None:
			cert = self.detailList.getCurrent()[0]

			text = _("Issued for:")
			for item in cert.cert.get_subject().get_components():
				text += "\n%s : %s" %(item[0], item[1])
			text += _("\n\nIssued from:")
			for item in cert.cert.get_issuer().get_components():
				text += "\n%s : %s" %(item[0], item[1])

			text += _("\n\nValidity:\n")
			text += _("From: %s\n") %cert.notBefore()
			text += _("Until: %s\n") %cert.notAfter()
			text += _("Expired: %s\n") %(_("Yes") if cert.cert.has_expired() else _("No"))

			dlg = self.session.open(MessageBox, text, type = MessageBox.TYPE_INFO)
			dlg.setTitle(_("Certificate Details (%s)") %cert.host)

	def __ckReload(self):
		print "[BrowserMenu].__ckReload"
		self.__ckList = self.__db.getCookies()
		self.__ckBuildList()

	def __ckBuildList(self):
		print "[BrowserMenu].__ckBuildList"
		cookies = []
		for c in self.__ckList:
			cookies.append(self.__ckGetEntryComponent(c))
		self.detailList.setList(cookies)

	def __ckGetEntryComponent(self, cookie):
		try:
			date = strftime("%Y-%m-%d", localtime(cookie.expires))
			time = strftime("%H:%M:%S", localtime(cookie.expires))
		except:
			date = _("never")
			time = _("never")
		return ( cookie, date, time, cookie.domain, cookie.path, cookie.raw )

	def __ckDelete(self):
		if self.detailList.index >= 0 and self.detailList.getCurrent() != None:
			cookie = self.detailList.getCurrent()[0]
			text = _("Do you really want to delete the following cookie?\nDomain: %s\nPath: %s\nKey: %s\nRaw-Content:\n%s") %(cookie.domain, cookie.path, cookie.key, cookie.raw)
			dlg = self.session.openWithCallback( self.__ckDeleteCB, MessageBox, text, type = MessageBox.TYPE_YESNO )
			dlg.setTitle(_("Delete Cookie?"))

	def __ckDeleteCB(self, confirmed):
		print "[BrowserMenu].__ckDeleteCB"
		if confirmed:
			self.__db.deleteCookie(self.detailList.getCurrent()[0])
			self.__ckReload()
			action = [self.ACTION_COOKIES,True]
			if not action in self.__actions:
				self.__actions.append(action)

	def __ckDeleteAll(self):
		if self.detailList.index >= 0 and self.detailList.getCurrent() != None:
			text = _("Do you really want to delete ALL cookies?")
			dlg = self.session.openWithCallback( self.__ckDeleteAllCB, MessageBox, text, type = MessageBox.TYPE_YESNO )
			dlg.setTitle(_("Delete Cookie?"))

	def __ckDeleteAllCB(self, confirmed):
		print "[BrowserMenu].__ckDeleteCB"
		if confirmed:
			self.__db.deleteAllCookies()
			self.__ckReload()
			action = [self.ACTION_COOKIES,True]
			if not action in self.__actions:
				self.__actions.append(action)