示例#1
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.skinName = 'TimerEditList'
     Screen.setTitle(self, _('PowerTimer List'))
     self.onChangedEntry = []
     list = []
     self.list = list
     self.fillTimerList()
     self['timerlist'] = PowerTimerList(list)
     self.key_red_choice = self.EMPTY
     self.key_yellow_choice = self.EMPTY
     self.key_blue_choice = self.EMPTY
     self['key_red'] = Button(' ')
     self['key_green'] = Button(_('Add'))
     self['key_yellow'] = Button(' ')
     self['key_blue'] = Button(' ')
     self['description'] = Label()
     self['ServiceEvent'] = ServiceEvent()
     self['actions'] = ActionMap(
         [
             'OkCancelActions', 'DirectionActions', 'ShortcutActions',
             'TimerEditActions'
         ], {
             'ok': self.openEdit,
             'cancel': self.leave,
             'green': self.addCurrentTimer,
             'log': self.showLog,
             'left': self.left,
             'right': self.right,
             'up': self.up,
             'down': self.down
         }, -1)
     self.setTitle(_('PowerTimer Overview'))
     self.session.nav.PowerTimer.on_state_change.append(self.onStateChange)
     self.onShown.append(self.updateState)
示例#2
0
    def __init__(self, session, menu_path=""):
        Screen.__init__(self, session)
        self.skinName = "TimerEditList"
        screentitle = _("PowerTimer List")
        self.menu_path = menu_path
        if config.usage.show_menupath.value == 'large':
            self.menu_path += screentitle
            title = self.menu_path
            self["menu_path_compressed"] = StaticText("")
            self.menu_path += ' / '
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            condtext = ""
            if self.menu_path and not self.menu_path.endswith(' / '):
                condtext = self.menu_path + " >"
            elif self.menu_path:
                condtext = self.menu_path[:-3] + " >"
            self["menu_path_compressed"] = StaticText(condtext)
            self.menu_path += screentitle + ' / '
        else:
            title = screentitle
            self["menu_path_compressed"] = StaticText("")
        Screen.setTitle(self, title)

        self.onChangedEntry = []
        list = []
        self.list = list
        self.fillTimerList()

        self["timerlist"] = PowerTimerList(list)

        self.key_red_choice = self.EMPTY
        self.key_yellow_choice = self.EMPTY
        self.key_blue_choice = self.EMPTY

        self["key_red"] = Button("")
        self["key_green"] = Button(_("Add"))
        self["key_yellow"] = Button("")
        self["key_blue"] = Button("")

        self["description"] = Label()

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "DirectionActions", "ShortcutActions",
                "TimerEditActions"
            ], {
                "ok": self.openEdit,
                "cancel": self.leave,
                "green": self.addCurrentTimer,
                "log": self.showLog,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down
            }, -1)
        self.session.nav.PowerTimer.on_state_change.append(self.onStateChange)
        self.onShown.append(self.updateState)
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "TimerEditList"
        Screen.setTitle(self, _("PowerTimer list"))

        self.onChangedEntry = []
        list = []
        self.list = list
        self.fillTimerList()

        self["timerlist"] = PowerTimerList(list)

        self.key_red_choice = self.EMPTY
        self.key_yellow_choice = self.EMPTY
        self.key_blue_choice = self.EMPTY

        if self.key_red_choice == StaticText:
            self["key_red"] = StaticText("")
            self["key_green"] = StaticText(_("Add"))
            self["key_yellow"] = StaticText("")
            self["key_blue"] = StaticText("")
        else:
            self["key_red"] = Button("")
            self["key_green"] = Button(_("Add"))
            self["key_yellow"] = Button("")
            self["key_blue"] = Button("")

        self["description"] = Label()

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "DirectionActions", "ShortcutActions",
                "TimerEditActions"
            ], {
                "ok": self.openEdit,
                "cancel": self.leave,
                "green": self.addCurrentTimer,
                "log": self.showLog,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down
            }, -1)
        self.session.nav.PowerTimer.on_state_change.append(self.onStateChange)
        self.onShown.append(self.updateState)