def __init__(self, session, title, item_descr, selected_items):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        SkinResolutionHelper.__init__(self)
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save/Close"))
        self["list"] = SelectionList([])
        self.selected_items = selected_items
        for l in item_descr:
            selected = False
            for x in selected_items:
                if l[0] in x:
                    selected = True
            self["list"].addSelection(l[1], l[0], 0, selected)

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "ok": (self["list"].toggleSelection, _("Toggle selected")),
                "cancel": (self.cancel, _("Cancel")),
            })
        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.cancel, _("Cancel")),
                "green": (self.accept, _("Save/Close"))
            })
        self.setTitle(title)
    def __init__(self, session, title="", text=""):
        #VirtualKeyBoard.__init__(self, session, title, text) Changed by Topfi, added parameter names
        VirtualKeyBoard.__init__(self, session, title=title, text=text)
        NumericalTextInput.__init__(self, nextFunc=self.nextFunc)
        SkinResolutionHelper.__init__(self)
        self.configText = None
        if config.AdvancedMovieSelection.keyboard.value == "virtual":
            use = self.KEYBOARD
        elif config.AdvancedMovieSelection.keyboard.value == "numerical":
            use = self.NUM_KEYB
        else:
            use = self.BOTH
        if not use & self.KEYBOARD:
            # hide the keyboard
            self["list"].hide()
            # overwrite VirtualKeyBoard actions
            # make sure not overwrite any action of base class
            self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions", "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"],
            {
                "ok": self.__ok,
                "cancel": self.__cancel,
                "left": self.dummy,
                "right": self.dummy,
                "up": self.dummy,
                "down": self.dummy,
                "red": self.__cancel,
                "green": self.__ok,
                "yellow": self.dummy,
                "deleteBackward": self.dummy,
                "back": self.dummy
            }, -2)

        if use & self.NUM_KEYB:
            self.timer = eTimer()
            self.timer.callback.append(self.timeout)
            self.configText = ConfigText("", False)
            if text:
                self.configText.text = text
                self.configText.marked_pos = len(text)
            self["config_actions"] = NumberActionMap(["SetupActions", "InputAsciiActions", "KeyboardInputActions"],
            {
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1) # to prevent left/right overriding the listbox
            if use & self.KEYBOARD:
                self.selectedKey = self.getKeyIndex(u"OK")

        self.onLayoutFinish.append(self.__onLayoutFinish)
        self.onClose.append(self.__onClose)
    def __init__(self, session, title="", text=""):
        #VirtualKeyBoard.__init__(self, session, title, text) Changed by Topfi, added parameter names
        VirtualKeyBoard.__init__(self, session, title=title, text=text)
        NumericalTextInput.__init__(self, nextFunc=self.nextFunc)
        SkinResolutionHelper.__init__(self)
        self.configText = None
        if config.AdvancedMovieSelection.keyboard.value == "virtual":
            use = self.KEYBOARD
        elif config.AdvancedMovieSelection.keyboard.value == "numerical":
            use = self.NUM_KEYB
        else:
            use = self.BOTH
        if not use & self.KEYBOARD:
            # hide the keyboard
            self["list"].hide()
            # overwrite VirtualKeyBoard actions
            # make sure not overwrite any action of base class
            self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions", "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"],
            {
                "ok": self.__ok,
                "cancel": self.__cancel,
                "left": self.dummy,
                "right": self.dummy,
                "up": self.dummy,
                "down": self.dummy,
                "red": self.__cancel,
                "green": self.__ok,
                "yellow": self.dummy,
                "deleteBackward": self.dummy,
                "back": self.dummy                
            }, -2)

        if use & self.NUM_KEYB:
            self.timer = eTimer()
            self.timer.callback.append(self.timeout)
            self.configText = ConfigText("", False)
            if text:
                self.configText.text = text
                self.configText.marked_pos = len(text)
            self["config_actions"] = NumberActionMap(["SetupActions", "InputAsciiActions", "KeyboardInputActions"],
            {
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1) # to prevent left/right overriding the listbox
            if use & self.KEYBOARD:
                self.selectedKey = self.getKeyIndex(u"OK") 
            
        self.onLayoutFinish.append(self.__onLayoutFinish)
        self.onClose.append(self.__onClose)
Beispiel #4
0
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     SkinResolutionHelper.__init__(self)
     self.timer = eTimer()
     self.timer.callback.append(self.update)
     self["ColorActions"] = HelpableActionMap(
         self, "ColorActions", {
             "red": (self.abort, _("Abort selected job")),
             "green": (self.close, _("Close")),
         })
     self["key_red"] = Button(_("Cancel"))
     self["key_green"] = Button(_("Close"))
     self["list"] = ProgressList()
     self["list"].connectSelChanged(self.selectionChanged)
     self["OkCancelActions"] = HelpableActionMap(
         self, "OkCancelActions", {
             "cancel": (self.close, _("Close")),
             "ok": (self.ok, _("Show detail of selected job"))
         })
     self.onShown.append(self.setWindowTitle)
Beispiel #5
0
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     SkinResolutionHelper.__init__(self)
     self.timer = eTimer()
     self.timer.callback.append(self.update)
     self["ColorActions"] = HelpableActionMap(self, "ColorActions",
         {
             "red": (self.abort, _("Abort selected job")),
             "green": (self.close, _("Close")),
         })
     self["key_red"] = Button(_("Cancel"))
     self["key_green"] = Button(_("Close"))
     self["list"] = ProgressList()
     self["list"].connectSelChanged(self.selectionChanged)
     self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
         {
             "cancel": (self.close, _("Close")),
             "ok": (self.ok, _("Show detail of selected job"))
         })
     self.onShown.append(self.setWindowTitle)
    def __init__(self, session, title, item_descr, selected_items):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        SkinResolutionHelper.__init__(self)
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save/Close"))
        self["list"] = SelectionList([])
        self.selected_items = selected_items
        for l in item_descr:
            selected = False
            for x in selected_items:
                if l[0] in x:
                    selected = True
            self["list"].addSelection(l[1], l[0], 0, selected)

        self["OkCancelActions"] = HelpableActionMap(
            self,
            "OkCancelActions",
            {"ok": (self["list"].toggleSelection, _("Toggle selected")), "cancel": (self.cancel, _("Cancel"))},
        )
        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {"red": (self.cancel, _("Cancel")), "green": (self.accept, _("Save/Close"))}
        )
        self.setTitle(title)
 def __init__(self, session, textinput):
     NumericalTextInputHelpDialog.__init__(self, session, textinput)
     SkinResolutionHelper.__init__(self)
 def __init__(self, session, textinput):
     NumericalTextInputHelpDialog.__init__(self, session, textinput)
     SkinResolutionHelper.__init__(self)