Beispiel #1
0
    def buildMovieListEntry(self, serviceref, info, begin, length):
        res = [None]
        width = self.l.getItemSize().width()
        date = _("Record date:") + ' ' + self.getDate(serviceref)
        time = _("Record time:") + ' ' + self.getTime(serviceref)
        description = serviceref.getShortDescription()
        filesize = float(getServiceSize(serviceref.getPath()) / (1024 * 1024))
        if filesize <= 999:
            size = "%d MB" % (filesize)
        else:
            format_string = "%%.%sf GB" % (
                config.AdvancedMovieSelection.filesize_digits.value)
            size = (format_string) % (filesize / 1000.0)

        res.append(
            MultiContentEntryText(pos=(5, 2),
                                  size=(width - 155, 26),
                                  font=0,
                                  flags=RT_HALIGN_LEFT,
                                  text=serviceref.getName()))
        res.append(
            MultiContentEntryText(pos=(width - 155, 2),
                                  size=(150, 26),
                                  font=0,
                                  flags=RT_HALIGN_RIGHT,
                                  text=size))
        res.append(
            MultiContentEntryText(pos=(5, 29),
                                  size=(width - 205, 22),
                                  font=1,
                                  flags=RT_HALIGN_LEFT,
                                  text=description))
        res.append(
            MultiContentEntryText(pos=(width - 205, 29),
                                  size=(200, 22),
                                  font=1,
                                  flags=RT_HALIGN_RIGHT,
                                  text=time))
        res.append(
            MultiContentEntryText(pos=(5, 54),
                                  size=(width - 205, 20),
                                  font=2,
                                  flags=RT_HALIGN_LEFT,
                                  text=os.path.dirname(serviceref.getPath())))
        res.append(
            MultiContentEntryText(pos=(width - 255, 54),
                                  size=(250, 22),
                                  font=2,
                                  flags=RT_HALIGN_RIGHT,
                                  text=date))
        return res
 def buildMovieListEntry(self, serviceref, info, begin, length):
     res = [ None ]
     width = self.l.getItemSize().width()
     date = _("Record date:") + ' ' + self.getDate(serviceref)
     time = _("Record time:") + ' ' + self.getTime(serviceref)
     description = serviceref.getShortDescription()
     filesize = realSize(getServiceSize(serviceref.getPath()), int(config.AdvancedMovieSelection.filesize_digits.value))
     res.append(MultiContentEntryText(pos=(self.line1Pos.x(), self.line1Pos.y()), size=(width - self.line1Pos.x() - self.line1Split, self.f0h), font=0, flags=RT_HALIGN_LEFT, text=serviceref.getName()))
     res.append(MultiContentEntryText(pos=(self.line2Pos.x(), self.line2Pos.y()), size=(width - self.line2Pos.x() - self.line2Split, self.f1h), font=1, flags=RT_HALIGN_LEFT, text=description))
     res.append(MultiContentEntryText(pos=(self.line3Pos.x(), self.line3Pos.y()), size=(width - self.line3Pos.x() - self.line3Split, self.f2h), font=2, flags=RT_HALIGN_LEFT, text=os.path.dirname(serviceref.getPath())))
     res.append(MultiContentEntryText(pos=(width - self.line1Split, self.line1Pos.y()), size=(self.line1Split - self.line1Pos.x(), self.f0h), font=0, flags=RT_HALIGN_RIGHT, text=filesize))
     res.append(MultiContentEntryText(pos=(width - self.line2Split, self.line2Pos.y()), size=(self.line2Split - self.line2Pos.x(), self.f1h), font=1, flags=RT_HALIGN_RIGHT, text=time))
     res.append(MultiContentEntryText(pos=(width - self.line3Split, self.line3Pos.y()), size=(self.line3Split - self.line3Pos.x(), self.f2h), font=2, flags=RT_HALIGN_RIGHT, text=date))
     return res
    def buildMovieListEntry(self, serviceref, info, begin, length):
        res = [ None ]
        width = self.l.getItemSize().width()
        date = _("Record date:") + ' ' + self.getDate(serviceref)
        time = _("Record time:") + ' ' + self.getTime(serviceref)
        description = serviceref.getShortDescription()
        filesize = float(getServiceSize(serviceref.getPath()) / (1024 * 1024))
        if filesize <= 999:
            size = "%d MB" % (filesize)
        else:
            format_string = "%%.%sf GB" % (config.AdvancedMovieSelection.filesize_digits.value)
            size = (format_string) % (filesize / 1000.0)

        res.append(MultiContentEntryText(pos=(5, 2), size=(width - 155, 26), font=0, flags=RT_HALIGN_LEFT, text=serviceref.getName()))
        res.append(MultiContentEntryText(pos=(width - 155, 2), size=(150, 26), font=0, flags=RT_HALIGN_RIGHT, text=size))
        res.append(MultiContentEntryText(pos=(5, 29), size=(width - 205, 22), font=1, flags=RT_HALIGN_LEFT, text=description))
        res.append(MultiContentEntryText(pos=(width - 205, 29), size=(200, 22), font=1, flags=RT_HALIGN_RIGHT, text=time))
        res.append(MultiContentEntryText(pos=(5, 54), size=(width - 205, 20), font=2, flags=RT_HALIGN_LEFT, text=os.path.dirname(serviceref.getPath())))
        res.append(MultiContentEntryText(pos=(width - 255, 54), size=(250, 22), font=2, flags=RT_HALIGN_RIGHT, text=date))
        return res