Exemplo n.º 1
0
 def __init__(self, tuplelist):
     entries = []
     for (obj, text) in tuplelist:
         entries.append(self.buildEntry(obj, text))
     MenuList.__init__(self,
                       entries,
                       enableWrapAround=False,
                       content=eListboxPythonMultiContent)
     tlf = TemplatedListFonts()
     self.l.setFont(0, gFont(tlf.face(tlf.BIG), tlf.size(tlf.BIG)))
     itemHeight = componentSizes.itemHeight(componentSizes.SELECTION_LIST,
                                            30)
     self.l.setItemHeight(itemHeight)
     self.markedForeground = 0xffffff
     self.markedBackground = 0xff0000
     colors = TemplatedColors().colors
     if "ListboxMarkedForeground" in colors:
         self.markedForeground = colors["ListboxMarkedForeground"]
     if "ListboxMarkedBackground" in colors:
         self.markedBackground = colors["ListboxMarkedBackground"]
     self.entry_marked = False
Exemplo n.º 2
0
        png = LoadPixmap(
            resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/plugin.png"))
    else:
        png = plugin.icon

    return [
        plugin,
        plugin.name,
        plugin.description,
        png,
        backcolor_sel,
    ]


#load markedselectedforegroundcolor from skin
colors = TemplatedColors().colors
if "ListboxMarkedAndSelectedForeground" in colors:
    markedForegroundSelected = colors["ListboxMarkedAndSelectedForeground"]
else:
    markedForegroundSelected = 8388608

SelectedPluginEntryComponent = lambda plugin: MyPluginEntryComponent(
    plugin, backcolor_sel=markedForegroundSelected)


class MyPluginList(PluginList):
    def __init__(self, *args, **kwargs):
        PluginList.__init__(self, *args, **kwargs)
        self.__inst = None

    def __instance(self):
Exemplo n.º 3
0
    def __init__(self, session=None):
        GUIComponent.__init__(self)

        self._componentSizes = componentSizes[componentSizes.SERVICE_LIST]
        Log.i(self._componentSizes)
        tlf = TemplatedListFonts()

        upper_service_name_limit = self.getDesktopWith() / 3
        config.usage.configselection_servicenamecolwidth.limits = [
            (100, upper_service_name_limit),
        ]
        self.session = session
        self.mode = self.MODE_NORMAL

        self.picFolder = LoadPixmap(cached=True,
                                    path=resolveFilename(
                                        SCOPE_CURRENT_SKIN,
                                        "skin_default/icons/folder.png"))
        self.picMarker = LoadPixmap(
            resolveFilename(SCOPE_CURRENT_SKIN,
                            "skin_default/icons/marker.png"))
        self.picDVB_S = LoadPixmap(
            resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_s-fs8.png"))
        self.picDVB_C = LoadPixmap(
            resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_c-fs8.png"))
        self.picDVB_T = LoadPixmap(
            resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_t-fs8.png"))
        self.picServiceGroup = LoadPixmap(
            resolveFilename(SCOPE_CURRENT_SKIN, "ico_service_group-fs8.png"))
        self.markedForeground = 0xffffff
        self.markedBackground = 0xff0000
        self.markedForegroundSelected = 0xffffff
        self.markedBackgroundSelected = 0x800000

        colors = TemplatedColors().colors
        if "ListboxMarkedForeground" in colors:
            self.markedForeground = colors["ListboxMarkedForeground"]
        if "ListboxMarkedBackground" in colors:
            self.markedBackground = colors["ListboxMarkedBackground"]
        if "ListboxMarkedAndSelectedForeground" in colors:
            self.markedForegroundSelected = colors[
                "ListboxMarkedAndSelectedForeground"]
        if "ListboxMarkedAndSelectedBackground" in colors:
            self.markedBackgroundSelected = colors[
                "ListboxMarkedAndSelectedBackground"]

        self.serviceNotAvail = 0xbbbbbb
        self.serviceEventProgressbarColor = None
        self.serviceEventProgressbarColorSelected = None
        self.serviceEventProgressbarBackColor = None
        self.serviceEventProgressbarBackColorSelected = None
        self.serviceEventProgressbarBorderColor = None
        self.serviceEventProgressbarBorderColorSelected = None
        self.serviceDescriptionColor = 0xe7b53f
        self.serviceDescriptionColorSelected = 0xe7b53f
        self.recordingColor = 0xff4A3C
        self.recordingColorSelected = 0xff4A3C
        self.additionalInfoColor = None
        self.additionalInfoColorSelected = None
        self.picServiceEventProgressbar = None
        self.selectionPixmapStandard = None
        self.selectionPixmapBig = None
        self.l = eListboxServiceContent()
        self.l.setBuildFunc(self.buildOptionEntry, True)
        self.l.setFont(
            0,
            gFont(tlf.face(TemplatedListFonts.SMALL),
                  tlf.size(TemplatedListFonts.SMALL)))  # AdditionalInfoFont
        self.l.setFont(
            1,
            gFont(tlf.face(TemplatedListFonts.MEDIUM),
                  tlf.size(TemplatedListFonts.MEDIUM)))  # ServiceNumberFont
        self.l.setFont(2,
                       gFont(tlf.face(TemplatedListFonts.BIG),
                             tlf.size(
                                 TemplatedListFonts.BIG)))  # ServiceNameFont
        self.l.setFont(3,
                       gFont(tlf.face(TemplatedListFonts.SMALL),
                             tlf.size(
                                 TemplatedListFonts.SMALL)))  # ServiceInfoFont
        self.serviceNameFont = gFont(tlf.face(TemplatedListFonts.BIG),
                                     tlf.size(TemplatedListFonts.BIG))
        self.serviceInfoFontHeight = tlf.size(TemplatedListFonts.SMALL)
        self.serviceInfoHeight = self.serviceInfoFontHeight + self._componentSizes.get(
            self.KEY_SERVICE_INFO_HEIGHT_ADD, 6)
        self.additionalInfoFont = gFont(tlf.face(TemplatedListFonts.SMALL),
                                        tlf.size(TemplatedListFonts.SMALL))
        self.list = []
        self.size = 0
        self.service_center = eServiceCenter.getInstance()
        self.numberoffset = 0
        self.is_playable_ignore = eServiceReference()
        self.root = None

        self.itemHeight = self._componentSizes.get(
            self.KEY_SERVICE_ITEM_HEIGHT, 28)
        self.itemHeightHigh = self._componentSizes.get(
            self.KEY_SERVICE_ITEM_HEIGHT_LARGE, 60)
        self.l.setItemHeight(self.itemHeight)
        self.onSelectionChanged = []
        self.recordingList = {}
        self.piconLoader = PiconLoader()
        if self.session:
            self.session.nav.RecordTimer.on_state_change.append(
                self.onTimerEntryStateChange)
        config.usage.configselection_showrecordings.addNotifier(
            self.getRecordingList, initial_call=True)
        config.usage.configselection_bigpicons.addNotifier(self.setItemHeight,
                                                           initial_call=True)
        config.usage.configselection_secondlineinfo.addNotifier(
            self.setItemHeight, initial_call=False)
        self._reloadTimer = eTimer()
        self.__reloadTimerConn = self._reloadTimer.timeout.connect(
            self._reload)