Example #1
0
 def setMode(self, mode):
     index = MODES.get(str(mode).upper(), 0)
     self.mapping = []
     for num in range(10):
         self.mapping.append((MAPPINGS[num][index]))
     locale = LOCALES.get(international.getLocale(), None)
     if locale is not None and index in list(range(6)):
         index = index % 3
         for num in range(10):
             if locale[num][index] is not None:
                 self.mapping[num] = locale[num][index]
     self.mapping = tuple(self.mapping)
 def getLanguage(self):
     return international.getLocale()
Example #3
0
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self["key_menu"] = StaticText(_("MENU"))
     self["key_info"] = StaticText(_("INFO"))
     self["key_red"] = StaticText()
     self["key_green"] = StaticText()
     self["key_yellow"] = StaticText()
     self["icons"] = MultiPixmap()
     self["icons"].hide()
     self["locales"] = List(None, enableWrapAround=True)
     self["locales"].onSelectionChanged.append(self.selectionChanged)
     self["description"] = StaticText()
     self["selectionActions"] = HelpableActionMap(
         self,
         "LocaleSelectionActions", {
             "menu": (self.keySettings,
                      _("Manage Locale/Language Selection settings")),
             "current": (self.keyCurrent,
                         _("Jump to the currently active locale/language")),
             "select":
             (self.keySelect,
              _("Select the currently highlighted locale/language for the user interface"
                )),
             "close":
             (self.closeRecursive,
              _("Cancel any changes the active locale/language and exit all menus"
                )),
             "cancel":
             (self.keyCancel,
              _("Cancel any changes to the active locale/language and exit")
              ),
             "save":
             (self.keySave,
              _("Apply any changes to the active locale/langauge and exit"))
         },
         prio=0,
         description=_("Locale/Language Selection Actions"))
     self["manageActions"] = HelpableActionMap(
         self,
         "LocaleSelectionActions", {
             "manage":
             (self.keyManage,
              (_("Purge all but / Add / Delete the currently highlighted locale/language"
                 ),
               _("Purge all but the current and permanent locales/languages.  Add the current locale/language if it is not installed.  Delete the current locale/language if it is installed."
                 )))
         },
         prio=0,
         description=_("Locale/Language Selection Actions"))
     topItem = _("Move up to first line")
     topDesc = _("Move up to the first line in the list.")
     pageUpItem = _("Move up one screen")
     pageUpDesc = _(
         "Move up one screen.  Move to the first line of the screen if this is the first screen."
     )
     upItem = _("Move up one line")
     upDesc = _(
         "Move up one line.  Move to the bottom of the previous screen if this is the first line of the screen.  Move to the last of the entry / list if this is the first line of the list."
     )
     downItem = _("Move down one line")
     downDesc = _(
         "Move down one line.  Move to the top of the next screen if this is the last line of the screen.  Move to the first line of the list if this is the last line on the list."
     )
     pageDownItem = _("Move down one screen")
     pageDownDesc = _(
         "Move down one screen.  Move to the last line of the screen if this is the last screen."
     )
     bottomItem = _("Move down to last line")
     bottomDesc = _("Move down to the last line in the list.")
     self["navigationActions"] = HelpableActionMap(
         self,
         "NavigationActions", {
             "top": (self.keyTop, (topItem, topDesc)),
             "pageUp": (self.keyPageUp, (pageUpItem, pageUpDesc)),
             "up": (self.keyUp, (upItem, upDesc)),
             "first": (self.keyTop, (topItem, topDesc)),
             "left": (self.keyPageUp, (pageUpItem, pageUpDesc)),
             "right": (self.keyPageDown, (pageDownItem, pageDownDesc)),
             "last": (self.keyBottom, (bottomItem, bottomDesc)),
             "down": (self.keyDown, (downItem, downDesc)),
             "pageDown": (self.keyPageDown, (pageDownItem, pageDownDesc)),
             "bottom": (self.keyBottom, (bottomItem, bottomDesc))
         },
         prio=0,
         description=_("List Navigation Actions"))
     self.initialLocale = international.getLocale()
     self.currentLocale = self.initialLocale
     self.packageTimer = eTimer()
     self.packageTimer.callback.append(self.processPackage)
     self.packageDoneTimer = eTimer()
     self.packageDoneTimer.callback.append(self.processPackageDone)
     self.onLayoutFinish.append(self.layoutFinished)