Exemplo n.º 1
0
    def __init__(self):
        self.numberZapTimer = eTimer()
        self.numberZapTimer.callback.append(self.__OK)
        self.numberZapField = None

        self["numberzapokactions"] = HelpableActionMap(
            self,
            "OkCancelActions", {
                "cancel": (self.__cancel, _("Close number zap.")),
                "OK": (self.__OK, _("Change to service")),
            },
            prio=-1,
            description=_("Service/Channel number zap commands"))
        self["numberzapokactions"].setEnabled(False)
        helpMsg = _("Enter a number to jump to a service/channel")
        self["input_actions"] = HelpableNumberActionMap(
            self,
            "NumberActions",
            dict([(str(i), (self.keyNumberGlobal, helpMsg))
                  for i in range(0, 9)]),
            prio=-1,
            description=_("Service/Channel number zap commands"))

        self["zapbackground"] = Label()
        self["zapbackground"].hide()
        self["zapnumber"] = Label()
        self["zapnumber"].hide()
        self["zapservice"] = ServiceEvent()
        self["zapservice"].newService(None)
        self["number"] = Label()
        self["number"].hide()
Exemplo n.º 2
0
	def __init__(self, configRoot, disableKeymaps, screenSize_x, screenSize_y, moveMinMargin=30, moveStepSize=10):
		self.configRoot = configRoot
		self.disableKeymaps = disableKeymaps
		self.screenSize_x = screenSize_x
		self.screenSize_y = screenSize_y
		self.moveMinMargin = moveMinMargin
		self.moveStepSize = moveStepSize

		self["MovableScreenActions"] = HelpableNumberActionMap(self, "MovableScreenActions",
		{
			"ok": (self.moveKeyOk, _("Save values and close screen")),
			"cancel": (self.moveKeyCancel, _("Discard changes and close screen")),
			"left": (self.moveKeyLeft, _("Move screen to the left")),
			"right": (self.moveKeyRight, _("Move screen to the right")),
			"up": (self.moveKeyUp, _("Move screen up")),
			"down": (self.moveKeyDown, _("Move screen down")),
			"red": (self.moveKeyCancel, _("Discard changes and close screen")),
			"green": (self.moveKeyOk, _("Save values and close screen")),
			"1": (self.moveKeyNumber, _("Move screen to the upper left corner")),
			"2": (self.moveKeyNumber, _("Center screen at the upper border")),
			"3": (self.moveKeyNumber, _("Move screen to the upper right corner")),
			"4": (self.moveKeyNumber, _("Move screen to the middle of the left border")),
			"5": (self.moveKeyNumber, _("Move screen to the center of your TV")),
			"6": (self.moveKeyNumber, _("Move screen to the middle of the right border")),
			"7": (self.moveKeyNumber, _("Move screen to the lower left corner")),
			"8": (self.moveKeyNumber, _("Center screen at the lower border")),
			"9": (self.moveKeyNumber, _("Move screen to the lower right corner")),
			"0": (self.moveKeyNumber, _("Reset saved position"))
		}, -1)

		self["MovableScreenActions"].setEnabled(False)

		desktop = getDesktop(0)
		self.desktopWidth = desktop.size().width()
		self.desktopHeight = desktop.size().height()
Exemplo n.º 3
0
	def __init__(self, session, screenTitle=_("GUI Skin")):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		if SkinSelector.skin is None:
			self.initialiseSkin()
		Screen.setTitle(self, screenTitle)

		self.rootDir = resolveFilename(SCOPE_SKIN)
		self.config = config.skin.primary_skin
		self.current = currentPrimarySkin
		self.xmlList = ["skin.xml"]
		self.onChangedEntry = []
		self["skins"] = List(enableWrapAround=True)
		self["preview"] = Pixmap()
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["description"] = StaticText(_("Please wait... Loading list..."))
		self["actions"] = HelpableNumberActionMap(self, ["SetupActions", "DirectionActions", "ColorActions"], {
			"ok": (self.save, _("Save and activate the currently selected skin")),
			"cancel": (self.cancel, _("Cancel any changes to the currently active skin")),
			"close": (self.cancelRecursive, _("Cancel any changes to the currently active skin and exit all menus")),
			"red": (self.cancel, _("Cancel any changes to the currently active skin")),
			"green": (self.save, _("Save and activate the currently selected skin")),
			"up": (self.up, _("Move to the previous skin")),
			"down": (self.down, _("Move to the next skin")),
			"left": (self.left, _("Move to the previous page")),
			"right": (self.right, _("Move to the next page"))
		}, -1, description=_("Skin Selection Actions"))
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.showPic)
		self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 4
0
 def __init__(self, session, tlist, menuTitle):
     Screen.__init__(self, session)
     self.tlist = tlist
     self.setTitle(menuTitle)
     self.skinName = "Animmain"
     ipage = 1
     list = []
     nopic = len(tlist)
     self.pos = []
     self.index = 0
     list = []
     tlist = []
     self["label1"] = StaticText()
     self["label2"] = StaticText()
     self["label3"] = StaticText()
     self["label4"] = StaticText()
     self["label5"] = StaticText()
     self["key_red"] = StaticText(_("Exit"))
     self["key_green"] = StaticText(_("Select"))
     self["actions"] = HelpableNumberActionMap(self, [
         "OkCancelActions", "MenuActions", "DirectionActions",
         "NumberActions", "ColorActions"
     ], {
         "ok": self.okbuttonClick,
         "cancel": self.closeNonRecursive,
         "left": self.key_left,
         "right": self.key_right,
         "up": self.key_up,
         "down": self.key_down,
         "red": self.cancel,
         "green": self.okbuttonClick,
         "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
     },
                                               prio=0)
     nop = len(self.tlist)
     self.nop = nop
     nh = 1
     if nop == 1:
         nh = 1
     elif nop == 2:
         nh = 2
     elif nop == 3:
         nh = 2
     elif nop == 4:
         nh = 3
     elif nop == 5:
         nh = 3
     else:
         nh = int(float(nop) / 2)
     self.index = nh
     i = 0
     self.onShown.append(self.openTest)
Exemplo n.º 5
0
    def __init__(self, session, getServiceByNumber, callback, number):
        Screen.__init__(self, session)
        self.skinName = "EPGServiceNumberSelection"
        self.getServiceByNumber = getServiceByNumber
        self.callback = callback

        helpDescription = _("EPG Commands")
        helpMsg = _("Enter a number to jump to a service/channel")
        self["actions"] = HelpableNumberActionMap(
            self,
            "NumberActions",
            dict([(str(i), (self.keyNumber, helpMsg)) for i in range(0, 10)]),
            prio=-1,
            description=helpDescription)
        self["cancelaction"] = HelpableActionMap(
            self,
            "OkCancelActions", {
                "cancel": (self.__cancel, _("Exit channel selection")),
                "OK": (self.__OK, _("Select EPG channel"))
            },
            prio=-1,
            description=helpDescription)

        self["number"] = Label()
        self["service"] = ServiceEvent()
        self["service"].newService(None)

        self.timer = eTimer()
        self.timer.callback.append(self.__OK)
        self.number = ""
        self.keyNumber(number)
Exemplo n.º 6
0
 def __init__(self):
     helpMsg = _("Enter a number to jump to a service/channel")
     self["numberactions"] = HelpableNumberActionMap(
         self,
         "NumberActions",
         dict([(str(i), (self.keyNumberGlobal, helpMsg))
               for i in range(0, 10)]),
         prio=-1,
         description=_("Service/Channel number zap commands"))
Exemplo n.º 7
0
    def __init__(self, session, timer, menu_path=""):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        screentitle = _("PowerManager entry")
        menu_path += screentitle
        if config.usage.show_menupath.value == 'large':
            title = menu_path
            self["menu_path_compressed"] = StaticText("")
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            print 'menu_path:', menu_path
            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("")
        self.setup_title = title
        Screen.setTitle(self, title)

        self.timer = timer

        self.entryDate = None
        self.entryService = None

        self["HelpWindow"] = Pixmap()
        self["HelpWindow"].hide()
        self["VKeyIcon"] = Boolean(False)

        self["description"] = Label("")
        self["key_red"] = Label(_("Cancel"))
        self["key_green"] = Label(_("OK"))
        self["key_yellow"] = Label()
        self["key_blue"] = Label()

        self.createConfig()

        self["actions"] = HelpableNumberActionMap(
            self, ["SetupActions", "GlobalActions", "PiPSetupActions"], {
                "ok": (self.keySelect, _("Save the timer and exit")),
                "save": (self.keyGo, "Save the timer and exit"),
                "cancel":
                (self.keyCancel, "Cancel creation of the timer and exit"),
                "volumeUp": (self.incrementStart, _("Increment start time")),
                "volumeDown": (self.decrementStart, _("Decrement start time")),
                "size+": (self.incrementEnd, _("Increment end time")),
                "size-": (self.decrementEnd, _("Decrement end time"))
            }, -2)

        self.list = []
        ConfigListScreen.__init__(self, self.list, session=session)
        self.createSetup("config")
        if self.selectionChanged not in self["config"].onSelectionChanged:
            self["config"].onSelectionChanged.append(self.selectionChanged)
        self.selectionChanged()
Exemplo n.º 8
0
    def __init__(self, session, screenTitle=_("GUI Skin")):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        element = domScreens.get("SkinSelector", (None, None))[0]
        if element and 'introduction' in [
                widget.get('source', None)
                for widget in element.findall("widget")
        ]:
            #screen from loaded skin is  not compatible so remove the screen
            del domScreens["SkinSelector"]
        if SkinSelector.skin is None or "SkinSelector" not in domScreens:
            # The skin template is designed for a HD screen so the scaling factor is 720.
            SkinSelector.skin = SkinSelector.skinTemplate % tuple([
                x * getDesktop(0).size().height() / 720
                for x in SkinSelector.scaleData
            ])
        Screen.setTitle(self, screenTitle)
        self.rootDir = resolveFilename(SCOPE_SKIN)
        self.config = config.skin.primary_skin
        self.current = currentPrimarySkin
        self.xmlList = ["skin.xml"]
        self.onChangedEntry = []
        self["skins"] = List(enableWrapAround=True)
        self["preview"] = Pixmap()
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save"))
        self["description"] = StaticText(_("Please wait... Loading list..."))
        self["actions"] = HelpableNumberActionMap(self, [
            "SetupActions", "DirectionActions", "ColorActions"
        ], {
            "ok":
            (self.save, _("Save and activate the currently selected skin")),
            "cancel": (self.cancel,
                       _("Cancel any changes to the currently active skin")),
            "close":
            (self.cancelRecursive,
             _("Cancel any changes to the currently active skin and exit all menus"
               )),
            "red": (self.cancel,
                    _("Cancel any changes to the currently active skin")),
            "green":
            (self.save, _("Save and activate the currently selected skin")),
            "up": (self.up, _("Move to the previous skin")),
            "down": (self.down, _("Move to the next skin")),
            "left": (self.left, _("Move to the previous page")),
            "right": (self.right, _("Move to the next page"))
        },
                                                  -1,
                                                  description=_(
                                                      "Skin Selection Actions")
                                                  )
        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.showPic)
        self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 9
0
 def __init__(self, session, timer):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.timer = timer
     self.logEntries = timer.log_entries[:]
     self["actions"] = HelpableNumberActionMap(
         self,
         ["OkCancelActions", "NavigationActions", "ColorActions"],
         {
             "ok":
             (self.keyCancel,
              _("Cancel any changes and close the log and the screen")),
             "cancel":
             (self.keyCancel,
              _("Cancel any changes and close the log and the screen")),
             "red":
             (self.keyCancel,
              _("Cancel any changes and close the log and the screen")),
             "green":
             (self.keySave,
              _("Save the current contents of the log and close the screen")
              ),
             "yellow":
             (self.deleteEntry, _("Delete the current entry from the log")),
             "blue": (self.clearLog, _("Clear the contents of the log")),
             "top": (self.keyTop, _("Move to first line / screen")),
             "pageUp": (self.keyPageUp, _("Move up a screen")),
             "up": (self.keyUp, _("Move up a line")),
             # "first": (self.keyFirst, _("Jump to first item in list or the start of text")),
             # "left": (self.keyLeft, _("Select the previous item in list or move cursor left")),
             # "right": (self.keyRight, _("Select the next item in list or move cursor right")),
             # "last": (self.keyLast, _("Jump to last item in list or the end of text")),
             "down": (self.keyDown, _("Move down a line")),
             "pageDown": (self.keyPageDown, _("Move down a screen")),
             "bottom": (self.keyBottom, _("Move to last line / screen"))
         },
         prio=0,
         description=_("Log Actions"))
     self.setTitle(_("Timer Log"))
     self["key_red"] = StaticText(_("Cancel"))
     self["key_green"] = StaticText(_("Save"))
     self["key_yellow"] = StaticText(_("Delete entry"))
     self["key_blue"] = StaticText(_("Clear log"))
     self["loglist"] = MenuList(self.fillLogList())
     self["logentry"] = Label()
     self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 10
0
	def __init__(self, session, timer):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.setup_title = _("Timer entry")
		self.timer = timer

		self.entryDate = None
		self.entryService = None

		self["HelpWindow"] = Pixmap()
		self["HelpWindow"].hide()
		self["VKeyIcon"] = Pixmap()

		self["description"] = Label("")
		self["key_red"] = Label(_("Cancel"))
		self["key_green"] = Label(_("OK"))
		self["key_yellow"] = Label()
		self["key_blue"] = Label()

		self.createConfig()

		self["actions"] = HelpableNumberActionMap(self, ["SetupActions", "GlobalActions", "PiPSetupActions", "ColorActions"], {
			"ok": (self.keySelect, _("Save the timer and exit")),
			"save": (self.keyGo, "Save the timer and exit"),
			"cancel": (self.keyCancel, "Cancel creation of the timer and exit"),
			"volumeUp": (self.incrementStart, _("Increment start time")),
			"volumeDown": (self.decrementStart, _("Decrement start time")),
			"size+": (self.incrementEnd, _("Increment end time")),
			"size-": (self.decrementEnd, _("Decrement end time"))
		}, -2)

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

		self.onChangedEntry = []
		self.list = []
		ConfigListScreen.__init__(self, self.list, session=session)
		self.createSetup("config")
		self.onLayoutFinish.append(self.layoutFinished)
		if self.selectionChanged not in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.selectionChanged)
		self.selectionChanged()
Exemplo n.º 11
0
 def __init__(self, session, timer):
     Screen.__init__(self, session)
     self.timer = timer
     self.timer.service_ref_prev = self.timer.service_ref
     self.timer.begin_prev = self.timer.begin
     self.timer.end_prev = self.timer.end
     self.timer.external_prev = self.timer.external
     self.timer.dirname_prev = self.timer.dirname
     self.entryDate = None
     self.entryService = None
     self.key_red_choice = self.EMPTY
     if self.key_red_choice != Pixmap:
         self["key_red"] = StaticText(_("Cancel"))
         self["key_green"] = StaticText(_("Save"))
         self["key_yellow"] = StaticText(_("Timer type"))
         self["key_blue"] = StaticText("")
     if self.key_red_choice != StaticText:
         self["oktext"] = Label(_("OK"))
         self["canceltext"] = Label(_("Cancel"))
         self["ok"] = Pixmap()
         self["cancel"] = Pixmap()
     self["actions"] = HelpableNumberActionMap(
         self, [
             "SetupActions", "GlobalActions", "PiPSetupActions",
             "ColorActions"
         ], {
             "ok": self.keySelect,
             "save": self.keyGo,
             "cancel": self.keyCancel,
             "volumeUp": self.incrementStart,
             "volumeDown": self.decrementStart,
             "size+": self.incrementEnd,
             "size-": self.decrementEnd,
             "red": self.keyCancel,
             "green": self.keyGo,
             "yellow": self.changeTimerType,
             "blue": self.changeZapWakeupType
         },
         prio=-2)
     self.list = []
     ConfigListScreen.__init__(self, self.list, session=session)
     self.setTitle(_("Timer Entry"))
     FallbackTimerDirs(self, self.createConfig)
Exemplo n.º 12
0
	def __init__(self, session, menu_path="", screenTitle=_("GUI Skin")):
		self.hackSkin()  # This is a hack to ensure the SkinConverter screen works with the new code.
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		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.skinName = ["SkinSelector"]
		self.rootDir = resolveFilename(SCOPE_SKIN)
		self.config = config.skin.primary_skin
		self.xmlList = ["skin.xml"]
		self.onChangedEntry = []
		self["skins"] = List(enableWrapAround=True)
		self["preview"] = Pixmap()
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["description"] = StaticText(_("Please wait... Loading list..."))
		self["actions"] = HelpableNumberActionMap(self, ["SetupActions", "DirectionActions", "ColorActions"], {
			"ok": (self.save, _("Activate the currently selected skin")),
			"cancel": (self.cancel, _("Revert to the currently active skin")),
			"red": (self.cancel, _("Revert to the currently active skin")),
			"green": (self.save, _("Activate the currently selected skin")),
			"up": (self.up, _("Move to the previous skin")),
			"down": (self.down, _("Move to the next skin")),
			"left": (self.left, _("Move to the previous page")),
			"right": (self.right, _("Move to the next page"))
		}, -1, description=_("Skin Selection Actions"))
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.showPic)
		self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 13
0
	def __init__(self, session, title=_("Virtual KeyBoard Text:"), text="", maxSize=False, visible_width=False, type=Input.TEXT, currPos=0, allMarked=False):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.setTitle(_("Virtual keyboard"))
		prompt = title  # Title should only be used for screen titles!
		self.key_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_bg.png"))
		self.key_sel = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_sel.png"))
		self.key_longl_sel = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longl_sel.png"))
		self.key_longm_sel = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longm_sel.png"))
		self.key_longr_sel = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longr_sel.png"))
		key_longl_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longl_bg.png"))
		key_longm_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longm_bg.png"))
		key_longr_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_longr_bg.png"))
		key_red_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_red.png"))
		key_green_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_green.png"))
		key_yellow_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_yellow.png"))
		key_blue_bg = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_blue.png"))
		key_backspace = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_backspace.png"))
		key_enter = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_enter.png"))
		key_first = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_first.png"))
		key_last = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_last.png"))
		key_left = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_left.png"))
		key_right = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_right.png"))
		key_shift0 = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_shift0.png"))
		key_shift1 = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_shift1.png"))
		key_shift2 = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_shift2.png"))
		key_shift3 = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_shift3.png"))
		# self.key_space = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_space.png"))
		key_space_alt = LoadPixmap(path=resolveFilename(SCOPE_CURRENT_SKIN, "buttons/vkey_space_alt.png"))
		self.key_sel_width = self.key_sel.size().width()
		self.keyBackgrounds = {
			"EXIT": key_red_bg,
			"OK": key_green_bg,
			"ENTER": key_green_bg,
			"LOC": key_yellow_bg,
			"SHFT": key_blue_bg,
			"LongL": key_longl_bg,
			"LongM": key_longm_bg,
			"LongR": key_longr_bg
		}
		self.keyImages = [{
			"BACKSPACE": key_backspace,
			"ENTER": key_enter,
			"FIRST": key_first,
			"LAST": key_last,
			"LEFT": key_left,
			"RIGHT": key_right,
			"SHIFT": key_shift0,
			"SPACE": key_space_alt
		}, {
			"BACKSPACE": key_backspace,
			"ENTER": key_enter,
			"FIRST": key_first,
			"LAST": key_last,
			"LEFT": key_left,
			"RIGHT": key_right,
			"SHIFT": key_shift1,
			"SPACE": key_space_alt
		}, {
			"BACKSPACE": key_backspace,
			"ENTER": key_enter,
			"FIRST": key_first,
			"LAST": key_last,
			"LEFT": key_left,
			"RIGHT": key_right,
			"SHIFT": key_shift2,
			"SPACE": key_space_alt
		}, {
			"BACKSPACE": key_backspace,
			"ENTER": key_enter,
			"FIRST": key_first,
			"LAST": key_last,
			"LEFT": key_left,
			"RIGHT": key_right,
			"SHIFT": key_shift3,
			"SPACE": key_space_alt
		}]
		self.shiftMsgs = [
			_("Lower case"),
			_("Upper case"),
			_("Special 1"),
			_("Special 2")
		]
		self.english = [
			[
				[u"`", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"-", u"=", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"[", u"]", u"\\"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u";", u"'", u"", u"ENTER"],
				[u"SHIFT", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", u".", u"/", u"", u"", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			], [
				[u"~", u"!", u"@", u"#", u"$", u"%", u"^", u"&", u"*", u"(", u")", u"_", u"+", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"{", u"}", u"|"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u":", u"\"", u"", u"ENTER"],
				[u"SHIFT", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u"<", u">", u"?", u"", u"", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			]
		]
		self.english_EN_US = [
			[
				[u"`", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"-", u"=", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"[", u"]", u"\\"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u";", u"'", u"LongL__ENTER__HIDE", u"LongR__Enter"],
				[u"LongL__Shift", u"LongR__SHIFT__HIDE", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", u".", u"/", u"LongL__SHIFT__HIDE", u"LongR__Shift"],
				[u"LongL__Esc", u"LongR__ESC__HIDE", u"Loc", u"All", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"LEFT", u"RIGHT", u"LongL__CLR__HIDE", u"LongR__Clr"]
			], [
				[u"~", u"!", u"@", u"#", u"$", u"%", u"^", u"&", u"*", u"(", u")", u"_", u"+", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"{", u"}", u"|"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u":", u"\"", u"LongL__ENTER__HIDE", u"LongR__Enter"],
				[u"LongL__Shift", u"LongR__SHIFT__HIDE", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u"<", u">", u"?", u"LongL__SHIFT__HIDE", u"LongR__Shift"],
				[u"LongL__Esc", u"LongR__ESC__HIDE", u"Loc", u"All", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"LEFT", u"RIGHT", u"LongL__CLR__HIDE", u"LongR__Clr"]
			]
		]
		self.french = [
			[
				[u"\u00B2", u"&", u"\u00E9", u"\"", u"'", u"(", u"-", u"\u00E8", u"_", u"\u00E7", u"\u00E0", u")", u"=", u"BACKSPACE"],
				[u"FIRST", u"a", u"z", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"$", u"[", u"]"],
				[u"LAST", u"q", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"m", u"\u00F9", u"*", u"ENTER"],
				[u"SHIFT", u"<", u"w", u"x", u"c", u"v", u"b", u"n", u",", u";", u":", u"!", u"\u20AC", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"#", u"@", u"`"]
			], [
				[u"", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"\u00B0", u"+", u"BACKSPACE"],
				[u"FIRST", u"A", u"Z", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"\u00A3", u"{", u"}"],
				[u"LAST", u"Q", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"M", u"%", u"\u00B5", u"ENTER"],
				[u"SHIFT", u">", u"W", u"X", u"C", u"V", u"B", u"N", u"?", u".", u"/", u"\u00A7", u"\u00A6", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"~", u"^", u"\\"]
			], [
				[u"", u"", u"\u00E2", u"\u00EA", u"\u00EE", u"\u00F4", u"\u00FB", u"\u00E4", u"\u00EB", u"\u00EF", u"\u00F6", u"\u00FC", u"", u"BACKSPACE"],
				[u"FIRST", u"", u"\u00E0", u"\u00E8", u"\u00EC", u"\u00F2", u"\u00F9", u"\u00E1", u"\u00E9", u"\u00ED", u"\u00F3", u"\u00FA", u"", u""],
				[u"LAST", u"", u"\u00C2", u"\u00CA", u"\u00CE", u"\u00D4", u"\u00DB", u"\u00C4", u"\u00CB", u"\u00CF", u"\u00D6", u"\u00DC", u"", u"ENTER"],
				[u"SHIFT", u"", u"\u00C0", u"\u00C8", u"\u00CC", u"\u00D2", u"\u00D9", u"\u00C1", u"\u00C9", u"\u00CD", u"\u00D3", u"\u00DA", u"", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			]
		]
		self.german = [
			[
				[u"", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"\u00DF", u"'", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"\u00FC", u"[", u"]"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"\u00F6", u"\u00E4", u"+", U"ENTER"],
				[u"SHIFT", u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"#", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"|", u"\\", u"\u00B5"]
			], [
				[u"\u00B0", u"!", u"\"", u"\u00A7", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"?", u"`", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"\u00DC", u"{", u"}"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"\u00D6", u"\u00C4", u"*", U"ENTER"],
				[u"SHIFT", u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"@", U"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"\u20AC", u"\u00B2", u"\u00B3"]
			]
		]
		self.latvian = [
			[
				[u"`", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"-", u"=", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"[", u"]", u"\\"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u";", u"'", u"LongL__ENTER__HIDE", u"LongR__Enter"],
				[u"LongL__Shift", u"LongR__SHIFT__HIDE", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", u".", u"/", u"LongL__SHIFT__HIDE", u"LongR__Shift"],
				[u"LongL__Esc", u"LongR__ESC__HIDE", u"Loc", u"All", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"LEFT", u"RIGHT", u"LongL__CLR__HIDE", u"LongR__Clr"]
			], [
				[u"~", u"!", u"@", u"#", u"$", u"%", u"^", u"&", u"*", u"(", u")", u"_", u"+", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"{", u"}", u"|"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u":", u"\"", u"LongL__ENTER__HIDE", u"LongR__Enter"],
				[u"LongL__Shift", u"LongR__SHIFT__HIDE", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u"<", u">", u"?", u"LongL__SHIFT__HIDE", u"LongR__Shift"],
				[u"LongL__Esc", u"LongR__ESC__HIDE", u"Loc", u"All", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"LEFT", u"RIGHT", u"LongL__CLR__HIDE", u"LongR__Clr"]
			], [
				[u"\u00b4", u"\u00b9", u"\u00b2", u"\u00b3", u"\u20ac", u"\u00bd", u"\u00be", u"\u007b", u"\u005b", u"\u005d", u"\u007d ", u"\u005c", u"\u2013", u"BACKSPACE"],
				[u"FIRST", u"q", u"\u0113", u"\u0112", u"\u0157", u"\u0156", u"\u016B", u"\u016A", u"\u012B", u"\u012A", u"\u014D", u"\u014C", u"\u00ab", u"\u00bb"],
				[u"LAST", u"\u0101", u"\u0100", u"\u0161", u"\u0160", u"\u0123", u"\u0122", u"\u0137", u"\u0136", u"\u013C", u"\u013B", u"\u003b", u"LongL__ENTER__HIDE", u"LongR__Enter"],
				[u"LongL__Shift", u"LongR__SHIFT__HIDE", u"\u017E", u"\u017D", u"\u010D", u"\u010C", u"b", u"\u0146", u"\u0145", u"\u0060", u"\u00b7", u"\u002f", u"LongL__SHIFT__HIDE", u"LongR__Shift"],
				[u"LongL__Esc", u"LongR__ESC__HIDE", u"Loc", u"All", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"LEFT", u"RIGHT", u"LongL__CLR__HIDE", u"LongR__Clr"]
			]
		]
		self.russian = [
			[
				[u"\u0451", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"-", u"=", u"BACKSPACE"],
				[u"FIRST", u"\u0439", u"\u0446", u"\u0443", u"\u043A", u"\u0435", u"\u043D", u"\u0433", u"\u0448", u"\u0449", u"\u0437", u"\u0445", u"\u044A", u"\u00A7"],
				[u"LAST", u"\u0444", u"\u044B", u"\u0432", u"\u0430", u"\u043F", u"\u0440", u"\u043E", u"\u043B", u"\u0434", u"\u0436", u"\u044D", u"\\", u"ENTER"],
				[u"SHIFT", u"\u044F", u"\u0447", u"\u0441", u"\u043C", u"\u0438", u"\u0442", u"\u044C", u"\u0431", u"\u044E", u".", u"@", u"&", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"<"]
			], [
				[u"\u0401", u"!", u"\"", u"\u2116", u";", u"%", u":", u"?", u"*", u"(", u")", u"_", u"+", u"BACKSPACE"],
				[u"FIRST", u"\u0419", u"\u0426", u"\u0423", u"\u041A", u"\u0415", u"\u041D", u"\u0413", u"\u0428", u"\u0429", u"\u0417", u"\u0425", u"\u042A", u"\u20BD"],
				[u"LAST", u"\u0424", u"\u042B", u"\u0412", u"\u0410", u"\u041F", u"\u0420", u"\u041E", u"\u041B", u"\u0414", u"\u0416", u"\u042D", u"/", u"ENTER"],
				[u"SHIFT", u"\u042F", u"\u0427", u"\u0421", u"\u041C", u"\u0418", u"\u0422", u"\u042C", u"\u0411", u"\u042E", u",", u"#", u"$", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u">"]
			]
		]
		self.scandinavian = [
			[
				[u"\u00A7", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"+", u"@", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"\u00E5", u"[", u"]"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"\u00F6", u"\u00E4", u"'", u"ENTER"],
				[u"SHIFT", u"<", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"\u00AB", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			], [
				[u"\u00BD", u"!", u"\"", u"#", u"\u00A4", u"%", u"&", u"/", u"(", u")", u"=", u"?", u"|", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"\u00C5", u"{", u"}"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"\u00D6", u"\u00C4", u"*", u"ENTER"],
				[u"SHIFT", u">", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"\u00BB", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			], [
				[u"", u"\u00E2", u"\u00EA", u"\u00EE", u"\u00F4", u"\u00FB", u"\u00E4", u"\u00EB", u"\u00EF", u"\u00F6", u"\u00FC", u"\u00E3", u"\u00F5", u"BACKSPACE"],
				[u"FIRST", u"\u00E0", u"\u00E8", u"\u00EC", u"\u00F2", u"\u00F9", u"\u00E1", u"\u00E9", u"\u00ED", u"\u00F3", u"\u00FA", u"", u"", u""],
				[u"LAST", u"\u00C2", u"\u00CA", u"\u00CE", u"\u00D4", u"\u00DB", u"\u00C4", u"\u00CB", u"\u00CF", u"\u00D6", u"\u00DC", u"\u00C3", u"\u00D5", u"ENTER"],
				[u"SHIFT", u"\u00C0", u"\u00C8", u"\u00CC", u"\u00D2", u"\u00D9", u"\u00C1", u"\u00C9", u"\u00CD", u"\u00D3", u"\u00DA", u"", u"", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
			]
		]
		self.spanish = [
			[
				[u"\\", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"'", u"\u00A1", u"BACKSPACE"],
				[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"@", u"+", u"\u00E7"],
				[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"\u00F1", u"[", u"]", u"ENTER"],
				[u"SHIFT", u"<", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"\u20AC", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"", u"\u00E1", u"\u00E9", u"\u00ED", u"\u00F3", u"\u00FA", u"\u00FC"]
			], [
				[u"|", u"!", u"\"", u"\u00B7", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"?", u"\u00BF", u"BACKSPACE"],
				[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"#", u"*", u"\u00C7"],
				[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"\u00D1", u"{", u"}", u"ENTER"],
				[u"SHIFT", u">", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"\u00AC", u"SHIFT"],
				[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"", u"\u00C1", u"\u00C9", u"\u00CD", u"\u00D3", u"\u00DA", u"\u00DC"]
			]
		]
		self.locales = {
			"ar_BH": [_("Arabic"), _("Bahrain"), self.arabic(self.english)],
			"ar_EG": [_("Arabic"), _("Egypt"), self.arabic(self.english)],
			"ar_JO": [_("Arabic"), _("Jordan"), self.arabic(self.english)],
			"ar_KW": [_("Arabic"), _("Kuwait"), self.arabic(self.english)],
			"ar_LB": [_("Arabic"), _("Lebanon"), self.arabic(self.english)],
			"ar_OM": [_("Arabic"), _("Oman"), self.arabic(self.english)],
			"ar_QA": [_("Arabic"), _("Qatar"), self.arabic(self.english)],
			"ar_SA": [_("Arabic"), _("Saudi Arabia"), self.arabic(self.english)],
			"ar_SY": [_("Arabic"), _("Syrian Arab Republic"), self.arabic(self.english)],
			"ar_AE": [_("Arabic"), _("United Arab Emirates"), self.arabic(self.english)],
			"ar_YE": [_("Arabic"), _("Yemen"), self.arabic(self.english)],
			"cs_CZ": [_("Czech"), _("Czechia"), [
				[
					[u";", u"+", u"\u011B", u"\u0161", u"\u010D", u"\u0159", u"\u017E", u"\u00FD", u"\u00E1", u"\u00ED", u"\u00E9", u"=", u"", u"BACKSPACE"],
					[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"\u00FA", u")", u""],
					[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"\u016F", u"\u00A7", u"", u"ENTER"],
					[u"SHIFT", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"\u0148", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"ALL", u"CLR", u"DEL"]
				], [
					[u".", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"%", u"", u"BACKSPACE"],
					[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"/", u"(", u""],
					[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"\"", u"!", u"'", u"ENTER"],
					[u"SHIFT", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u"?", u":", u"_", u"\u0147", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"ALL", u"CLR", u"DEL"]
				], [
					[u"", u"~", u"\u011A", u"\u0160", u"\u010C", u"\u0158", u"\u017D", u"\u00DD", u"\u00C1", u"\u00CD", u"\u00C9", u"`", u"", u"BACKSPACE"],
					[u"FIRST", u"\\", u"|", u"\u20AC", u"\u0165", u"\u0164", u"", u"", u"", u"\u00F3", u"\u00D3", u"\u00DA", u"\u00F7", u"\u00D7"],
					[u"LAST", u"", u"\u0111", u"\u00D0", u"[", u"]", u"\u010F", u"\u010E", u"\u0142", u"\u0141", u"\u016E", u"$", u"\u00DF", u"ENTER"],
					[u"SHIFT", u"", u"#", u"&", u"@", u"{", u"}", u"", u"<", u">", u"*", u"", u"\u00A4", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"LongL__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongM__SPACE__HIDE", u"LongR__SPACE__HIDE", u"ALL", u"CLR", u"DEL"]
				]
			]],
			"nl_NL": [_("Dutch"), _("Netherlands"), self.dutch(self.english)],
			"en_AU": [_("English"), _("Australian"), self.australian(self.english)],
			"en_GB": [_("English"), _("United Kingdom"), self.unitedKingdom(self.english)],
			"en_US": [_("English"), _("United States"), self.english_EN_US],
			"en_EN": [_("English"), _("Various"), self.english_EN_US],
			"et_EE": [_("Estonian"), _("Estonia"), self.estonian(self.scandinavian)],
			"fi_FI": [_("Finnish"), _("Finland"), self.finnish(self.scandinavian)],
			"fr_BE": [_("French"), _("Belgian"), self.belgian(self.french)],
			"fr_FR": [_("French"), _("France"), self.french],
			"de_CH": [_("German"), _("Switzerland"), self.swiss(self.german)],
			"de_DE": [_("German"), _("Germany"), self.german],
			"el_GR": [_("Greek (Modern)"), _("Greece"), [
				[
					[u"`", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"-", u"=", u"BACKSPACE"],
					[u"FIRST", u";", u"\u03C2", u"\u03B5", u"\u03C1", u"\u03C4", u"\u03C5", u"\u03B8", u"\u03B9", u"\u03BF", u"\u03C0", u"[", u"]", u"/"],
					[u"LAST", u"\u03B1", u"\u03C3", u"\u03B4", u"\u03C6", u"\u03B3", u"\u03B7", u"\u03BE", u"\u03BA", u"\u03BB", u"", u"'", u"\\", u"ENTER"],
					[u"SHIFT", u"<", u"\u03B6", u"\u03C7", u"\u03C8", u"\u03C9", u"\u03B2", u"\u03BD", u"\u03BC", u",", ".", u"\u03CA", u"\u03CB", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"\u03AC", u"\u03AD", u"\u03AE", u"\u03AF", u"\u03CC", u"\u03CD", u"\u03CE"]
				], [
					[u"~", u"!", u"@", u"#", u"$", u"%", u"^", u"&", u"*", u"(", u")", u"_", u"+", u"BACKSPACE"],
					[u"FIRST", u":", u"", u"\u0395", u"\u03A1", u"\u03A4", u"\u03A5", u"\u0398", u"\u0399", u"\u039F", u"\u03A0", u"{", u"}", u"?"],
					[u"LAST", u"\u0391", u"\u03A3", u"\u0394", u"\u03A6", u"\u0393", u"\u0397", u"\u039E", u"\u039A", u"\u039B", u"", u"\"", u"|", u"ENTER"],
					[u"SHIFT", u">", u"\u0396", u"\u03A7", u"\u03A8", u"\u03A9", u"\u0392", u"\u039D", u"\u039C", u"<", u">", u"\u03AA", u"\u03AB", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"\u0386", u"\u0388", u"\u0389", u"\u038A", u"\u038C", u"\u038E", u"\u038F"]
				], [
					[u"", u"", u"\u00B2", u"\u00B3", u"\u00A3", u"\u00A7", u"\u00B6", u"\u20AC", u"\u00A4", u"\u00A6", u"\u00B0", u"\u00B1", u"\u00BD", u"BACKSPACE"],
					[u"FIRST", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u""],
					[u"LAST", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"ENTER"],
					[u"SHIFT", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
				]
			]],
			"lv_LV": [_("Latvian"), _("Latvia"), self.latvian],
			"lt_LT": [_("Lithuanian"), _("Lithuania"), self.lithuanian(self.english)],
			"nb_NO": [_("Norwegian"), _("Norway"), self.norwegian(self.scandinavian)],
			"fa_IR": [_("Persian"), _("Iran, Islamic Republic"), self.persian(self.english)],
			"pl_PL": [_("Polish"), _("Poland"), self.polish(self.english)],
			"ru_RU": [_("Russian"), _("Russian Federation"), self.russian],
			"sk_SK": [_("Slovak"), _("Slovakia"), [
				[
					[u"~", u"!", u"@", u"#", u"$", u"%", u"^", u"&", u"*", u"(", u")", u"\u00E1", u"\u00E4", u"BACKSPACE"],
					[u"FIRST", u"q", u"w", u"e", u"r", u"t", u"y", u"u", u"i", u"o", u"p", u"\u010D", u"\u010F", u"\u00E9"],
					[u"LAST", u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"\u00ED", u"\u013A", u"\u013E", u"ENTER"],
					[u"SHIFT", u"<", u"z", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"\u0148", u"\u00F3", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"\u00F4", u"\u0155", u"\u0161", u"\u0165", u"\u00FA", u"\u00FD", u"\u017E"]
				], [
					[u"`", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"\u00C1", u"\u00C4", u"BACKSPACE"],
					[u"FIRST", u"Q", u"W", u"E", u"R", u"T", u"Y", u"U", u"I", u"O", u"P", u"\u010C", u"\u010E", u"\u00C9"],
					[u"LAST", u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"\u00CD", u"\u0139", u"\u013D", u"ENTER"],
					[u"SHIFT", u">", u"Z", u"X", u"C", u"V", u"B", u"N", u"M", u"?", u":", u"\u0147", u"\u00D3", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE", u"\u00D4", u"\u0154", u"\u0160", u"\u0164", u"\u00DA", u"\u00DD", u"\u017D"]
				], [
					[u"", u"", u"\u00A7", u"\u00B0", u"\u00A4", u"\u20AC", u"\u00DF", u"\u0111", u"\u0110", u"\u0142", u"\u0141", u"", u"", u"BACKSPACE"],
					[u"FIRST", u"", u"", u"'", u"\"", u"+", u"-", u"\u00D7", u"\u00F7", u"=", u"_", u"~", u"", u""],
					[u"LAST", u"", u"", u"/", u"\\", u";", u"[", u"]", u"{", u"}", u"|", u"", u"", u"ENTER"],
					[u"SHIFT", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
				]
			]],
			"es_ES": [_("Spanish"), _("Spain"), self.spanish],
			"sv_SE": [_("Swedish"), _("Sweden"), self.swedish(self.scandinavian)],
			"th_TH": [_("Thai"), _("Thailand"), [
				[
					[u"", u"", u"\u0E45", u"\u0E20", u"\u0E16", u"\u0E38", u"\u0E36", u"\u0E04", u"\u0E15", u"\u0E08", u"\u0E02", u"\u0E0A", u"", u"BACKSPACE"],
					[u"FIRST", u"\u0E46", u"\u0E44", u"\u0E33", u"\u0E1E", u"\u0E30", u"\u0E31", u"\u0E35", u"\u0E23", u"\u0E19", u"\u0E22", u"\u0E1A", u"\u0E25", u""],
					[u"LAST", u"\u0E1F", u"\u0E2B", u"\u0E01", u"\u0E14", u"\u0E40", u"\u0E49", u"\u0E48", u"\u0E32", u"\u0E2A", u"\u0E27", u"\u0E07", u"\u0E03", u"OK"],
					[u"SHIFT", u"\u0E1C", u"\u0E1B", u"\u0E41", u"\u0E2D", u"\u0E34", u"\u0E37", u"\u0E17", u"\u0E21", u"\u0E43", u"\u0E1D", u"", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
				], [
					[u"", u"", u"\u0E51", u"\u0E52", u"\u0E53", u"\u0E54", u"\u0E39", u"\u0E55", u"\u0E56", u"\u0E57", u"\u0E58", u"\u0E59", u"", u"BACKSPACE"],
					[u"FIRST", u"\u0E50", u"", u"\u0E0E", u"\u0E11", u"\u0E18", u"\u0E4D", u"\u0E4A", u"\u0E13", u"\u0E2F", u"\u0E0D", u"\u0E10", u"\u0E05", u""],
					[u"LAST", u"\u0E24", u"\u0E06", u"\u0E0F", u"\u0E42", u"\u0E0C", u"\u0E47", u"\u0E4B", u"\u0E29", u"\u0E28", u"\u0E0B", u"", u"\u0E3F", u"OK"],
					[u"SHIFT", u"", u"", u"\u0E09", u"\u0E2E", u"\u0E3A", u"\u0E4C", u"", u"\u0E12", u"\u0E2C", u"\u0E26", u"", u"", u"SHIFT"],
					[u"EXIT", u"LOC", u"LEFT", u"RIGHT", u"ALL", u"CLR", u"SPACE"]
				]
			]],
			"uk_UA": [_("Ukrainian"), _("Ukraine"), self.ukranian(self.russian)]
		}

		self["actions"] = HelpableNumberActionMap(self, "VirtualKeyBoardActions", {
			"cancel": (self.cancel, _("Cancel any text changes and exit")),
			"save": (self.enter, _("Enter text and exit")),
			"locale": (self.localeMenu, _("Select the virtual keyboard locale from a menu")),
			"shift": (self.shiftClicked, _("Select the virtual keyboard shifted character set")),
			"select": (self.processSelect, _("Select the character or action under the virtual keyboard cursor")),
			"up": (self.up, _("Move the virtual keyboard cursor up")),
			"left": (self.left, _("Move the virtual keyboard cursor left")),
			"right": (self.right, _("Move the virtual keyboard cursor right")),
			"down": (self.down, _("Move the virtual keyboard cursor down")),
			"first": (self.cursorFirst, _("Move the text buffer cursor to the first character")),
			"prev": (self.cursorLeft, _("Move the text buffer cursor left")),
			"next": (self.cursorRight, _("Move the text buffer cursor right")),
			"last": (self.cursorLast, _("Move the text buffer cursor to the last character")),
			"toggleOverwrite": (self.keyToggleOW, _("Toggle new text inserts before or overwrites existing text")),
			"backspace": (self.backClicked, _("Delete the character to the left of text buffer cursor")),
			"delete": (self.forwardClicked, _("Delete the character under the text buffer cursor")),
			"1": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"2": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"3": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"4": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"5": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"6": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"7": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"8": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"9": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"0": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"gotAsciiCode": (self.keyGotAscii, _("Keyboard data entry"))
		}, -2, description=_("Virtual KeyBoard Functions"))

		self.lang = language.getLanguage()
		self["prompt"] = Label(prompt)
		self["text"] = Input(text=text, maxSize=maxSize, visible_width=visible_width, type=type, currPos=len(text.decode("utf-8", "ignore")), allMarked=allMarked)
		self["list"] = VirtualKeyBoardList([])
		self["mode"] = Label(_("INS"))
		self["locale"] = Label(_("Locale") + ": " + self.lang)
		self["language"] = Label(_("Language") + ": " + self.lang)
		self["key_info"] = StaticText(_("INFO"))
		self["key_red"] = StaticText(_("Exit"))
		self["key_green"] = StaticText(_("Enter"))
		self["key_yellow"] = StaticText(_("Select locale"))
		self["key_blue"] = StaticText(self.shiftMsgs[1])
		self["key_help"] = StaticText(_("HELP"))

		width, self.height = skin.parameters.get("VirtualKeyBoard", (45, 45))
		self.width = self.key_bg and self.key_bg.size().width() or width
		self.shiftColors = skin.parameters.get("VirtualKeyBoardShiftColors", (0x00ffffff, 0x00ffffff, 0x0000ffff, 0x00ff00ff))  # Ensure there is a color for each shift level!
		self.language = None
		self.location = None
		self.keyList = []
		self.previousSelectedKey = []
		self.shiftLevels = 0
		self.shiftLevel = 0
		self.keyboardWidth = 0
		self.keyboardHeight = 0
		self.maxKey = 0
		self.overwrite = False
		self.selectedKey = None
		self.sms = NumericalTextInput(self.smsGotChar)
		self.smsChar = None
		self.setLocale()
		self.onExecBegin.append(self.setKeyboardModeAscii)
		self.onLayoutFinish.append(self.buildVirtualKeyBoard)
Exemplo n.º 14
0
 def __init__(self,
              session,
              text=None,
              list=None,
              keys=None,
              selection=0,
              skinName=None,
              windowTitle=None,
              title=None,
              skin_name=None):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     if title is not None:  # Process legacy title argument.
         text = title
     if text is None:
         text = ""
     self.text = text
     self["text"] = Label(text)
     if list is None:
         list = []
     if keys is None:
         keys = [
             "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red",
             "green", "yellow", "blue"
         ]
     self.inputKeys = keys + (len(list) - len(keys)) * ["dummy"]
     pos = 0
     self.list = []
     self.keyMap = {}
     for item in list:
         if item:
             self.list.append(
                 ChoiceEntryComponent(key=str(self.inputKeys[pos]),
                                      text=item))
             if self.inputKeys[pos] != "":
                 self.keyMap[self.inputKeys[pos]] = list[pos]
             pos += 1
     self["list"] = ChoiceList(list=self.list, selection=selection)
     if skin_name is not None:  # Process legacy skin_name argument.
         skinName = skin_name
     self.skinName = ["ChoiceBox"]
     if skinName:
         if isinstance(skinName, str):
             self.skinName.insert(0, skinName)
         else:
             self.skinName = skinName + self.skinName
     self["actions"] = HelpableNumberActionMap(
         self,
         [
             "ChoiceBoxActions", "NumberActions", "ColorActions",
             "NavigationActions"
         ],
         {
             "cancel":
             (self.keyCancel, _("Cancel the action selection and exit")),
             "select":
             (self.keySelect, _("Run the currently highlighted action")),
             "1": (self.keyNumberGlobal, _("Run the numbered action")),
             "2": (self.keyNumberGlobal, _("Run the numbered action")),
             "3": (self.keyNumberGlobal, _("Run the numbered action")),
             "4": (self.keyNumberGlobal, _("Run the numbered action")),
             "5": (self.keyNumberGlobal, _("Run the numbered action")),
             "6": (self.keyNumberGlobal, _("Run the numbered action")),
             "7": (self.keyNumberGlobal, _("Run the numbered action")),
             "8": (self.keyNumberGlobal, _("Run the numbered action")),
             "9": (self.keyNumberGlobal, _("Run the numbered action")),
             "0": (self.keyNumberGlobal, _("Run the numbered action")),
             "red": (self.keyRed, _("Run the RED action")),
             "green": (self.keyGreen, _("Run the GREEN action")),
             "yellow": (self.keyYellow, _("Run the YELLOW action")),
             "blue": (self.keyBlue, _("Run the BLUE action")),
             "top": (self.top, _("Move to first line")),
             "pageUp": (self.pageUp, _("Move up a page")),
             "up": (self.up, _("Move up a line")),
             # "first": (self.top, _("Move to first line")),
             # "left": (self.pageUp, _("Move up a page")),
             # "right": (self.pageDown, _("Move down a page")),
             # "last": (self.bottom, _("Move to last line")),
             "down": (self.down, _("Move down a line")),
             "pageDown": (self.pageDown, _("Move down a page")),
             "bottom": (self.bottom, _("Move to last line"))
         },
         prio=-2,
         description=_("Choice Box Actions"))
     self.setTitle(windowTitle or _("Select"))
     self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 15
0
    def __init__(self, session, parent):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        self.parentMenu = parent
        self.menuList = []
        self["menu"] = List(self.menuList)
        self["menu"].enableWrapAround = True
        self["menu"].onSelectionChanged.append(self.selectionChanged)
        self.showNumericHelp = False
        self["green"] = Label()
        self["yellow"] = Label()
        self["blue"] = Label()
        self.sort_mode = False
        self.selected_entry = None
        self.sub_menu_sort = None
        self.createMenuList()
        ProtectedScreen.__init__(self)
        # for the skin: first try a menu_<menuID>, then Menu
        self.skinName = []
        if self.menuID is not None:
            if config.usage.menutype.value == "horzanim" and findSkinScreen(
                    "Animmain"):
                self.skinName.append("Animmain")
            elif config.usage.menutype.value == "horzicon" and findSkinScreen(
                    "Iconmain"):
                self.skinName.append("Iconmain")
            else:
                self.skinName.append("menu_" + self.menuID)
        self.skinName.append("Menu")

        if config.usage.menu_sort_mode.value == "user":

            self["MoveActions"] = ActionMap(
                ["WizardActions"], {
                    "left": self.keyLeft,
                    "right": self.keyRight,
                    "up": self.keyUp,
                    "down": self.keyDown,
                }, -1)
            self["EditActions"] = ActionMap(
                ["ColorActions"], {
                    "green": self.keyGreen,
                    "yellow": self.keyYellow,
                    "blue": self.keyBlue,
                })

        self["menuActions"] = HelpableNumberActionMap(
            self, ["OkCancelActions", "NumberActions", "MenuActions"], {
                "ok": (self.okbuttonClick, _("Select the current menu item")),
                "cancel": (self.closeNonRecursive, _("Exit menu")),
                "close": (self.closeRecursive, _("Exit all menus")),
                "menu": (self.closeRecursive, _("Exit all menus")),
                "1": (self.keyNumberGlobal, _("Direct menu item selection")),
                "2": (self.keyNumberGlobal, _("Direct menu item selection")),
                "3": (self.keyNumberGlobal, _("Direct menu item selection")),
                "4": (self.keyNumberGlobal, _("Direct menu item selection")),
                "5": (self.keyNumberGlobal, _("Direct menu item selection")),
                "6": (self.keyNumberGlobal, _("Direct menu item selection")),
                "7": (self.keyNumberGlobal, _("Direct menu item selection")),
                "8": (self.keyNumberGlobal, _("Direct menu item selection")),
                "9": (self.keyNumberGlobal, _("Direct menu item selection")),
                "0": (self.keyNumberGlobal, _("Direct menu item selection"))
            },
            prio=0,
            description=_("Common Menu Actions"))
        title = parent.get("title", "").encode("UTF-8") if PY2 else parent.get(
            "title", "") or None
        title = title and _(title)
        if title is None:
            title = _(parent.get("text", "").encode(
                "UTF-8", "ignore")) if PY2 else _(parent.get("text", ""))
        else:
            t_history.reset()
        self["title"] = StaticText(title)
        self.setTitle(title)
        self.menu_title = title
        self["thistory"] = StaticText(t_history.thistory)
        history_len = len(t_history.thistory)
        self["title0"] = StaticText("")
        self["title1"] = StaticText("")
        self["title2"] = StaticText("")
        if history_len < 13:
            self["title0"] = StaticText(title)
        elif history_len < 21:
            self["title0"] = StaticText("")
            self["title1"] = StaticText(title)
        else:
            self["title0"] = StaticText("")
            self["title1"] = StaticText("")
            self["title2"] = StaticText(title)
        if t_history.thistory == "":
            t_history.thistory = str(title) + " > "
        else:
            t_history.thistory = t_history.thistory + str(title) + " > "
        if config.usage.menutype.value == "horzanim" and findSkinScreen(
                "Animmain"):
            self["label1"] = StaticText()
            self["label2"] = StaticText()
            self["label3"] = StaticText()
            self["label4"] = StaticText()
            self["label5"] = StaticText()
            self.onShown.append(self.openTestA)
        elif config.usage.menutype.value == "horzicon" and findSkinScreen(
                "Iconmain"):
            self["label1"] = StaticText()
            self["label2"] = StaticText()
            self["label3"] = StaticText()
            self["label4"] = StaticText()
            self["label5"] = StaticText()
            self["label6"] = StaticText()
            self["label1s"] = StaticText()
            self["label2s"] = StaticText()
            self["label3s"] = StaticText()
            self["label4s"] = StaticText()
            self["label5s"] = StaticText()
            self["label6s"] = StaticText()
            self["pointer"] = Pixmap()
            self["pixmap1"] = Pixmap()
            self["pixmap2"] = Pixmap()
            self["pixmap3"] = Pixmap()
            self["pixmap4"] = Pixmap()
            self["pixmap5"] = Pixmap()
            self["pixmap6"] = Pixmap()
            self.onShown.append(self.openTestB)
        self.number = 0
        self.nextNumberTimer = eTimer()
        self.nextNumberTimer.callback.append(self.okbuttonClick)
        if len(self.menuList) == 1:
            self.onExecBegin.append(self.__onExecBegin)
        self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 16
0
 def __init__(self, list, session=None, on_change=None, fullUI=False):
     self.entryChanged = on_change if on_change is not None else lambda: None
     if fullUI:
         if "key_red" not in self:
             self["key_red"] = StaticText(_("Cancel"))
         if "key_green" not in self:
             self["key_green"] = StaticText(_("Save"))
         self["fullUIActions"] = HelpableActionMap(
             self, ["ConfigListActions"], {
                 "cancel": (self.keyCancel,
                            _("Cancel any changed settings and exit")),
                 "close":
                 (self.closeRecursive,
                  _("Cancel any changed settings and exit all menus")),
                 "save":
                 (self.keySave, _("Save all changed settings and exit"))
             },
             prio=1,
             description=_("Common Setup Actions"))
     if "key_menu" not in self:
         self["key_menu"] = StaticText(_("MENU"))
     if "key_text" not in self:
         self["key_text"] = StaticText(_("TEXT"))
     if "VKeyIcon" not in self:
         self["VKeyIcon"] = Boolean(False)
     if "HelpWindow" not in self:
         self["HelpWindow"] = Pixmap()
         self["HelpWindow"].hide()
     self["configActions"] = HelpableActionMap(
         self, ["ConfigListActions"], {
             "select":
             (self.keySelect,
              _("Select, toggle, process or edit the current entry"))
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["navigationActions"] = HelpableActionMap(
         self, ["NavigationActions"], {
             "top": (self.keyTop, _("Move to first line / screen")),
             "pageUp": (self.keyPageUp, _("Move up a screen")),
             "up": (self.keyUp, _("Move up a line")),
             "first":
             (self.keyFirst,
              _("Jump to first item in list or the start of text")),
             "left":
             (self.keyLeft,
              _("Select the previous item in list or move cursor left")),
             "right":
             (self.keyRight,
              _("Select the next item in list or move cursor right")),
             "last": (self.keyLast,
                      _("Jump to last item in list or the end of text")),
             "down": (self.keyDown, _("Move down a line")),
             "pageDown": (self.keyPageDown, _("Move down a screen")),
             "bottom": (self.keyBottom, _("Move to last line / screen"))
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["menuConfigActions"] = HelpableActionMap(
         self,
         "ConfigListActions", {
             "menu": (self.keyMenu,
                      _("Display selection list as a selection menu")),
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["menuConfigActions"].setEnabled(False if fullUI else True)
     self["charConfigActions"] = HelpableNumberActionMap(
         self, ["NumberActions", "InputAsciiActions"], {
             "1":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "2":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "3":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "4":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "5":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "6":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "7":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "8":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "9":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "0":
             (self.keyNumberGlobal, _("Number or SMS style data entry")),
             "gotAsciiCode": (self.keyGotAscii, _("Keyboard data entry"))
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["charConfigActions"].setEnabled(False if fullUI else True)
     self["editConfigActions"] = HelpableNumberActionMap(
         self, ["TextEditActions"], {
             "backspace":
             (self.keyBackspace,
              _("Delete character to left of cursor or select AM times")),
             "delete":
             (self.keyDelete,
              _("Delete character under cursor or select PM times")),
             "erase": (self.keyErase, _("Delete all the text")),
             "toggleOverwrite":
             (self.keyToggle,
              _("Toggle new text inserts before or overwrites existing text"
                )),
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["editConfigActions"].setEnabled(False if fullUI else True)
     self["virtualKeyBoardActions"] = HelpableActionMap(
         self,
         "VirtualKeyboardActions", {
             "showVirtualKeyboard":
             (self.keyText,
              _("Display the virtual keyboard for data entry"))
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["virtualKeyBoardActions"].setEnabled(False)
     # Temporary support for legacy code and plugins that hasn't yet been updated (next 4 lines).
     # All code should be updated to allow a better UI experience for users.  This patch code
     # forces course control over the edit buttons instead of individual button control that is
     # now available.
     self["config_actions"] = DummyActions()
     self["config_actions"].setEnabled = self.dummyConfigActions
     self["VirtualKB"] = DummyActions()
     self["VirtualKB"].setEnabled = self.dummyVKBActions
     self["config"] = ConfigList(list, session=session)
     self.setCancelMessage(None)
     self.setRestartMessage(None)
     self.onChangedEntry = []
     self.onExecBegin.append(self.showHelpWindow)
     self.onExecEnd.append(self.hideHelpWindow)
     self.onLayoutFinish.append(
         self.noNativeKeys)  # self.layoutFinished is already in use!
     self["config"].onSelectionChanged.append(self.handleInputHelpers)
Exemplo n.º 17
0
    def __init__(self,
                 session,
                 text="",
                 filename="",
                 currDir=None,
                 bookmarks=None,
                 userMode=False,
                 windowTitle=_("Select Location"),
                 minFree=None,
                 autoAdd=False,
                 editDir=False,
                 inhibitDirs=None,
                 inhibitMounts=None):
        # Init parents
        if not inhibitDirs:
            inhibitDirs = []
        if not inhibitMounts:
            inhibitMounts = []
        Screen.__init__(self, session)
        NumericalTextInput.__init__(self, handleTimeout=False)
        HelpableScreen.__init__(self)

        # Set useable chars
        self.setUseableChars(u'1234567890abcdefghijklmnopqrstuvwxyz')

        # Quickselect Timer
        self.qs_timer = eTimer()
        self.qs_timer.callback.append(self.timeout)
        self.qs_timer_type = 0

        # Initialize Quickselect
        self.curr_pos = -1
        self.quickselect = ""

        # Set Text
        self["text"] = Label(text)
        self["textbook"] = Label(_("Bookmarks"))

        # Save parameters locally
        self.text = text
        self.filename = filename
        self.minFree = minFree
        self.realBookmarks = bookmarks
        self.bookmarks = bookmarks and bookmarks.value[:] or []
        self.userMode = userMode
        self.autoAdd = autoAdd
        self.editDir = editDir
        self.inhibitDirs = inhibitDirs

        # Initialize FileList
        self["filelist"] = FileList(currDir,
                                    showDirectories=True,
                                    showFiles=False,
                                    inhibitMounts=inhibitMounts,
                                    inhibitDirs=inhibitDirs)

        # Initialize BookList
        self["booklist"] = MenuList(self.bookmarks)

        # Buttons
        self["key_green"] = Button(_("OK"))
        self["key_yellow"] = Button(_("Rename"))
        self["key_blue"] = Button(_("Remove bookmark"))
        self["key_red"] = Button(_("Cancel"))

        # Background for Buttons
        self["green"] = Pixmap()
        self["yellow"] = Pixmap()
        self["blue"] = Pixmap()
        self["red"] = Pixmap()

        # Initialize Target
        self["target"] = Label()
        self["targetfreespace"] = Label()

        if self.userMode:
            self.usermodeOn()

        # Custom Action Handler
        class LocationBoxActionMap(HelpableActionMap):
            def __init__(self, parent, context, actions=None, prio=0):
                if not actions:
                    actions = {}
                HelpableActionMap.__init__(self, parent, context, actions,
                                           prio)
                self.box = parent

            def action(self, contexts, action):
                # Reset Quickselect
                self.box.timeout(force=True)

                return HelpableActionMap.action(self, contexts, action)

        # Actions that will reset quickselect
        self["WizardActions"] = LocationBoxActionMap(self, "WizardActions", {
            "ok": (self.ok, _("select")),
            "back": (self.cancel, _("Cancel")),
        }, -2)

        self["DirectionActions"] = LocationBoxActionMap(
            self, "DirectionActions", {
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
            }, -2)

        self["ColorActions"] = LocationBoxActionMap(
            self, "ColorActions", {
                "red": self.cancel,
                "green": self.select,
                "yellow": self.changeName,
                "blue": self.addRemoveBookmark,
            }, -2)

        self["EPGSelectActions"] = LocationBoxActionMap(
            self, "EPGSelectActions", {
                "prevService":
                (self.switchToBookList, _("switch to bookmarks")),
                "nextService":
                (self.switchToFileList, _("Switch to filelist")),
            }, -2)

        self["MenuActions"] = LocationBoxActionMap(self, "MenuActions", {
            "menu": (self.showMenu, _("menu")),
        }, -2)

        # Actions used by quickselect
        smsMsg = _("SMS style QuickSelect location selection")
        self["numberActions"] = HelpableNumberActionMap(
            self,
            "NumberActions", {
                "1": (self.keyNumberGlobal, smsMsg),
                "2": (self.keyNumberGlobal, smsMsg),
                "3": (self.keyNumberGlobal, smsMsg),
                "4": (self.keyNumberGlobal, smsMsg),
                "5": (self.keyNumberGlobal, smsMsg),
                "6": (self.keyNumberGlobal, smsMsg),
                "7": (self.keyNumberGlobal, smsMsg),
                "8": (self.keyNumberGlobal, smsMsg),
                "9": (self.keyNumberGlobal, smsMsg),
                "0": (self.keyNumberGlobal, smsMsg)
            },
            prio=0,
            description=_("Quick Select Actions"))

        # Run some functions when shown
        self.onShown.extend((
            boundFunction(self.setTitle, _("Select Location")),
            self.updateTarget,
            self.showHideRename,
        ))

        self.onLayoutFinish.append(self.switchToFileListOnStart)

        # Make sure we remove our callback
        self.onClose.append(self.disableTimer)
Exemplo n.º 18
0
    def __init__(self, session, plugin_path):
        Screen.__init__(self, session)
        self.skin = SKIN
        self.skin_path = plugin_path

        # Configuration values
        self.upperBound = int(config.plugins.AC3LipSync.outerBounds.getValue())
        self.lowerBound = -1 * self.upperBound
        self.arrowStepSize = int(
            config.plugins.AC3LipSync.arrowStepSize.getValue())
        self.stepSize = {}
        self.stepSize["3"] = int(
            config.plugins.AC3LipSync.stepSize13.getValue())
        self.stepSize["1"] = -1 * self.stepSize["3"]
        self.stepSize["6"] = int(
            config.plugins.AC3LipSync.stepSize46.getValue())
        self.stepSize["4"] = -1 * self.stepSize["6"]
        self.stepSize["9"] = int(
            config.plugins.AC3LipSync.stepSize79.getValue())
        self.stepSize["7"] = -1 * self.stepSize["9"]
        self.keyStep = {}
        self.keyStep["0"] = 0
        self.keyStep["2"] = int(
            config.plugins.AC3LipSync.absoluteStep2.getValue())
        self.keyStep["5"] = int(
            config.plugins.AC3LipSync.absoluteStep5.getValue())
        self.keyStep["8"] = int(
            config.plugins.AC3LipSync.absoluteStep8.getValue())

        # AC3delay instance
        self.AC3delay = AC3delay()

        # Last saved values
        self.savedValue = {}
        # Current Values
        self.currentValue = {}

        #OptionFields
        self["ChannelImg"] = MultiPixmap()
        self["GlobalImg"] = MultiPixmap()

        self["ChannelLabel"] = MultiColorLabel(_("Service delay"))
        self["GlobalLabel"] = MultiColorLabel(_("Global delay"))

        # Slider
        self["AudioSliderBar"] = ProgressBar()
        self["AudioSlider"] = Label(
            _("%i ms") % self.AC3delay.systemDelay[self.AC3delay.whichAudio])

        #Service Information
        self["ServiceInfoLabel"] = Label(_("Audio track:"))
        self["ServiceInfo"] = Label()
        self.setChannelInfoText()

        # Buttons
        self["key_red"] = Label(_("Cancel"))
        self["key_green"] = Label(_("OK"))
        self["key_yellow"] = Label("")
        self["key_blue"] = Label(_("Save to key"))

        # Actions
        self["actions"] = HelpableNumberActionMap(
            self, "PluginAudioSyncActions", {
                "menu": (self.keyMenu, _("Open plugin menu")),
                "ok": (self.keyOk, _("Save values and close plugin")),
                "cancel":
                (self.keyCancel, _("Discard changes and close plugin")),
                "left": (self.keyLeft, _("Change active delay")),
                "right": (self.keyRight, _("Change active delay")),
                "up": (self.keyUp, _("Increase delay")),
                "down": (self.keyDown, _("Decrease delay")),
                "red": (self.keyCancel, _("Discard changes and close plugin")),
                "green": (self.keyOk, _("Save values and close plugin")),
                "yellow": (self.deleteService, _("Delete in config")),
                "blue":
                (self.menuSaveDelayToKey, _("Save current delay to key")),
                "1": (self.keyNumberRelative,
                      _("Decrease delay by %i ms (can be set)") %
                      self.stepSize["1"]),
                "3": (self.keyNumberRelative,
                      _("Increase delay by %i ms (can be set)") %
                      self.stepSize["3"]),
                "4": (self.keyNumberRelative,
                      _("Decrease delay by %i ms (can be set)") %
                      self.stepSize["4"]),
                "6": (self.keyNumberRelative,
                      _("Increase delay by %i ms (can be set)") %
                      self.stepSize["6"]),
                "7": (self.keyNumberRelative,
                      _("Decrease delay by %i ms (can be set)") %
                      self.stepSize["7"]),
                "9": (self.keyNumberRelative,
                      _("Increase delay by %i ms (can be set)") %
                      self.stepSize["9"]),
                "0":
                (self.keyNumberAbsolute,
                 _("Set delay to %i ms (can be set)") % self.keyStep["0"]),
                "2":
                (self.keyNumberAbsolute,
                 _("Set delay to %i ms (can be set)") % self.keyStep["2"]),
                "5":
                (self.keyNumberAbsolute,
                 _("Set delay to %i ms (can be set)") % self.keyStep["5"]),
                "8": (self.keyNumberAbsolute,
                      _("Set delay to %i ms (can be set)") % self.keyStep["8"])
            }, -1)

        HelpableScreen.__init__(self)
        MovableScreen.__init__(self, config.plugins.AC3LipSync,
                               [self["actions"]], 600, 460)

        if audio_delay:
            self.listStreamService = audio_delay.ServiceDelay
        else:
            self.listStreamService = {}
        self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 19
0
	def __init__(self, list, session=None, on_change=None, fullUI=False):
		self.entryChanged = on_change if on_change is not None else lambda: None
		if fullUI:
			if "key_red" not in self:
				self["key_red"] = StaticText(_("Cancel"))
			if "key_green" not in self:
				self["key_green"] = StaticText(_("Save"))
			self["fullUIActions"] = HelpableActionMap(self, ["ConfigListActions"], {
				"cancel": (self.keyCancel, _("Cancel any changed settings and exit")),
				"close": (self.closeRecursive, _("Cancel any changed settings and exit all menus")),
				"save": (self.keySave, _("Save all changed settings and exit"))
			}, prio=1, description=_("Common Setup Actions"))
		if "key_menu" not in self:
			self["key_menu"] = StaticText(_("MENU"))
		if "HelpWindow" not in self:
			self["HelpWindow"] = Pixmap()
			self["HelpWindow"].hide()
		if "VKeyIcon" not in self:
			self["VKeyIcon"] = Boolean(False)
		self["configActions"] = HelpableActionMap(self, ["ConfigListActions"], {
			"select": (self.keySelect, _("Select, toggle, process or edit the current entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["navigationActions"] = HelpableActionMap(self, ["NavigationActions"], {
			"top": (self.keyTop, _("Move to first line / screen")),
			"pageUp": (self.keyPageUp, _("Move up a screen")),
			"up": (self.keyUp, _("Move up a line")),
			"first": (self.keyFirst, _("Jump to first item in list or the start of text")),
			"left": (self.keyLeft, _("Select the previous item in list or move cursor left")),
			"right": (self.keyRight, _("Select the next item in list or move cursor right")),
			"last": (self.keyLast, _("Jump to last item in list or the end of text")),
			"down": (self.keyDown, _("Move down a line")),
			"pageDown": (self.keyPageDown, _("Move down a screen")),
			"bottom": (self.keyBottom, _("Move to last line / screen"))
		}, prio=1, description=_("Common Setup Actions"))
		self["menuConfigActions"] = HelpableActionMap(self, "ConfigListActions", {
			"menu": (self.keyMenu, _("Display selection list as a selection menu")),
		}, prio=1, description=_("Common Setup Actions"))
		self["menuConfigActions"].setEnabled(False)
		self["editConfigActions"] = HelpableNumberActionMap(self, ["NumberActions", "TextEditActions"], {
			"backspace": (self.keyBackspace, _("Delete character to left of cursor or select AM times")),
			"delete": (self.keyDelete, _("Delete character under cursor or select PM times")),
			"erase": (self.keyErase, _("Delete all the text")),
			"toggleOverwrite": (self.keyToggle, _("Toggle new text inserts before or overwrites existing text")),
			"1": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"2": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"3": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"4": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"5": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"6": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"7": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"8": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"9": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"0": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"gotAsciiCode": (self.keyGotAscii, _("Keyboard data entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["editConfigActions"].setEnabled(False)
		self["VirtualKB"] = HelpableActionMap(self, "VirtualKeyboardActions", {
			"showVirtualKeyboard": (self.keyText, _("Display the virtual keyboard for data entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["VirtualKB"].setEnabled(False)
		self["config"] = ConfigList(list, session=session)
		self.setCancelMessage(None)
		self.setRestartMessage(None)
		self.onChangedEntry = []
		if self.noNativeKeys not in self.onLayoutFinish:
			self.onLayoutFinish.append(self.noNativeKeys)
		if self.handleInputHelpers not in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.handleInputHelpers)
		if self.showHelpWindow not in self.onExecBegin:
			self.onExecBegin.append(self.showHelpWindow)
		if self.hideHelpWindow not in self.onExecEnd:
			self.onExecEnd.append(self.hideHelpWindow)
Exemplo n.º 20
0
 def __init__(self, session, parentMenu):
     self.session = session
     self.parentMenu = parentMenu
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.menuList = []
     self["menu"] = List(self.menuList)
     self["menu"].onSelectionChanged.append(self.selectionChanged)
     self["menuimage"] = Pixmap()
     self["description"] = StaticText()
     self["key_menu"] = StaticText(_("MENU"))
     self["key_red"] = StaticText(_("Exit"))
     self["key_green"] = StaticText()
     self["key_yellow"] = StaticText()
     self["key_blue"] = StaticText()
     menuImageLibrary = resolveFilename(SCOPE_GUISKIN, "mainmenu")
     self.menuImageLibrary = menuImageLibrary if isdir(
         menuImageLibrary) else None
     self.showNumericHelp = False
     self.sortMode = False
     self.selectedEntry = None
     self.subMenuSort = None
     self.createMenuList()
     ProtectedScreen.__init__(self)  # ProtectedScreen needs self.menuID
     # For the skin: first try a menu_<menuID>, then Menu.
     self.skinName = []
     if self.menuID is not None:
         if config.usage.menuType.value == "horzanim" and findSkinScreen(
                 "Animmain"):
             self.skinName.append("Animmain")
         elif config.usage.menuType.value == "horzicon" and findSkinScreen(
                 "Iconmain"):
             self.skinName.append("Iconmain")
         else:
             self.skinName.append("Menu%s" % self.menuID)
             self.skinName.append("menu_%s" % self.menuID)
     self.skinName.append("Menu")
     if config.usage.menuType.value == "horzanim" and findSkinScreen(
             "Animmain"):
         self.onShown.append(self.openTestA)
     elif config.usage.menuType.value == "horzicon" and findSkinScreen(
             "Iconmain"):
         self.onShown.append(self.openTestB)
     self["menuActions"] = HelpableNumberActionMap(
         self, [
             "OkCancelActions", "MenuActions", "ColorActions",
             "NumberActions"
         ], {
             "ok": (self.okbuttonClick, _("Select the current menu item")),
             "cancel": (self.closeNonRecursive, _("Exit menu")),
             "close": (self.closeRecursive, _("Exit all menus")),
             "menu": (self.keySetupMenu, _("Change OSD Settings")),
             "red": (self.closeNonRecursive, _("Exit menu")),
             "1": (self.keyNumberGlobal, _("Direct menu item selection")),
             "2": (self.keyNumberGlobal, _("Direct menu item selection")),
             "3": (self.keyNumberGlobal, _("Direct menu item selection")),
             "4": (self.keyNumberGlobal, _("Direct menu item selection")),
             "5": (self.keyNumberGlobal, _("Direct menu item selection")),
             "6": (self.keyNumberGlobal, _("Direct menu item selection")),
             "7": (self.keyNumberGlobal, _("Direct menu item selection")),
             "8": (self.keyNumberGlobal, _("Direct menu item selection")),
             "9": (self.keyNumberGlobal, _("Direct menu item selection")),
             "0": (self.keyNumberGlobal, _("Direct menu item selection"))
         },
         prio=0,
         description=_("Menu Common Actions"))
     if config.usage.menuSortOrder.value == "user":
         self["moveActions"] = HelpableActionMap(
             self,
             ["NavigationActions"],
             {
                 "top": (self.keyTop, _("Move to first line / screen")),
                 "pageUp": (self.keyPageUp, _("Move up a screen")),
                 "up": (self.keyUp, _("Move up a line")),
                 # "first": (self.keyFirst, _("Jump to first item in list or the start of text")),
                 # "left": (self.keyLeft, _("Select the previous item in list or move cursor left")),
                 "left": (self.keyPageUp, _("Move up a screen")),
                 "right": (self.keyPageDown, _("Move down a screen")),
                 # "right": (self.keyRight, _("Select the next item in list or move cursor right")),
                 # "last": (self.keyLast, _("Jump to last item in list or the end of text")),
                 "down": (self.keyDown, _("Move down a line")),
                 "pageDown": (self.keyPageDown, _("Move down a screen")),
                 "bottom": (self.keyBottom, _("Move to last line / screen"))
             },
             prio=-1,
             description=_("Menu Navigation Actions"))
         self["editActions"] = HelpableActionMap(
             self, ["ColorActions"], {
                 "green":
                 (self.keyGreen, _("Toggle item move mode on/off")),
                 "yellow": (self.keyYellow,
                            _("Toggle hide/show of the current item")),
                 "blue":
                 (self.toggleSortMode, _("Toggle item edit mode on/off"))
             },
             prio=0,
             description=_("Menu Edit Actions"))
     title = parentMenu.get("title", "") or None
     title = title and _(title)
     if title is None:
         title = _(parentMenu.get("text", ""))
     self.setTitle(title)
     self.number = 0
     self.nextNumberTimer = eTimer()
     self.nextNumberTimer.callback.append(self.okbuttonClick)
     if len(
             self.menuList
     ) == 1:  # Does this menu have only one item, if so just run that item.
         self.onExecBegin.append(self.singleItemMenu)
     self.onLayoutFinish.append(self.layoutFinished)
Exemplo n.º 21
0
    def __init__(self, session, parent):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        list = []

        menuID = None
        for x in parent:  #walk through the actual nodelist
            if not x.tag:
                continue
            if x.tag == 'item':
                item_level = int(x.get("level", 0))
                if item_level <= config.usage.setup_level.index:
                    self.addItem(list, x)
                    count += 1
            elif x.tag == 'menu':
                self.addMenu(list, x)
                count += 1
            elif x.tag == "id":
                menuID = x.get("val")
                count = 0

            if menuID is not None:
                # menuupdater?
                if menuupdater.updatedMenuAvailable(menuID):
                    for x in menuupdater.getUpdatedMenu(menuID):
                        if x[1] == count:
                            list.append(
                                (x[0],
                                 boundFunction(self.runScreen,
                                               (x[2], x[3] + ", ")), x[4]))
                            count += 1

        if menuID is not None:
            # plugins
            for l in plugins.getPluginsForMenu(menuID):
                # check if a plugin overrides an existing menu
                plugin_menuid = l[2]
                for x in list:
                    if x[2] == plugin_menuid:
                        list.remove(x)
                        break
                if len(l) > 4 and l[4]:
                    list.append(
                        (l[0], boundFunction(l[1], self.session,
                                             self.close), l[2], l[3] or 50))
                else:
                    list.append((l[0], boundFunction(l[1],
                                                     self.session), l[2], l[3]
                                 or 50))

        # for the skin: first try a menu_<menuID>, then Menu
        self.skinName = []
        if menuID is not None:
            self.skinName.append("menu_" + menuID)
        self.skinName.append("Menu")
        self.menuID = menuID
        ProtectedScreen.__init__(self)

        # Sort by Weight
        if config.usage.sort_menus.value:
            list.sort()
        else:
            list.sort(key=lambda x: int(x[3]))

        if config.usage.menu_show_numbers.value:
            list = [(str(x[0] + 1) + "  " + x[1][0], x[1][1], x[1][2])
                    for x in enumerate(list)]

        self["menu"] = List(list)

        # self["menuActions"] = HelpableNumberActionMap(self, ["OkCancelActions", "MenuActions", "NumberActions"], {
        self["menuActions"] = HelpableNumberActionMap(
            self,
            ["OkCancelActions", "NumberActions"],
            {
                "ok": (self.okbuttonClick, _("Select the current menu item")),
                "cancel": (self.closeNonRecursive, _("Exit menu")),
                "close": (self.closeRecursive, _("Exit all menus")),
                # "menu": (self.closeRecursive, _("Exit all menus")),
                "1": (self.keyNumberGlobal, _("Direct menu item selection")),
                "2": (self.keyNumberGlobal, _("Direct menu item selection")),
                "3": (self.keyNumberGlobal, _("Direct menu item selection")),
                "4": (self.keyNumberGlobal, _("Direct menu item selection")),
                "5": (self.keyNumberGlobal, _("Direct menu item selection")),
                "6": (self.keyNumberGlobal, _("Direct menu item selection")),
                "7": (self.keyNumberGlobal, _("Direct menu item selection")),
                "8": (self.keyNumberGlobal, _("Direct menu item selection")),
                "9": (self.keyNumberGlobal, _("Direct menu item selection")),
                "0": (self.keyNumberGlobal, _("Direct menu item selection"))
            },
            prio=0,
            description=_("Common Menu Actions"))

        a = parent.get("title", "").encode("UTF-8") or None
        a = a and _(a) or _(parent.get("text", "").encode("UTF-8"))
        self.setTitle(a)

        self.number = 0
        self.nextNumberTimer = eTimer()
        self.nextNumberTimer.callback.append(self.okbuttonClick)
Exemplo n.º 22
0
 def __init__(self, session, tlist, menuTitle):
     Screen.__init__(self, session)
     self.tlist = tlist
     self.setTitle(menuTitle)
     self.skinName = "Iconmain"
     ipage = 1
     list = []
     nopic = len(self.tlist)
     self.pos = []
     self.ipage = 1
     self.index = 0
     self.icons = []
     self.indx = []
     n1 = len(tlist)
     self.picnum = n1
     list = []
     tlist = []
     self["label1"] = StaticText()
     self["label2"] = StaticText()
     self["label3"] = StaticText()
     self["label4"] = StaticText()
     self["label5"] = StaticText()
     self["label6"] = StaticText()
     self["label1s"] = StaticText()
     self["label2s"] = StaticText()
     self["label3s"] = StaticText()
     self["label4s"] = StaticText()
     self["label5s"] = StaticText()
     self["label6s"] = StaticText()
     self["pointer"] = Pixmap()
     self["pixmap1"] = Pixmap()
     self["pixmap2"] = Pixmap()
     self["pixmap3"] = Pixmap()
     self["pixmap4"] = Pixmap()
     self["pixmap5"] = Pixmap()
     self["pixmap6"] = Pixmap()
     self["key_red"] = StaticText(_("Exit"))
     self["key_green"] = StaticText(_("Select"))
     self["key_yellow"] = StaticText(_("Config"))
     self["actions"] = HelpableNumberActionMap(self, [
         "OkCancelActions", "MenuActions", "DirectionActions",
         "NumberActions", "ColorActions"
     ], {
         "ok": self.okbuttonClick,
         "cancel": self.closeNonRecursive,
         "left": self.key_left,
         "right": self.key_right,
         "up": self.key_up,
         "down": self.key_down,
         "red": self.cancel,
         "green": self.okbuttonClick,
         "yellow": self.key_menu,
         "menu": self.closeRecursive,
         "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
     },
                                               prio=0)
     self.index = 0
     i = 0
     self.maxentry = 29
     self.istart = 0
     i = 0
     self.onShown.append(self.openTest)
Exemplo n.º 23
0
	def __init__(self, session, parent):
		self.parentmenu = parent
		Screen.__init__(self, session)
		self.menuHorizontalSkinName = "MenuHorizontal"
		self.menuHorizontal = self.__class__.__name__ != "MenuSort" and config.usage.menu_style.value == "horizontal" and findSkinScreen(self.menuHorizontalSkinName)
		self.onHorizontalSelectionChanged = []
		self["key_blue"] = StaticText("")
		HelpableScreen.__init__(self)
		self.menulength = 0
		if not self.menuHorizontal:
			self["menu"] = List([])
			self["menu"].enableWrapAround = True
		self.createMenuList()

		# for the skin: first try a menu_<menuID>, then Menu
		self.skinName = []
		if self.menuHorizontal:
			if self.menuID:
				self.skinName.append(self.menuHorizontalSkinName + "_" + self.menuID)
			self.skinName.append(self.menuHorizontalSkinName)
		elif self.menuID:
			self.skinName.append("menu_" + self.menuID)
		self.skinName.append("Menu")

		ProtectedScreen.__init__(self)

		self["menuActions"] = HelpableActionMap(self, ["OkCancelActions", "MenuActions"],
		{
			"ok": (self.okbuttonClick, self.okbuttontext if hasattr(self, "okbuttontext") else _("Select the current menu item")),
			"cancel": (self.closeNonRecursive, self.exitbuttontext if hasattr(self, "exitbuttontext") else _("Exit menu")),
			"close": (self.closeRecursive, self.exitbuttontext if hasattr(self, "exitbuttontext") else _("Exit all menus")),
			"menu": (self.closeRecursive, _("Exit all menus")),
		}, prio=0, description=_("Common Menu Actions"))

		if self.__class__.__name__ != "MenuSort":
			self["menuActions2"] = HelpableNumberActionMap(self, ["NumberActions", "ColorActions"],
			{
				"0": (self.keyNumberGlobal, _("Direct menu item selection")),
				"1": (self.keyNumberGlobal, _("Direct menu item selection")),
				"2": (self.keyNumberGlobal, _("Direct menu item selection")),
				"3": (self.keyNumberGlobal, _("Direct menu item selection")),
				"4": (self.keyNumberGlobal, _("Direct menu item selection")),
				"5": (self.keyNumberGlobal, _("Direct menu item selection")),
				"6": (self.keyNumberGlobal, _("Direct menu item selection")),
				"7": (self.keyNumberGlobal, _("Direct menu item selection")),
				"8": (self.keyNumberGlobal, _("Direct menu item selection")),
				"9": (self.keyNumberGlobal, _("Direct menu item selection")),
				"blue": (self.keyBlue, _("Sort menu")),
			}, prio=0, description=_("Common Menu Actions"))
		title = parent.get("title", "")
		title = title and _(title) or _(parent.get("text", ""))
		title = self.__class__.__name__ == "MenuSort" and _("Menusort (%s)") % title or title
		self["title"] = StaticText(title)
		self.setTitle(title)

		self.number = 0
		self.nextNumberTimer = eTimer()
		self.nextNumberTimer.callback.append(self.okbuttonClick)
		if len(self.list) == 1:
			self.onExecBegin.append(self.__onExecBegin)
		if self.menuHorizontal:
			self.initMenuHorizontal()
Exemplo n.º 24
0
	def __init__(self, session, service, zapFunc = None, eventid = None, bouquetChangeCB = None, serviceChangeCB = None, EPGtype = None, StartBouquet = None, StartRef = None, bouquetname = ''):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.longbuttonpressed = False
		self.zapFunc = zapFunc
		self.bouquetChangeCB = bouquetChangeCB
		self.serviceChangeCB = serviceChangeCB
		graphic = False
		if EPGtype == 'single':
			self.type = EPG_TYPE_SINGLE
		elif EPGtype == 'infobar':
			self.type = EPG_TYPE_INFOBAR
		elif EPGtype == 'enhanced':
			self.type = EPG_TYPE_ENHANCED
		elif EPGtype == 'graph':
			self.type = EPG_TYPE_GRAPH
			if config.epgselection.graph_type_mode.getValue() == "graphics":
				graphic = True
		elif EPGtype == 'infobargraph':
			self.type = EPG_TYPE_INFOBARGRAPH
			if config.epgselection.infobar_type_mode.getValue() == "graphics":
				graphic = True
		elif EPGtype == 'multi':
			self.type = EPG_TYPE_MULTI
		else:
			self.type = EPG_TYPE_SIMILAR
		if not self.type == EPG_TYPE_SINGLE:
			self.StartBouquet = StartBouquet
			self.StartRef = StartRef
			self.bouquetname = bouquetname
			self.servicelist = None
		self.ask_time = -1
		self.closeRecursive = False
		self.eventviewDialog = None
		self.eventviewWasShown = False
		self.currch = None
		self.session.pipshown = False
		if plugin_PiPServiceRelation_installed:
			self.pipServiceRelation = getRelationDict()
		else:
			self.pipServiceRelation = {}
		self['Service'] = ServiceEvent()
		self['Event'] = Event()
		self.key_green_choice = self.EMPTY
		self['key_red'] = Button(_('IMDb Search'))
		self['key_green'] = Button(_('Add Timer'))
		self['key_yellow'] = Button(_('EPG Search'))
		self['key_blue'] = Button(_('Add AutoTimer'))
		self['okactions'] = HelpableActionMap(self, 'OkCancelActions',
			{
				'cancel': (self.closeScreen, _('Exit EPG')),
				'OK': (self.OK, _('Zap to channel (setup in menu)')),
				'OKLong': (self.OKLong, _('Zap to channel and close (setup in menu)'))
			}, -1)
		self['okactions'].csel = self
		self['colouractions'] = HelpableActionMap(self, 'ColorActions', 
			{
				'red': (self.redButtonPressed, _('IMDB search for current event')),
				'redlong': (self.redlongButtonPressed, _('Sort EPG List')),
				'green': (self.greenButtonPressed, _('Add/Remove timer for current event')),
				'yellow': (self.yellowButtonPressed, _('Search for similar events')),
				'greenlong': (self.showTimerList, _('Show Timer List')),
				'blue': (self.blueButtonPressed, _('Add a auto timer for current event')),
				'bluelong': (self.bluelongButtonPressed, _('Show AutoTimer List'))
			}, -1)
		self['colouractions'].csel = self
		self['recordingactions'] = HelpableActionMap(self, 'InfobarInstantRecord', 
			{
				'ShortRecord': (self.doRecordTimer, _('Add a record timer for current event')),
				'LongRecord': (self.doZapTimer, _('Add a zap timer for current event'))
			}, -1)
		self['recordingactions'].csel = self
		if self.type == EPG_TYPE_SIMILAR:
			self.currentService = service
			self.eventid = eventid
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
		elif self.type == EPG_TYPE_SINGLE:
			self.currentService = ServiceReference(service)
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'info': (self.Info, _('Show detailed event info')),
					'epg': (self.Info, _('Show detailed event info')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.prevPage, _('Move up a page')),
					'right': (self.nextPage, _('Move down a page')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
		elif self.type == EPG_TYPE_INFOBAR or self.type == EPG_TYPE_ENHANCED:
			if self.type == EPG_TYPE_INFOBAR:
				self.skinName = 'QuickEPG'
				self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
					{
						'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
						'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
						'nextService': (self.nextPage, _('Move down a page')),
						'prevService': (self.prevPage, _('Move up a page')),
						'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
						'info': (self.Info, _('Show detailed event info')),
						'infolong': (self.InfoLong, _('Show single epg for current channel')),
						'menu': (self.createSetup, _('Setup menu'))
					}, -1)
				self['epgactions'].csel = self
				self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
					{
						'left': (self.prevService, _('Goto previous channel')),
						'right': (self.nextService, _('Goto next channel')),
						'up': (self.moveUp, _('Goto previous channel')),
						'down': (self.moveDown, _('Goto next channel'))
					}, -1)
				self['cursoractions'].csel = self
			elif self.type == EPG_TYPE_ENHANCED:
				self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
					{
						'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
						'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
						'nextService': (self.nextService, _('Goto next channel')),
						'prevService': (self.prevService, _('Goto previous channel')),
						'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
						'info': (self.Info, _('Show detailed event info')),
						'infolong': (self.InfoLong, _('Show single epg for current channel')),
						'menu': (self.createSetup, _('Setup menu'))
					}, -1)
				self['epgactions'].csel = self
				self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
					{
						'left': (self.prevPage, _('Move up a page')),
						'right': (self.nextPage, _('Move down a page')),
						'up': (self.moveUp, _('Goto previous channel')),
						'down': (self.moveDown, _('Goto next channel'))
					}, -1)
				self['cursoractions'].csel = self
			self['inputactions'] = HelpableNumberActionMap(self, 'NumberActions', 
				{
					'1': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'2': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'3': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'4': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'5': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'6': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'7': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'8': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'9': (self.keyNumberGlobal, _('enter number to jump to channel.'))
				}, -1)
			self['inputactions'].csel = self
			self.list = []
			self.servicelist = service
			self.currentService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		elif self.type == EPG_TYPE_GRAPH or self.type == EPG_TYPE_INFOBARGRAPH:
			if self.type == EPG_TYPE_GRAPH:
				if not config.epgselection.graph_pig.getValue():
					self.skinName = 'GraphicalEPG'
				else:
					self.skinName = 'GraphicalEPGPIG'
			elif self.type == EPG_TYPE_INFOBARGRAPH:
				self.skinName = 'GraphicalInfoBarEPG'
			now = time() - int(config.epg.histminutes.getValue()) * 60
			if self.type == EPG_TYPE_GRAPH:
				self.ask_time = self.ask_time = now - now % (int(config.epgselection.graph_roundto.getValue()) * 60)
			elif self.type == EPG_TYPE_INFOBARGRAPH:
				self.ask_time = self.ask_time = now - now % (int(config.epgselection.infobar_roundto.getValue()) * 60)
			self.closeRecursive = False
			self['lab1'] = Label(_('Wait please while gathering data...'))
			self['timeline_text'] = TimelineText(type=self.type,graphic=graphic)
			self['Event'] = Event()
			self['primetime'] = Label(_('PRIMETIME'))
			self['change_bouquet'] = Label(_('CHANGE BOUQUET'))
			self['jump'] = Label(_('JUMP 24 HOURS'))
			self['page'] = Label(_('PAGE UP/DOWN'))
			self.time_lines = []
			for x in range(0, MAX_TIMELINES):
				pm = Pixmap()
				self.time_lines.append(pm)
				self['timeline%d' % x] = pm

			self['timeline_now'] = Pixmap()
			self.services = service
			self.curBouquet = bouquetChangeCB
			self.updateTimelineTimer = eTimer()
			self.updateTimelineTimer.callback.append(self.moveTimeLines)
			self.updateTimelineTimer.start(60000)
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'nextService': (self.nextService, _('Jump forward 24 hours')),
					'prevService': (self.prevService, _('Jump back 24 hours')),
					'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
					'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
					'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'tv': (self.togglePIG, _('Toggle Picture In Graphics')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.leftPressed, _('Goto previous event')),
					'right': (self.rightPressed, _('Goto next event')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
			self['input_actions'] = HelpableNumberActionMap(self, 'NumberActions', 
				{
					'1': (self.keyNumberGlobal, _('Reduce time scale')),
					'2': (self.keyNumberGlobal, _('Page up')),
					'3': (self.keyNumberGlobal, _('Increase time scale')),
					'4': (self.keyNumberGlobal, _('page left')),
					'5': (self.keyNumberGlobal, _('Jump to current time')),
					'6': (self.keyNumberGlobal, _('Page right')),
					'7': (self.keyNumberGlobal, _('No of items switch (increase or reduced)')),
					'8': (self.keyNumberGlobal, _('Page down')),
					'9': (self.keyNumberGlobal, _('Jump to prime time')),
					'0': (self.keyNumberGlobal, _('Move to home of list'))
				}, -1)
			self['input_actions'].csel = self
		elif self.type == EPG_TYPE_MULTI:
			self.skinName = 'EPGSelectionMulti'
			self['now_button'] = Pixmap()
			self['next_button'] = Pixmap()
			self['more_button'] = Pixmap()
			self['now_button_sel'] = Pixmap()
			self['next_button_sel'] = Pixmap()
			self['more_button_sel'] = Pixmap()
			self['now_text'] = Label()
			self['next_text'] = Label()
			self['more_text'] = Label()
			self['date'] = Label()
			self.services = service
			self.curBouquet = bouquetChangeCB
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'nextService': (self.nextPage, _('Move down a page')),
					'prevService': (self.prevPage, _('Move up a page')),
					'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
					'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
					'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.leftPressed, _('Move up a page')),
					'right': (self.rightPressed, _('Move down a page')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
		if self.type == EPG_TYPE_GRAPH:
			time_epoch=config.epgselection.graph_prevtimeperiod.getValue()
		elif self.type == EPG_TYPE_INFOBARGRAPH:
			time_epoch=config.epgselection.infobar_prevtimeperiod.getValue()
		else:
			time_epoch=None
		self['list'] = EPGList(type=self.type, selChangedCB=self.onSelectionChanged, timer=session.nav.RecordTimer, time_epoch=time_epoch, overjump_empty=config.epgselection.overjump.getValue(), graphic=graphic)
		self.refreshTimer = eTimer()
		self.refreshTimer.timeout.get().append(self.refreshData)
		self.listTimer = eTimer()
		self.listTimer.timeout.get().append(self.hidewaitingtext)
		self.onLayoutFinish.append(self.onCreate)
Exemplo n.º 25
0
    def __init__(self,
                 session,
                 text="",
                 filename="",
                 currDir=None,
                 bookmarks=None,
                 userMode=False,
                 windowTitle=None,
                 minFree=None,
                 autoAdd=False,
                 editDir=False,
                 inhibitDirs=None,
                 inhibitMounts=None):
        Screen.__init__(self,
                        session,
                        mandatoryWidgets=["filetext", "quickselect"])
        NumericalTextInput.__init__(self,
                                    handleTimeout=False,
                                    mode="SearchUpper")
        HelpableScreen.__init__(self)
        if not inhibitDirs:
            inhibitDirs = []
        if not inhibitMounts:
            inhibitMounts = []
        self.text = text
        self.filename = filename
        self.bookmarks = bookmarks
        self.bookmarksList = bookmarks and bookmarks.value[:] or []
        self.bookmarksList.sort()
        self.userMode = userMode
        self.minFree = minFree
        self.autoAdd = autoAdd
        self.editDir = editDir
        self.inhibitDirs = inhibitDirs
        self["filetext"] = Label("  %s" % _("Directories"))
        self["filelist"] = FileList(currDir,
                                    showDirectories=True,
                                    showFiles=False,
                                    inhibitMounts=inhibitMounts,
                                    inhibitDirs=inhibitDirs,
                                    enableWrapAround=True)
        self["booktext"] = Label("  %s" % _("Bookmarks"))
        self["booklist"] = MenuList(self.formatBookmarks(self.bookmarksList),
                                    enableWrapAround=True)
        self["quickselect"] = Label("")
        self["quickselect"].visible = False
        self["text"] = Label(text)
        self["target"] = Label()
        self["key_menu"] = StaticText(_("MENU"))
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Select"))
        self["key_yellow"] = StaticText("")
        self["key_blue"] = StaticText("")
        self.timer = eTimer()  # Initialize QuickSelect timer.
        self.timer.callback.append(self.timeout)
        self.timerType = 0
        self.quickSelect = ""
        self.quickSelectPos = -1

        class LocationBoxActionMap(HelpableActionMap
                                   ):  # Custom action handler.
            def __init__(self,
                         parent,
                         context,
                         actions=None,
                         prio=0,
                         description=None):
                HelpableActionMap.__init__(self, parent, context, actions,
                                           prio, description)
                self.box = parent

            def action(self, contexts, action):
                if action not in ("0", "1", "2", "3", "4", "5", "6", "7", "8",
                                  "9"):
                    self.box.timeout(
                        force=True)  # Reset QuickSelect on non numbers.
                return HelpableActionMap.action(self, contexts, action)

        # Actions that will reset QuickSelect...
        self["locationActions"] = LocationBoxActionMap(self, [
            "LocationBoxActions", "NavigationActions"
        ], {
            "enter":
            (self.enter,
             (_("Change directory / Select bookmark"),
              _("If the upper panel is active pressing OK will change the current directory.  If the lower panel is active pressing OK will select the current bookmark and exit."
                ))),
            "cancel": (self.cancel, _("Cancel the location selection")),
            "menu": (self.showMenu, _("Display context menu")),
            "top": (self.moveTop, _("Move up to first line")),
            "pageUp": (self.pageUp, _("Move up a screen")),
            "up": (self.moveUp, _("Move up a line")),
            "down": (self.moveDown, _("Mode down a line")),
            "pageDown": (self.pageDown, _("Mode down a screen")),
            "bottom": (self.moveBottom, _("Move down to last line"))
        },
                                                       prio=0,
                                                       description=_(
                                                           "LocationBox Actions"
                                                       ))
        self["selectAction"] = LocationBoxActionMap(
            self,
            "LocationBoxActions", {
                "select":
                (self.select,
                 _("Select the currently highlighted location and exit"))
            },
            prio=0,
            description=_("LocationBox Actions"))
        self["selectAction"].setEnabled(True)
        self["panelActions"] = LocationBoxActionMap(
            self, ["LocationBoxActions", "NavigationActions"], {
                "first":
                (self.switchToFileList, _("Switch to directories panel")),
                "left":
                (self.switchToFileList, _("Switch to directories panel")),
                "right":
                (self.switchToBookList, _("Switch to bookmarks panel")),
                "last":
                (self.switchToBookList, _("Switch to bookmarks panel")),
                "swap": (self.swapPanels, _("Switch to the other panel"))
            },
            prio=0,
            description=_("Panel Selection Actions"))
        self["panelActions"].setEnabled(True)
        self["bookmarkAction"] = LocationBoxActionMap(
            self,
            "LocationBoxActions",
            {"bookmark": (self.addDeleteBookmark, _("Add / Delete bookmark"))},
            prio=0,
            description=_("Bookmark Actions"))
        self["bookmarkAction"].setEnabled(True)
        self["renameAction"] = LocationBoxActionMap(
            self,
            "LocationBoxActions",
            {"rename": (self.rename, _("Rename directory"))},
            prio=0,
            description=_("Directory Actions"))
        self["renameAction"].setEnabled(False)
        # Action used by QuickSelect...
        smsMsg = _("SMS style QuickSelect location selection")
        self["numberActions"] = HelpableNumberActionMap(
            self,
            "NumberActions", {
                "1": (self.keyNumberGlobal, smsMsg),
                "2": (self.keyNumberGlobal, smsMsg),
                "3": (self.keyNumberGlobal, smsMsg),
                "4": (self.keyNumberGlobal, smsMsg),
                "5": (self.keyNumberGlobal, smsMsg),
                "6": (self.keyNumberGlobal, smsMsg),
                "7": (self.keyNumberGlobal, smsMsg),
                "8": (self.keyNumberGlobal, smsMsg),
                "9": (self.keyNumberGlobal, smsMsg),
                "0": (self.keyNumberGlobal, smsMsg)
            },
            prio=0,
            description=_("Quick Select Actions"))
        self["numberActions"].setEnabled(True)
        if self.userMode:
            self.switchToBookList()
            self["filelist"].hide()
            self["bookmarkAction"].setEnabled(False)
            self["panelActions"].setEnabled(False)
        self.setTitle(
            _("Select Location") if windowTitle is None else windowTitle)
        if self.layoutFinished not in self.onLayoutFinish:
            self.onLayoutFinish.append(self.layoutFinished)