Пример #1
0
    def openSelection(self, current):
        print("Opening selection")
        ResumeHandler.setLastUsedMain(current, self.currentIndex)

        if (current["type"] == "emulator"):
            print("Opening emulator file selection")
            options = {}
            options["textColor"] = (55, 55, 55)
            options["background"] = current["background"]
            options["useSidebar"] = True

            if ("description" in current):
                options["description"] = current["description"]

            if ("folderIcon" in current):
                options["folderIcon"] = current["folderIcon"]

            if ("previews" in current):
                options["previews"] = current["previews"]

            if ("fileFilter" in current):
                options["fileFilter"] = current["fileFilter"]

            self.subComponent = FileChooser.FileChooser(
                self.screen, current["name"], current["selectionPath"], False,
                options, self.emulatorCallback)
            footer = Footer.Footer([("theme/direction.png", "select")],
                                   [("theme/b_button.png", "back"),
                                    ("theme/a_button.png", "select")],
                                   (255, 255, 255))
            self.subComponent.setFooter(footer)

        if (current["type"] == "native"):
            print("Opening native selection")
            options = {}
            options["background"] = current["background"]
            options["useSidebar"] = True
            self.subComponent = NativeAppList.NativeAppList(
                self.screen, current["name"], current["data"], options,
                self.nativeCallback)
            if ("allowEdit" in self.config["options"]
                    and self.config["options"]["allowEdit"]):
                footer = Footer.Footer(
                    [("theme/direction.png", "select")],
                    [("theme/b_button.png", "back"),
                     ("theme/a_button.png", "select"),
                     ("theme/select_button.png", "options")], (255, 255, 255))
            else:
                footer = Footer.Footer([("theme/direction.png", "select")],
                                       [("theme/b_button.png", "back"),
                                        ("theme/a_button.png", "select")],
                                       (255, 255, 255))
            self.subComponent.setFooter(footer)
Пример #2
0
    def openSelection(self, current):
        print("Opening selection")
        ResumeHandler.setLastUsedMain(current, self.currentIndex)

        options = Theme.getSelectionOptions()

        if (current["type"] == "emulator"):

            if ("useSelection" in current
                    and current["useSelection"] == False):
                print("Running emulator directly")
                self.emulatorCallback("", Keys.DINGOO_BUTTON_A, False)
                return

            print("Opening emulator file selection")

            options["entry"] = self.config["mainMenu"][self.currentIndex]
            options["background"] = current["background"]
            options["useSidebar"] = True
            options["useGamelist"] = current[
                "useGamelist"] if "useGamelist" in current else False

            options["backgroundColor"] = Theme.getColor(
                "selection/backgroundColor", (255, 255, 255, 160))

            if ("description" in current):
                options["description"] = current["description"]

            if ("folderIcon" in current):
                options["folderIcon"] = current["folderIcon"]

            if ("previews" in current):
                options["previews"] = current["previews"]

            if ("fileFilter" in current):
                options["fileFilter"] = current["fileFilter"]

            if ("useFileFilter" in current):
                options["useFileFilter"] = current["useFileFilter"]

            if ("limitSelection" in current):
                options["limitSelection"] = current["limitSelection"]

            if ("hideFolders" in current):
                options["hideFolders"] = current["hideFolders"]

            options["selectionPath"] = current["selectionPath"]

            self.subComponent = FileChooser.FileChooser(
                self.screen, current["name"], current["selectionPath"], False,
                options, self.emulatorCallback)
            footer = Footer.Footer([("theme/direction.png", "select")],
                                   [("theme/b_button.png", "back"),
                                    ("theme/start_button.png", "Open with"),
                                    ("theme/a_button.png", "select")],
                                   options["footerFontColor"],
                                   options["footerColor"])
            self.subComponent.setFooter(footer)

        if (current["type"] == "native"):
            print("Opening native selection")

            options["background"] = current["background"]
            options["useSidebar"] = True

            if ("linkPath" in current):
                options["linkPath"] = current["linkPath"]

            self.subComponent = NativeAppList.NativeAppList(
                self.screen, current["name"], current["data"], options,
                self.nativeCallback)
            if ("allowEdit" in self.config["options"]
                    and self.config["options"]["allowEdit"]):
                footer = Footer.Footer(
                    [("theme/direction.png", "select")],
                    [("theme/b_button.png", "back"),
                     ("theme/a_button.png", "select"),
                     ("theme/select_button.png", "options")],
                    options["footerFontColor"], options["footerColor"])
            else:
                footer = Footer.Footer([("theme/direction.png", "select")],
                                       [("theme/b_button.png", "back"),
                                        ("theme/a_button.png", "select")],
                                       options["footerFontColor"],
                                       options["footerFontColor"])
            self.subComponent.setFooter(footer)

        if (current["type"] == "lastPlayed"
                or current["type"] == "favourites"):
            print("Opening customList selection")

            options["background"] = current["background"]
            options["useSidebar"] = True
            options["type"] = current["type"]

            options["backgroundColor"] = Theme.getColor(
                "selection/backgroundColor", (255, 255, 255, 160))

            self.subComponent = NativeAppList.NativeAppList(
                self.screen, current["name"], current["data"], options,
                self.customListCallback)
            footer = Footer.Footer([("theme/direction.png", "select")],
                                   [("theme/b_button.png", "back"),
                                    ("theme/a_button.png", "select")],
                                   options["footerFontColor"],
                                   options["footerColor"])
            self.subComponent.setFooter(footer)