Beispiel #1
0
    def perform_ahead(self, timer: Timer) -> bool:

        found = -1
        for i in range(2, TIMERS):
            label, path, start, days = Timer.get_quick_info(i)
            if (found == -1 and timer.days == days and timer.s_start == start
                    and timer.s_path == path):

                found = i

        if found != -1:
            timer.i_timer = found

        timer.i_fade = FADE_OFF
        return True
Beispiel #2
0
    def ask_timer(self, timerid: int) -> int:

        options = [self.addon.getLocalizedString(32102)]
        for i in range(2, TIMERS):
            label, path, start, days = Timer.get_quick_info(i)
            options.append("%i: %s (%s%s)" %
                           (i - 1, label, self.days_to_short(days)
                            or self.addon.getLocalizedString(32034),
                            ", %s" % start if days else ""))

        selection = xbmcgui.Dialog().select(
            self.addon.getLocalizedString(32103), options, preselect=0)
        if selection == -1:
            return None
        elif selection == 0:
            self.addon.openSettings()
            return None
        else:
            return selection + 1