Пример #1
0
 def updateList(self):
     deviceIndex = self["list"].getIndex()
     deviceList = []
     for device in self.devices:
         deviceList.append(
             self.buildInterfaceList(
                 device[1], _(device[0]),
                 inputDevices.getDeviceAttribute(device[1], "type")))
     self["list"].setList(deviceList)
     size = len(deviceList)
     if deviceIndex >= size:
         deviceIndex = size - 1 if size else 0
     self["list"].setIndex(deviceIndex)
Пример #2
0
    def buildInterfaceList(self,
                           device,
                           description,
                           type,
                           isinputdevice=True):
        divpng = LoadPixmap(cached=True,
                            path=resolveFilename(SCOPE_GUISKIN, "div-h.png"))
        activepng = None
        devicepng = None
        enabled = inputDevices.getDeviceAttribute(device, 'enabled')

        if type == 'remote':
            if config.misc.rcused.value == 0:
                if enabled:
                    devicepng = LoadPixmap(
                        resolveFilename(SCOPE_GUISKIN,
                                        "icons/input_rcnew-configured.png"))
                else:
                    devicepng = LoadPixmap(
                        resolveFilename(SCOPE_GUISKIN,
                                        "icons/input_rcnew.png"))
            else:
                if enabled:
                    devicepng = LoadPixmap(
                        resolveFilename(SCOPE_GUISKIN,
                                        "icons/input_rcold-configured.png"))
                else:
                    devicepng = LoadPixmap(
                        resolveFilename(SCOPE_GUISKIN,
                                        "icons/input_rcold.png"))
        elif type == 'keyboard':
            if enabled:
                devicepng = LoadPixmap(
                    resolveFilename(SCOPE_GUISKIN,
                                    "icons/input_keyboard-configured.png"))
            else:
                devicepng = LoadPixmap(
                    resolveFilename(SCOPE_GUISKIN, "icons/input_keyboard.png"))
        elif type == 'mouse':
            if enabled:
                devicepng = LoadPixmap(
                    resolveFilename(SCOPE_GUISKIN,
                                    "icons/input_mouse-configured.png"))
            else:
                devicepng = LoadPixmap(
                    resolveFilename(SCOPE_GUISKIN, "icons/input_mouse.png"))
        elif isinputdevice:
            devicepng = LoadPixmap(
                resolveFilename(SCOPE_GUISKIN, "icons/input_rcnew.png"))
        return device, description, devicepng, divpng
Пример #3
0
    def updateList(self):
        self.list = []

        if iRcTypeControl.multipleRcSupported():
            self.list.append(
                self.buildInterfaceList("rctype",
                                        _("Configure remote control type"),
                                        None, False))

        for x in self.devices:
            dev_type = inputDevices.getDeviceAttribute(x[1], 'type')
            self.list.append(self.buildInterfaceList(x[1], _(x[0]), dev_type))

        self["list"].setList(self.list)
        self["list"].setIndex(self.currentIndex)
Пример #4
0
 def buildInterfaceList(self,
                        device,
                        description,
                        type,
                        isInputDevice=True):
     enabled = "-configured" if inputDevices.getDeviceAttribute(
         device, "enabled") else ""
     if type == "remote":
         deviceImage = "icons/input_rcnew%s.png" % enabled
     elif type == "keyboard":
         deviceImage = "icons/input_keyboard%s.png" % enabled
     elif type == "mouse":
         deviceImage = "icons/input_mouse%s.png" % enabled
     elif isInputDevice:
         deviceImage = "icons/input_rcnew.png"
     else:
         deviceImage = None
     if deviceImage:
         deviceImage = LoadPixmap(
             resolveFilename(SCOPE_GUISKIN, deviceImage))
     divImage = LoadPixmap(cached=True,
                           path=resolveFilename(SCOPE_GUISKIN, "div-h.png"))
     return ((device, description, deviceImage, divImage))